diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-10 18:25:55 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-10 18:25:55 +0000 |
commit | e6e9b81044d2e90cf6ec064898afce937f79382d (patch) | |
tree | 00a4789bc5bf54affa94b093e82f0698af0e800c | |
parent | f44732e721d3b3bd021edaae13b97beb425a8c60 (diff) |
mir_app: - warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16624 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/mir_app/src/clistsettings.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/icolib.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/menu_utils.cpp | 46 |
3 files changed, 27 insertions, 33 deletions
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 7d35be8aeb..fa7a706a62 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -209,14 +209,10 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact), 0);
}
}
-
- return 0;
}
-
- if (!strcmp(cws->szModule, "CList")) {
+ else if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = GetContactProto(hContact);
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
}
else
@@ -232,10 +228,8 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) Dbwcs2tstr(cws, pdnce->tszGroup);
}
}
-
- if (!strcmp(cws->szModule, "Protocol")) {
+ else if (!strcmp(cws->szModule, "Protocol")) {
if (!strcmp(cws->szSetting, "p")) {
- char *szProto;
if (cws->value.type == DBVT_DELETED)
szProto = NULL;
else
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index 816b9edfd0..ed0177275b 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -224,12 +224,12 @@ HICON IconSourceItem::getIcon() return icon;
}
-int IconSourceItem::getIconData(HICON icon)
+int IconSourceItem::getIconData(HICON hIcon)
{
icon_size = 0;
ICONINFO iconInfo;
- if (!GetIconInfo(icon, &iconInfo))
+ if (!GetIconInfo(hIcon, &iconInfo))
return 1; // Failure
int MonoInfoSize, ColorInfoSize, MonoBitsSize, ColorBitsSize;
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index d06a1e0263..b4cf7fcf73 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -937,29 +937,29 @@ static INT_PTR sttUpdateMenuService(WPARAM wParam, LPARAM) db_set_b(NULL, szModule, "MenuFormat", true);
MO_RecursiveWalkMenu(pmo->m_items.first, sttDumpItem, szModule);
}
- else { // yes, menu is already converted, simply load its data - for (int i = 0;; i++) { - char szSetting[100]; - mir_snprintf(szSetting, "Custom%d", i); - ptrA szCustomMenu(db_get_sa(NULL, szModule, szSetting)); - if (mir_strlen(szCustomMenu) != 32) - break; - - TMO_MenuItem mi = {}; - mi.flags = CMIF_CUSTOM; - mi.name.a = LPGEN("New submenu"); - mi.position = 500050000; - BYTE *p = (BYTE*)&mi.uid; - for (int i = 0; i < sizeof(MUUID); i++) { - int tmp; - sscanf(&szCustomMenu[i*2], "%02x", &tmp); - p[i] = tmp; - } - Menu_AddItem(pmo->id, &mi, NULL); - } - - MO_RecursiveWalkMenu(pmo->m_items.first, Menu_LoadFromDatabase, szModule); - } + else { // yes, menu is already converted, simply load its data
+ for (int j = 0;; j++) {
+ char szSetting[100];
+ mir_snprintf(szSetting, "Custom%d", j);
+ ptrA szCustomMenu(db_get_sa(NULL, szModule, szSetting));
+ if (mir_strlen(szCustomMenu) != 32)
+ break;
+
+ TMO_MenuItem mi = {};
+ mi.flags = CMIF_CUSTOM;
+ mi.name.a = LPGEN("New submenu");
+ mi.position = 500050000;
+ BYTE *p = (BYTE*)&mi.uid;
+ for (int k = 0; k < sizeof(MUUID); k++) {
+ int tmp;
+ sscanf(&szCustomMenu[k*2], "%02x", &tmp);
+ p[k] = tmp;
+ }
+ Menu_AddItem(pmo->id, &mi, NULL);
+ }
+
+ MO_RecursiveWalkMenu(pmo->m_items.first, Menu_LoadFromDatabase, szModule);
+ }
}
return 0;
}
|