diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-30 22:12:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-30 22:12:34 +0000 |
commit | 6be364a555dce699d093f9d49cd14a9b0c174893 (patch) | |
tree | ac10770856206fb50d2e83acde528413f5f22009 /src/modules/clist | |
parent | d9c98bcdfca6da51a1a82dc6c0dc5996b3b6cd6d (diff) |
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/clc.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clcitems.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/cluiservices.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 10 |
7 files changed, 19 insertions, 23 deletions
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 788ae8604b..6840565c30 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -407,7 +407,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (dbcws->value.type == DBVT_ASCIIZ || dbcws->value.type == DBVT_UTF8) {
int groupId = atoi(dbcws->szSetting) + 1;
TCHAR szFullName[512];
- int i, nameLen, eq;
+ int i, eq;
//check name of group and ignore message if just being expanded/collapsed
if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
mir_tstrcpy(szFullName, contact->szText);
@@ -420,7 +420,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
}
group = group->parent;
- nameLen = mir_tstrlen(group->cl.items[i]->szText);
+ size_t nameLen = mir_tstrlen(group->cl.items[i]->szText);
if (mir_tstrlen(szFullName) + 1 + nameLen > SIZEOF(szFullName)) {
szFullName[0] = '\0';
break;
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 36650d19be..252fb16320 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -234,7 +234,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int u else { group = cli.pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD) - 1, 0, 0); if (group == NULL) { - int i, len; + int i; DWORD groupFlags; TCHAR *szGroupName; if (!(style & CLS_HIDEEMPTYGROUPS)) { @@ -264,7 +264,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int u } if (!mir_tstrcmp(szGroupName, dbv.ptszVal)) break; - len = mir_tstrlen(szGroupName); + size_t len = mir_tstrlen(szGroupName); if (!_tcsncmp(szGroupName, dbv.ptszVal, len) && dbv.ptszVal[len] == '\\') cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1); } @@ -333,7 +333,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) if (group->scanIndex == group->cl.count) break; if (group->cl.items[i]->type == CLCIT_GROUP) { - int len = mir_tstrlen(group->cl.items[i]->szText); + size_t len = mir_tstrlen(group->cl.items[i]->szText); if (!_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) && (dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) { group->totalMembers--; diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 1f6b07e04c..2755f633e7 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -165,7 +165,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact * HFONT hFont = (HFONT)SelectObject(hdc, dat->fontInfo[hitcontact->type == CLCIT_GROUP ? FONTID_GROUPS : FONTID_CONTACTS].hFont);
SIZE textSize;
- GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
char *szCounts;
@@ -174,7 +174,7 @@ int fnHitTest(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, mir_strlen(szCounts), &textSize);
+ GetTextExtentPoint32A(hdc, szCounts, (int)mir_strlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -354,7 +354,7 @@ void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat) int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk)
{
ClcGroup *group = &dat->list;
- int testlen = mir_tstrlen(text);
+ size_t testlen = mir_tstrlen(text);
group->scanIndex = 0;
for (;;) {
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index eacb1ec87b..fb7fc61e47 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -1009,16 +1009,16 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM else
tszName[0] = 0;
- GetTextExtentPoint32(dis->hDC, tszName, mir_tstrlen(tszName), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, tszName, mir_tstrlen(tszName));
+ GetTextExtentPoint32(dis->hDC, tszName, (int)mir_tstrlen(tszName), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, tszName, (int)mir_tstrlen(tszName));
x += textSize.cx;
}
if (showOpts & 4) {
TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = _T("");
- 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));
+ GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus));
}
}
else if (dis->CtlType == ODT_MENU) {
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 8695adcb42..86ac9e7036 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -184,13 +184,13 @@ void fnCluiProtocolStatusChanged(int, const char*) if (showOpts & 4 && mir_tstrlen(tszName) < SIZEOF(tszName)-1)
mir_tstrcat(tszName, _T(" "));
- GetTextExtentPoint32(hdc, tszName, mir_tstrlen(tszName), &textSize);
+ GetTextExtentPoint32(hdc, tszName, (int)mir_tstrlen(tszName), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
TCHAR* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
- GetTextExtentPoint32(hdc, modeDescr, mir_tstrlen(modeDescr), &textSize);
+ GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 723bc73878..c20f92a82c 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -454,7 +454,7 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) int retVal = CDRF_NEWFONT; if (tvi.iImage == -1) { SIZE sz; - GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, mir_tstrlen(tvi.pszText), &sz); + GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, (int)mir_tstrlen(tvi.pszText), &sz); RECT rc; if (sz.cx+3 > pNMTVCD->nmcd.rc.right - pNMTVCD->nmcd.rc.left) @@ -467,7 +467,7 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) SetBkColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrTextBk); FillRect(pNMTVCD->nmcd.hdc, &rc, br); DeleteObject(br); - DrawText(pNMTVCD->nmcd.hdc, tvi.pszText, mir_tstrlen(tvi.pszText), &pNMTVCD->nmcd.rc, DT_LEFT|DT_VCENTER|DT_NOPREFIX); + DrawText(pNMTVCD->nmcd.hdc, tvi.pszText, (int)mir_tstrlen(tvi.pszText), &pNMTVCD->nmcd.rc, DT_LEFT | DT_VCENTER | DT_NOPREFIX); retVal |= CDRF_SKIPDEFAULT; } diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 716f9418ac..a7c1791bc0 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -243,9 +243,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) //rename subgroups
{
TCHAR szNewName[256];
- int len;
-
- len = mir_tstrlen(name);
+ size_t len = mir_tstrlen(name);
for (i=0;; i++) {
_itoa(i, str, 10);
if (db_get_ts(NULL, "CListGroups", str, &dbv))
@@ -305,10 +303,8 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) //rename subgroups
{
TCHAR szNewName[256];
- int len, i;
-
- len = mir_tstrlen(oldName);
- for (i=0;; i++) {
+ size_t len = mir_tstrlen(oldName);
+ for (int i=0;; i++) {
if (i == groupId)
continue;
_itoa(i, idstr, 10);
|