From 688f55ba998c19304a29727c910504903f4cc49a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 18:51:36 +0000 Subject: lstr* replacements git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/skineditor/src/main.cpp | 2 +- plugins/Clist_nicer/src/CLCButton.cpp | 2 +- plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 10 +++++----- plugins/Clist_nicer/src/clc.cpp | 6 +++--- plugins/Clist_nicer/src/clcitems.cpp | 24 +++++++++++------------ plugins/Clist_nicer/src/clcpaint.cpp | 18 ++++++++--------- plugins/Clist_nicer/src/clcutils.cpp | 24 +++++++++++------------ plugins/Clist_nicer/src/clui.cpp | 16 +++++++-------- plugins/Clist_nicer/src/cluiservices.cpp | 12 ++++++------ plugins/Clist_nicer/src/config.cpp | 2 +- plugins/Clist_nicer/src/extBackg.cpp | 20 +++++++++---------- plugins/Clist_nicer/src/init.cpp | 4 ++-- plugins/Clist_nicer/src/viewmodes.cpp | 8 ++++---- 13 files changed, 74 insertions(+), 74 deletions(-) (limited to 'plugins/Clist_nicer') diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp index 62fcef06f2..9eca756415 100644 --- a/plugins/Clist_nicer/skineditor/src/main.cpp +++ b/plugins/Clist_nicer/skineditor/src/main.cpp @@ -731,7 +731,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa else if (item) { char *szName = item->szName[0] == '{' ? &item->szName[3] : item->szName; - TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, szName, lstrlenA(szName)); + TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, szName, mir_strlen(szName)); } return TRUE; } diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 7efef43e8d..79cf53b26a 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -328,7 +328,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) ctl->sLabel.cx = ctl->sLabel.cy = 0; } else { - GetTextExtentPoint32(hdcMem, ctl->szText, lstrlen(ctl->szText), &ctl->sLabel); + GetTextExtentPoint32(hdcMem, ctl->szText, mir_tstrlen(ctl->szText), &ctl->sLabel); if (g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left) ctl->sLabel.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8; diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index b75315df51..af499ceab3 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -1772,7 +1772,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM lParam) Frames[nFramescount].dwFlags = clfrm->Flags; - if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->wname) : lstrlenA(clfrm->name)) == 0) { + if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { TCHAR ptszClassName[256]; GetClassName(Frames[nFramescount].hWnd, ptszClassName, SIZEOF(ptszClassName)); Frames[nFramescount].name = mir_tstrdup(ptszClassName); @@ -1780,7 +1780,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM lParam) else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name); if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL - || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->TBwname) : lstrlenA(clfrm->TBname)) == 0) + || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0) Frames[nFramescount].TitleBar.tbname = mir_tstrdup(Frames[nFramescount].name); else Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname); @@ -2418,11 +2418,11 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid) if (!AlignCOLLIconToLeft) { if (Frames[pos].TitleBar.hicon != NULL) { DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, NULL, DI_NORMAL); - TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname)); + TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname)); } - else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname)); + else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname)); } - else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname)); + else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname)); if (!AlignCOLLIconToLeft) DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN) : LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL); diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 1449b0446f..0f58d631b8 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -161,7 +161,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) ReloadExtraInfo(hContact); if (!(cfg::dat.dwFlags & CLUI_USEMETAICONS) && !__strcmp(szProto, META_PROTO)) - if ((lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting)) + if ((mir_strlen(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting)) pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, hContact, lParam); } if (cfg::dat.bMetaEnabled && !__strcmp(cws->szModule, META_PROTO) && !__strcmp(cws->szSetting, "IsSubcontact")) @@ -420,7 +420,7 @@ LBL_Def: ClcContact *contact; if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; - lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText)); + mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText)); RTL_DetectAndSet(contact, 0); @@ -504,7 +504,7 @@ LBL_Def: contact->proto = GetContactProto(wParam); CallService(MS_CLIST_INVALIDATEDISPLAYNAME, wParam, 0); - lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText)); + mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText)); RTL_DetectAndSet(contact, 0); diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 8442edb661..94de708bef 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -225,7 +225,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) DBVARIANT dbv = {0}; INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv); - if ( !result && lstrlen(dbv.ptszVal) > 0) + if ( !result && mir_tstrlen(dbv.ptszVal) > 0) p->bStatusMsgValid = STATUSMSG_CLIST; else { if ( !szProto) @@ -233,11 +233,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) { if ( !result ) db_free( &dbv ); - if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0) + if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0) p->bStatusMsgValid = STATUSMSG_YIM; - else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 0) + else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0) p->bStatusMsgValid = STATUSMSG_GG; - else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0) + else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0) p->bStatusMsgValid = STATUSMSG_XSTATUS; } } @@ -246,8 +246,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if ( !result ) db_free( &dbv ); result = cfg::getTString(hContact, szProto, "XStatusName", &dbv); - if ( !result && lstrlen(dbv.ptszVal) > 1) { - int iLen = lstrlen(dbv.ptszVal); + if ( !result && mir_tstrlen(dbv.ptszVal) > 1) { + int iLen = mir_tstrlen(dbv.ptszVal); p->bStatusMsgValid = STATUSMSG_XSTATUSNAME; p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR)); _tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1); @@ -266,8 +266,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) cst.ptszName = xStatusName; if ( !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) { TCHAR *szwXstatusName = TranslateTS(xStatusName); - p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(szwXstatusName) + 2) * sizeof(TCHAR)); - _tcsncpy(p->statusMsg, szwXstatusName, lstrlen(szwXstatusName) + 1); + p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(TCHAR)); + _tcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1); p->bStatusMsgValid = STATUSMSG_XSTATUSNAME; } } @@ -276,7 +276,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) { int j = 0; - p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR)); + p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR)); for (int i = 0; dbv.ptszVal[i]; i++) { if (dbv.ptszVal[i] == (TCHAR)0x0d) continue; @@ -291,7 +291,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid != STATUSMSG_NOTFOUND) { WORD infoTypeC2[12]; ZeroMemory(infoTypeC2, sizeof(WORD) * 12); - int iLen = min(lstrlenW(p->statusMsg), 10); + int iLen = min(mir_wstrlen(p->statusMsg), 10); GetStringTypeW(CT_CTYPE2, p->statusMsg, iLen, infoTypeC2); p->dwCFlags &= ~ECF_RTLSTATUSMSG; for (int i = 0; i < 10; i++) { @@ -361,7 +361,7 @@ void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact) p = contact->pExtra; } if (p) { - iLen = min(lstrlenW(szText), 10); + iLen = min(mir_wstrlen(szText), 10); GetStringTypeW(CT_CTYPE2, szText, iLen, infoTypeC2); p->dwCFlags &= ~ECF_RTLNICK; for (i = 0; i < 10; i++) { @@ -382,7 +382,7 @@ void RTL_DetectGroupName(ClcContact *group) group->isRtl = 0; if (group->szText) { - iLen = min(lstrlenW(group->szText), 10); + iLen = min(mir_wstrlen(group->szText), 10); GetStringTypeW(CT_CTYPE2, group->szText, iLen, infoTypeC2); for (i = 0; i < 10; i++) { if (infoTypeC2[i] == C2_RIGHTTOLEFT) { diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 40434ce98e..ab0134290a 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -231,7 +231,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc) else { HICON hIcon = reinterpret_cast(LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0)); TCHAR *ptszNoEvents = TranslateT("No events..."); - DrawText(hDC, ptszNoEvents, lstrlen(ptszNoEvents), rc, DT_VCENTER | DT_SINGLELINE); + DrawText(hDC, ptszNoEvents, mir_tstrlen(ptszNoEvents), rc, DT_VCENTER | DT_SINGLELINE); DrawIconEx(hDC, 4, (rc->bottom + rc->top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT); DestroyIcon(hIcon); } @@ -495,7 +495,7 @@ set_bg_l: } else if (type == CLCIT_DIVIDER) { ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight); - GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize); + GetTextExtentPoint32(hdcMem, contact->szText, mir_tstrlen(contact->szText), &textSize); } else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST) ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight); @@ -510,13 +510,13 @@ set_bg_l: ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); if (type == CLCIT_GROUP) { - GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize); + GetTextExtentPoint32(hdcMem, contact->szText, mir_tstrlen(contact->szText), &textSize); width = textSize.cx; szCounts = pcli->pfnGetGroupCountsText(dat, contact); if (szCounts[0]) { GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize); ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight); - GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize); + GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize); width += spaceSize.cx + countsSize.cx; } } @@ -978,7 +978,7 @@ bgskipped: rc.left = rcContent.left; rc.right = rc.left - dat->rightMargin + ((clRect->right - rc.left - textSize.cx) >> 1) - 3; DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); - TextOut(hdcMem, rc.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, lstrlen(contact->szText)); + TextOut(hdcMem, rc.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, mir_tstrlen(contact->szText)); rc.left = rc.right + 6 + textSize.cx; rc.right = clRect->right - dat->rightMargin; DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); @@ -1013,7 +1013,7 @@ bgskipped: if (g_center) offset = ((rc.right - rc.left) - labelWidth) / 2; - TextOutA(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts)); + TextOutA(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts)); rightLineStart = rc.left + offset + textSize.cx + spaceSize.cx + countsSize.cx + 2; if (selected && !g_ignoreselforgroups) @@ -1122,7 +1122,7 @@ bgskipped: COLORREF oldColor = GetTextColor(hdcMem); int idOldFont = dat->currentFontID; ChangeToFont(hdcMem, dat, FONTID_TIMESTAMP, &fHeight); - GetTextExtentPoint32(hdcMem, szResult, lstrlen(szResult), &szTime); + GetTextExtentPoint32(hdcMem, szResult, mir_tstrlen(szResult), &szTime); verticalfit = (rowHeight - fHeight >= g_cysmIcon+1); if (av_right) { @@ -1204,7 +1204,7 @@ nodisplay: LONG rightIconsTop = rcContent.bottom - g_cysmIcon; LONG old_right = rcContent.right; ULONG textCounter = 0; - ULONG ulLen = lstrlen(szText); + ULONG ulLen = mir_tstrlen(szText); LONG old_bottom = rcContent.bottom; DWORD i_dtFlags = DT_WORDBREAK | DT_NOPREFIX | dt_2ndrowflags; dtp.cbSize = sizeof(dtp); @@ -1230,7 +1230,7 @@ nodisplay: if (type != CLCIT_DIVIDER) { TCHAR *szText = contact->szText; RECT rc; - int qlen = lstrlen(dat->szQuickSearch); + int qlen = mir_tstrlen(dat->szQuickSearch); if (hPreviousFont) SelectObject(hdcMem, hPreviousFont); SetTextColor(hdcMem, dat->quickSearchColour); diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 5b21bcaa72..cbbc46ce79 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -37,7 +37,7 @@ extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat); static int MY_pathIsAbsolute(const TCHAR *path) { - if ( !path || !(lstrlen(path) > 2)) + if ( !path || !(mir_tstrlen(path) > 2)) return 0; if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\')) @@ -48,30 +48,30 @@ static int MY_pathIsAbsolute(const TCHAR *path) size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut) { - if ( !pSrc || !lstrlen(pSrc) || lstrlen(pSrc) > MAX_PATH) + if ( !pSrc || !mir_tstrlen(pSrc) || mir_tstrlen(pSrc) > MAX_PATH) return 0; if ( !MY_pathIsAbsolute(pSrc)) { mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc); - return lstrlen(pOut); + return mir_tstrlen(pOut); } TCHAR szTmp[MAX_PATH]; mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s"), pSrc); _tcslwr(szTmp); if ( _tcsstr(szTmp, cfg::dat.tszProfilePath)) { - mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(cfg::dat.tszProfilePath) - 1); + mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + mir_tstrlen(cfg::dat.tszProfilePath) - 1); pOut[0]='.'; - return lstrlen(pOut); + return mir_tstrlen(pOut); } mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc); - return lstrlen(pOut); + return mir_tstrlen(pOut); } size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) { - if ( !pSrc || !lstrlen(pSrc) || lstrlen(pSrc) > MAX_PATH) + if ( !pSrc || !mir_tstrlen(pSrc) || mir_tstrlen(pSrc) > MAX_PATH) return 0; if (MY_pathIsAbsolute(pSrc)&&pSrc[0]!='.') @@ -79,7 +79,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) else if (pSrc[0]=='.') mir_sntprintf(pOut, MAX_PATH, _T("%s\\%s"), cfg::dat.tszProfilePath, pSrc); - return lstrlen(pOut); + return mir_tstrlen(pOut); } /* @@ -149,7 +149,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact hFont = reinterpret_cast(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont)); else hFont = reinterpret_cast(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont)); - GetTextExtentPoint32(hdc, hitcontact->szText, lstrlen(hitcontact->szText), &textSize); + GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize); width = textSize.cx; if (hitcontact->type == CLCIT_GROUP) { char *szCounts; @@ -158,7 +158,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact GetTextExtentPoint32A(hdc, " ", 1, &textSize); width += textSize.cx; SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont); - GetTextExtentPoint32A(hdc, szCounts, lstrlenA(szCounts), &textSize); + GetTextExtentPoint32A(hdc, szCounts, mir_strlen(szCounts), &textSize); width += textSize.cx; } } @@ -290,7 +290,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c hFont = reinterpret_cast(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont)); else hFont = reinterpret_cast(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont)); - GetTextExtentPoint32(hdc, hitcontact->szText, lstrlen(hitcontact->szText), &textSize); + GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize); width = textSize.cx; if (hitcontact->type == CLCIT_GROUP) { char *szCounts; @@ -299,7 +299,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c GetTextExtentPoint32A(hdc, " ", 1, &textSize); width += textSize.cx; SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont); - GetTextExtentPoint32A(hdc, szCounts, lstrlenA(szCounts), &textSize); + GetTextExtentPoint32A(hdc, szCounts, mir_strlen(szCounts), &textSize); width += textSize.cx; } } diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 1f2530a0b6..6b3f548bf7 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -885,7 +885,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) { DBVARIANT dbv = {0}; if (!db_get(NULL, "CList", "LastViewMode", &dbv)) { - if (lstrlenA(dbv.pszVal) > 2) { + if (mir_strlen(dbv.pszVal) > 2) { if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff) ApplyViewMode((char *)dbv.pszVal); } @@ -1765,22 +1765,22 @@ buttons_done: TCHAR szName[64]; PROTOACCOUNT *pa = ProtoGetAccount(szProto); if (pa) { - lstrcpyn(szName, pa->tszAccountName, SIZEOF(szName)); + mir_tstrncpy(szName, pa->tszAccountName, SIZEOF(szName)); szName[SIZEOF(szName) - 1] = 0; } else szName[0] = 0; - if (lstrlen(szName) < sizeof(szName) - 1) - lstrcat(szName, _T(" ")); - GetTextExtentPoint32(dis->hDC, szName, lstrlen(szName), &textSize); - TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, lstrlen(szName)); + if (mir_tstrlen(szName) < sizeof(szName) - 1) + mir_tstrcat(szName, _T(" ")); + GetTextExtentPoint32(dis->hDC, szName, mir_tstrlen(szName), &textSize); + TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, mir_tstrlen(szName)); x += textSize.cx; } if (showOpts & 4) { TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0); - GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize); - TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus)); + GetTextExtentPoint32(dis->hDC, szStatus, mir_tstrlen(szStatus), &textSize); + TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, mir_tstrlen(szStatus)); } } else if (dis->CtlType == ODT_MENU) { diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index e9140ed75b..d7ed5ed41c 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -140,16 +140,16 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto ) if (showOpts & 1) x += 16; if (showOpts & 2) { - lstrcpyn( szName, pa->tszAccountName, SIZEOF(szName)); + mir_tstrncpy( szName, pa->tszAccountName, SIZEOF(szName)); szName[ SIZEOF(szName)-1 ] = 0; - if (( showOpts & 4 ) && lstrlen(szName) < sizeof(szName)-1 ) - lstrcat( szName, _T(" ")); - GetTextExtentPoint32( hdc, szName, lstrlen(szName), &textSize ); + if (( showOpts & 4 ) && mir_tstrlen(szName) < sizeof(szName)-1 ) + mir_tstrcat( szName, _T(" ")); + GetTextExtentPoint32( hdc, szName, mir_tstrlen(szName), &textSize ); x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room } if (showOpts & 4) { TCHAR* modeDescr = pcli->pfnGetStatusModeDescription( CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0 ), 0 ); - GetTextExtentPoint32(hdc, modeDescr, lstrlen(modeDescr), &textSize ); + GetTextExtentPoint32(hdc, modeDescr, mir_tstrlen(modeDescr), &textSize ); x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room } partWidths[partCount]=(partCount?partWidths[partCount-1]:cfg::dat.bCLeft)+ x + 2; @@ -204,7 +204,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto ) // update the clui button if ( !db_get(NULL, "CList", "PrimaryStatus", &dbv)) { - if (dbv.type == DBVT_ASCIIZ && lstrlenA(dbv.pszVal) > 1) { + if (dbv.type == DBVT_ASCIIZ && mir_strlen(dbv.pszVal) > 1) { wStatus = (WORD) CallProtoService(dbv.pszVal, PS_GETSTATUS, 0, 0); iIcon = IconFromStatusMode(dbv.pszVal, (int) wStatus, 0, &hIcon); } diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 2034a7d7e5..47f27e5623 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -353,7 +353,7 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle) if (_tcslen(sysPathName) + _tcslen(szFilename) >= MAX_PATH) throw(CRTException("Error while loading system library", szFilename)); - lstrcat(sysPathName, szFilename); + mir_tstrcat(sysPathName, szFilename); if (useGetHandle) _h = ::GetModuleHandle(sysPathName); else diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 0c4832ba3e..7344e6e6c6 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -289,10 +289,10 @@ void LoadExtBkSettingsFromDB() mir_snprintf(p->szDBname, 30, "EXBK_%s", accs[i]->szModuleName); if (i == 0) { - lstrcpynA(p->szName, "{-}", 30); + mir_strncpy(p->szName, "{-}", 30); strncat(p->szName, accs[i]->szModuleName, 30); } - else lstrcpynA(p->szName, accs[i]->szModuleName, 30); + else mir_strncpy(p->szName, accs[i]->szModuleName, 30); p->statusID = ID_EXTBK_LAST; arStatusItems.insert(p); } @@ -1202,17 +1202,17 @@ void IMG_LoadItems() szSections[3001] = szSections[3000] = 0; char *p = szSections; - while (lstrlenA(p) > 1) { + while (mir_strlen(p) > 1) { if (p[0] == '$' || p[0] == '@') IMG_ReadItem(p, szFileName); - p += (lstrlenA(p) + 1); + p += (mir_strlen(p) + 1); } nextButtonID = IDC_TBFIRSTUID; p = szSections; - while (lstrlenA(p) > 1) { + while (mir_strlen(p) > 1) { if (p[0] == '!') BTN_ReadItem(p, szFileName); - p += (lstrlenA(p) + 1); + p += (mir_strlen(p) + 1); } if (pcli && pcli->hwndContactList) SetButtonStates(pcli->hwndContactList); @@ -1251,9 +1251,9 @@ void LoadPerContactSkins(TCHAR *tszFileName) GetPrivateProfileSectionNamesA(szSections, 3000, file); szSections[3001] = szSections[3000] = 0; p = szSections; - while (lstrlenA(p) > 1) { + while (mir_strlen(p) > 1) { if (p[0] == '%') { - p += (lstrlenA(p) + 1); + p += (mir_strlen(p) + 1); continue; } items = reinterpret_cast(realloc(items, i * sizeof(StatusItems_t))); @@ -1268,7 +1268,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) szItem[99] = 0; //_DebugPopup(0, "Section: %s -> %s", p, szItem); ReadItem(this_item, szItem, file); - p += (lstrlenA(p) + 1); + p += (mir_strlen(p) + 1); i++; } @@ -1300,7 +1300,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) int j; for (j = 0; j < i - 1; j++) { if (!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) && - lstrlenA(szProto) == lstrlenA(items[j].szName) && lstrlenA(UIN) == lstrlenA(items[j].szDBname)) { + mir_strlen(szProto) == mir_strlen(items[j].szName) && mir_strlen(UIN) == mir_strlen(items[j].szDBname)) { cfg::writeDword(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR); cfg::writeDword(hContact, "EXTBK", "COLOR1", items[j].COLOR); cfg::writeDword(hContact, "EXTBK", "COLOR2", items[j].COLOR2); diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 18fda921a4..eebaf61c4f 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -91,7 +91,7 @@ void _DebugTraceW(const wchar_t *fmt, ...) va_list va; va_start(va, fmt); - lstrcpyW(debug, L"CLN: "); + mir_wstrcpy(debug, L"CLN: "); mir_vsnwprintf(&debug[5], ibsize - 10, fmt, va); OutputDebugStringW(debug); @@ -106,7 +106,7 @@ void _DebugTraceA(const char *fmt, ...) va_list va; va_start(va, fmt); - lstrcpyA(debug, "CLN: "); + mir_strcpy(debug, "CLN: "); mir_vsnprintf(&debug[5], ibsize - 10, fmt, va); #ifdef _DEBUG OutputDebugStringA(debug); diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index c4909b02b6..b4a200fc46 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -663,7 +663,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); db_unset(NULL, CLVM_MODULE, szBuf); - if (!strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) { + if (!strcmp(cfg::dat.current_viewmode, szBuf) && mir_strlen(szBuf) == mir_strlen(cfg::dat.current_viewmode)) { cfg::dat.bFilterEffective = 0; pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); SetWindowTextA(hwndSelector, Translate("No view mode")); @@ -693,7 +693,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemTextA(hwndDlg, IDC_NEWVIEMODE, szBuf, SIZEOF(szBuf)); szBuf[255] = 0; - if (lstrlenA(szBuf) > 2) { + if (mir_strlen(szBuf) > 2) { if (cfg::getDword(CLVM_MODULE, szBuf, -1) != -1) MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK); else { @@ -1050,7 +1050,7 @@ void ApplyViewMode(const char *name) mir_snprintf(szSetting, 256, "%c%s_PF", 246, name); if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) { - if (lstrlenA(dbv.pszVal) >= 2) { + if (mir_strlen(dbv.pszVal) >= 2) { strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter)); cfg::dat.protoFilter[sizeof(cfg::dat.protoFilter) - 1] = 0; cfg::dat.bFilterEffective |= CLVM_FILTER_PROTOS; @@ -1059,7 +1059,7 @@ void ApplyViewMode(const char *name) } mir_snprintf(szSetting, 256, "%c%s_GF", 246, name); if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) { - if (lstrlen(dbv.ptszVal) >= 2) { + if (mir_tstrlen(dbv.ptszVal) >= 2) { _tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter)); cfg::dat.groupFilter[SIZEOF(cfg::dat.groupFilter) - 1] = 0; cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS; -- cgit v1.2.3