summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-28 14:21:33 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-28 14:21:33 +0300
commiteccbb5307a048e70ac4adb0d3fd333be28245fa8 (patch)
treea9a2c92c13391a5cf288c9e0d841833c54f3cd5e /src/mir_app
parent6a9e3738066370dac38f5f6768b8a6f61fe709e0 (diff)
massive cleanup of useless cbSize fields
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/meta_services.cpp2
-rw-r--r--src/mir_app/src/meta_utils.cpp2
-rw-r--r--src/mir_app/src/srmm_statusicon.cpp11
3 files changed, 9 insertions, 6 deletions
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index 327136abbb..5943c196cc 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -645,7 +645,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM)
InitMenus();
// create srmm icon
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = META_PROTO;
sid.flags = MBF_UNICODE;
sid.tszTooltip = LPGENW("Select metacontact");
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp
index 1192b28693..4ae42c329b 100644
--- a/src/mir_app/src/meta_utils.cpp
+++ b/src/mir_app/src/meta_utils.cpp
@@ -545,7 +545,7 @@ void Meta_FixStatus(DBCachedContact *ccMeta)
void Meta_UpdateSrmmIcon(DBCachedContact *ccMeta, int)
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = META_PROTO;
sid.flags = (ccMeta->IsMeta()) ? 0 : MBF_HIDDEN;
Srmm_ModifyIcon(ccMeta->contactID, &sid);
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp
index 9b2f37207f..f7887095fe 100644
--- a/src/mir_app/src/srmm_statusicon.cpp
+++ b/src/mir_app/src/srmm_statusicon.cpp
@@ -79,13 +79,13 @@ static int CompareIcons(const StatusIconMain *p1, const StatusIconMain *p2)
static OBJLIST<StatusIconMain> arIcons(3, CompareIcons);
-static HANDLE hHookIconsChanged;
+HANDLE hHookIconsChanged, hHookSrmmEvent;
/////////////////////////////////////////////////////////////////////////////////////////
MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, int _hLangpack)
{
- if (sid == nullptr || sid->cbSize != sizeof(StatusIconData))
+ if (sid == nullptr)
return 1;
StatusIconMain *p = arIcons.find((StatusIconMain*)sid);
@@ -110,7 +110,7 @@ MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, int _hLangpack)
MIR_APP_DLL(int) Srmm_ModifyIcon(MCONTACT hContact, StatusIconData *sid)
{
- if (sid == nullptr || sid->cbSize != sizeof(StatusIconData))
+ if (sid == nullptr)
return 1;
StatusIconMain *p = arIcons.find((StatusIconMain*)sid);
@@ -151,7 +151,7 @@ MIR_APP_DLL(int) Srmm_ModifyIcon(MCONTACT hContact, StatusIconData *sid)
MIR_APP_DLL(void) Srmm_RemoveIcon(const char *szProto, DWORD iconId)
{
- StatusIconData tmp = { sizeof(tmp), (char*)szProto, iconId };
+ StatusIconData tmp = { (char*)szProto, iconId };
StatusIconMain *p = arIcons.find((StatusIconMain*)&tmp);
if (p != nullptr)
arIcons.remove(p);
@@ -211,6 +211,7 @@ int LoadSrmmModule()
LoadSrmmToolbarModule();
+ hHookSrmmEvent = CreateHookableEvent(ME_MSG_WINDOWEVENT);
hHookIconsChanged = CreateHookableEvent(ME_MSG_ICONSCHANGED);
return 0;
}
@@ -219,7 +220,9 @@ void UnloadSrmmModule()
{
arIcons.destroy();
NotifyEventHooks(hHookIconsChanged, 0, 0);
+
DestroyHookableEvent(hHookIconsChanged);
+ DestroyHookableEvent(hHookSrmmEvent);
DestroyCursor(g_hCurHyperlinkHand);