From 1042a84dd1f01c249a946ec708d3dae2881ecfab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 28 Jan 2016 15:17:43 +0000 Subject: atavism removed: CLISTEVENT::cbSize git-svn-id: http://svn.miranda-ng.org/main/trunk@16180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdauth/src/auth.cpp | 5 ++--- src/core/stdfile/src/file.cpp | 3 +-- src/core/stdmsg/src/msgs.cpp | 9 ++++----- src/core/stduseronline/src/useronline.cpp | 6 ++---- src/mir_app/src/chat_clist.cpp | 3 +-- src/mir_app/src/clistevents.cpp | 7 +++---- 6 files changed, 13 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index 6f2bb36fee..1358e7858c 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -59,15 +59,14 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) MCONTACT hContact = DbGetAuthEventContact(&dbei); - CLISTEVENT cli = { 0 }; - cli.cbSize = sizeof(cli); + CLISTEVENT cli = {}; cli.hContact = hContact; cli.ptszTooltip = szTooltip; cli.flags = CLEF_TCHAR; cli.lParam = lParam; cli.hDbEvent = hDbEvent; - CONTACTINFO ci = { 0 }; + CONTACTINFO ci = {}; ci.cbSize = sizeof(ci); ci.hContact = hContact; ci.szProto = GetContactProto(hContact); diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 1ebfbae438..752c1f1fae 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -111,8 +111,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) { - CLISTEVENT cle = { 0 }; - cle.cbSize = sizeof(cle); + CLISTEVENT cle = {}; cle.hContact = hContact; cle.hDbEvent = hdbe; cle.lParam = lParam; diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 3172bdb661..ebb815c423 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -88,14 +88,15 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0; } - CLISTEVENT cle = { sizeof(cle) }; + TCHAR toolTip[256]; + mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + + CLISTEVENT cle = {}; cle.hContact = hContact; cle.hDbEvent = lParam; cle.flags = CLEF_TCHAR; cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; - TCHAR toolTip[256]; - mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = toolTip; pcli->pfnAddEvent(&cle); return 0; @@ -181,7 +182,6 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) pcli->pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; - cle.cbSize = sizeof(cle); cle.hContact = hContact; cle.hDbEvent = 1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; @@ -274,7 +274,6 @@ static void RestoreUnreadMessageAlerts(void) TCHAR toolTip[256]; CLISTEVENT cle = {}; - cle.cbSize = sizeof(cle); cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; cle.flags = CLEF_TCHAR; diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index ca6327d979..12f7cda357 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -57,17 +57,15 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) DWORD ticked = db_get_dw(NULL, "UserOnline", cws->szModule, GetTickCount()); // only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline if (GetTickCount() - ticked > (1000*10)) { - CLISTEVENT cle; TCHAR tooltip[256]; + mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0)); - memset(&cle, 0, sizeof(cle)); - cle.cbSize = sizeof(cle); + CLISTEVENT cle = {}; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hContact = hContact; cle.hDbEvent = uniqueEventId++; cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false); cle.pszService = "UserOnline/Description"; - mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = tooltip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); IcoLib_ReleaseIcon(cle.hIcon, 0); diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 24c7bba5c1..267fca44d5 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -212,8 +212,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker); va_end(marker); - CLISTEVENT cle = { 0 }; - cle.cbSize = sizeof(cle); + CLISTEVENT cle = {}; cle.hContact = hContact; cle.hDbEvent = hEvent; cle.flags = type | CLEF_TCHAR; diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index 8a6831b93e..2d7e90aaa2 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -54,7 +54,7 @@ int fnGetImlIconIndex(HICON hIcon) return imlIcon[i].index; } -static char * GetEventProtocol(int idx) +static char* GetEventProtocol(int idx) { if (!cli.events.count || idx < 0 && idx >= cli.events.count) return NULL; @@ -132,11 +132,10 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) CListEvent* fnAddEvent(CLISTEVENT *cle) { - int i; - - if (cle == NULL || cle->cbSize != sizeof(CLISTEVENT)) + if (cle == NULL) return NULL; + int i; if (cle->flags & CLEF_URGENT) { for (i=0; i < cli.events.count; i++) if (!(cli.events.items[i]->flags & CLEF_URGENT)) -- cgit v1.2.3