diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdaway/awaymsg.cpp | 23 | ||||
-rw-r--r-- | src/core/stdchat/src/clist.cpp | 21 | ||||
-rw-r--r-- | src/core/stdchat/src/services.cpp | 3 | ||||
-rw-r--r-- | src/core/stdemail/email.cpp | 6 | ||||
-rw-r--r-- | src/core/stdfile/file.cpp | 9 | ||||
-rw-r--r-- | src/core/stdhelp/help.cpp | 3 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 6 | ||||
-rw-r--r-- | src/core/stduihist/history.cpp | 3 | ||||
-rw-r--r-- | src/core/stdurl/url.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 10 | ||||
-rw-r--r-- | src/modules/clist/movetogroup.cpp | 10 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 3 | ||||
-rw-r--r-- | src/modules/protocols/protoopts.cpp | 3 |
13 files changed, 39 insertions, 67 deletions
diff --git a/src/core/stdaway/awaymsg.cpp b/src/core/stdaway/awaymsg.cpp index 4419e34b53..af06a8c4f7 100644 --- a/src/core/stdaway/awaymsg.cpp +++ b/src/core/stdaway/awaymsg.cpp @@ -132,29 +132,26 @@ static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM clmi;
TCHAR str[128];
- char *szProto;
+ char *szProto = GetContactProto((HANDLE)wParam);
- szProto = GetContactProto((HANDLE)wParam);
- ZeroMemory(&clmi, sizeof(clmi));
- clmi.cbSize = sizeof(clmi);
- clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
if (szProto != NULL) {
int chatRoom = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
if ( !chatRoom) {
int status = DBGetContactSettingWord((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
mir_sntprintf(str, SIZEOF(str), TranslateT("Re&ad %s Message"), pcli->pfnGetStatusModeDescription(status, 0));
- clmi.ptszName = str;
+ mi.ptszName = str;
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) {
- clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_NOTOFFLINE | CMIM_ICON | CMIF_TCHAR;
- clmi.hIcon = LoadSkinProtoIcon(szProto, status);
+ mi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_NOTOFFLINE | CMIM_ICON | CMIF_TCHAR;
+ mi.hIcon = LoadSkinProtoIcon(szProto, status);
} } } }
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAwayMsgMenuItem, (LPARAM)&clmi);
- IcoLib_ReleaseIcon(clmi.hIcon, 0);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAwayMsgMenuItem, (LPARAM)&mi);
+ IcoLib_ReleaseIcon(mi.hIcon, 0);
return 0;
}
@@ -166,12 +163,10 @@ static int AwayMsgPreShutdown(WPARAM, LPARAM) int LoadAwayMsgModule(void)
{
- CLISTMENUITEM mi = {0};
-
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000005000;
mi.flags = CMIF_NOTOFFLINE;
mi.pszName = LPGEN("Re&ad Status Message");
diff --git a/src/core/stdchat/src/clist.cpp b/src/core/stdchat/src/clist.cpp index 83467c0c71..687ed7f50b 100644 --- a/src/core/stdchat/src/clist.cpp +++ b/src/core/stdchat/src/clist.cpp @@ -197,28 +197,27 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
// display this menu item only for chats
if ( DBGetContactSettingByte( hContact, szProto, "ChatRoom", 0 )) {
// still hide it for offline protos
if ( CallProtoService( szProto, PS_GETSTATUS, 0, 0 ) != ID_STATUS_OFFLINE ) {
- clmi.flags &= ~CMIF_HIDDEN;
- clmi.flags |= CMIM_NAME;
+ mi.flags &= ~CMIF_HIDDEN;
+ mi.flags |= CMIM_NAME;
if ( DBGetContactSettingWord( hContact, szProto, "Status", 0 ) == ID_STATUS_OFFLINE )
- clmi.pszName = ( char* )LPGEN("Join chat");
+ mi.pszName = ( char* )LPGEN("Join chat");
else
- clmi.pszName = ( char* )LPGEN("Open chat window");
+ mi.pszName = ( char* )LPGEN("Open chat window");
} } }
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hJoinMenuItem, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hJoinMenuItem, ( LPARAM )&mi );
- clmi.flags &= ~(CMIM_NAME | CMIF_DEFAULT);
- clmi.flags |= CMIF_NOTOFFLINE;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hLeaveMenuItem, ( LPARAM )&clmi );
+ mi.flags &= ~(CMIM_NAME | CMIF_DEFAULT);
+ mi.flags |= CMIF_NOTOFFLINE;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hLeaveMenuItem, ( LPARAM )&mi );
}
return 0;
}
diff --git a/src/core/stdchat/src/services.cpp b/src/core/stdchat/src/services.cpp index 6d08843093..247b71b3c9 100644 --- a/src/core/stdchat/src/services.cpp +++ b/src/core/stdchat/src/services.cpp @@ -219,8 +219,7 @@ static int ModulesLoaded(WPARAM wParam,LPARAM lParam) AddIcons();
LoadIcons();
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );
diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp index b18743d809..30d054c417 100644 --- a/src/core/stdemail/email.cpp +++ b/src/core/stdemail/email.cpp @@ -51,8 +51,7 @@ static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam) static int EMailPreBuildMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
DBVARIANT dbv = { 0 };
@@ -68,8 +67,7 @@ static int EMailPreBuildMenu(WPARAM wParam, LPARAM) int LoadSendRecvEMailModule(void)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000010000;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_SENDEMAIL);
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp index dfb77b086b..baa7aaeb2f 100644 --- a/src/core/stdfile/file.cpp +++ b/src/core/stdfile/file.cpp @@ -308,8 +308,7 @@ static void RemoveUnreadFileEvents(void) static int SRFilePreBuildMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
char *szProto = GetContactProto((HANDLE)wParam);
@@ -327,8 +326,7 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) static int SRFileModulesLoaded(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000020000;
mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_FILE);
mi.pszName = LPGEN("&File");
@@ -426,8 +424,7 @@ int LoadSendRecvFileModule(void) {
CreateServiceFunction("FtMgr/Show", FtMgrShowCommand);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_FILE);
mi.position = 1900000000;
diff --git a/src/core/stdhelp/help.cpp b/src/core/stdhelp/help.cpp index f077ee6261..3a01c3476f 100644 --- a/src/core/stdhelp/help.cpp +++ b/src/core/stdhelp/help.cpp @@ -84,8 +84,7 @@ int LoadHelpModule(void) hBugEvent = CreateHookableEvent(ME_HELP_BUGREPORT);
SetHookDefaultForHookableEvent(hBugEvent, BugCommandEvent);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszPopupName = LPGEN("&Help");
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 6167c53214..66dbc0b8e0 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -313,8 +313,7 @@ static int SplitmsgModulesLoaded(WPARAM wParam, LPARAM lParam) RegisterSRMMFonts();
LoadMsgLogIcons();
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090000;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_DEFAULT;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_EVENT_MESSAGE );
@@ -376,8 +375,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/src/core/stduihist/history.cpp b/src/core/stduihist/history.cpp index e67a32dc8e..e0567f2dcc 100644 --- a/src/core/stduihist/history.cpp +++ b/src/core/stduihist/history.cpp @@ -413,8 +413,7 @@ int PreShutdownHistoryModule(WPARAM, LPARAM) int LoadHistoryModule(void)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000090000;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_HISTORY);
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 767828dc3c..0b1f8c8714 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -115,8 +115,7 @@ static int ContactSettingChanged(WPARAM wParam, LPARAM lParam) static int SRUrlPreBuildMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
char *szProto = GetContactProto((HANDLE)wParam);
@@ -130,8 +129,7 @@ static int SRUrlPreBuildMenu(WPARAM wParam, LPARAM) static int SRUrlModulesLoaded(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000040000;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_URL);
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 612be5cd8e..8fcc0a3120 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -91,17 +91,14 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) TCHAR cls[128];
HANDLE hItem;
HWND hwndClist = GetFocus();
- CLISTMENUITEM mi;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
GetClassName(hwndClist, cls, SIZEOF(cls));
hwndClist = ( !lstrcmp(CLISTCONTROL_CLASS, cls)) ? hwndClist : cli.hwndContactList;
hItem = (HANDLE) SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
- if ( !hItem) {
+ if ( !hItem)
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- }
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hRenameMenuItem, (LPARAM) & mi);
return 0;
}
@@ -356,8 +353,7 @@ int LoadCLUIModule(void) 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
CreateServiceFunction("CList/DeleteContactCommand", MenuItem_DeleteContact);
mi.position = 2000070000;
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 56a5e89ddb..0e5bfd5420 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -66,8 +66,7 @@ static TCHAR* PrepareGroupName(TCHAR* str) static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hRoot;
mi.popupPosition = param; // param to pszService - only with CMIF_CHILDPOPUP !!!!!!
mi.position = pos;
@@ -87,11 +86,8 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) int i;
OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);
- if ( !hMoveToGroupItem)
- {
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ if ( !hMoveToGroupItem) {
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000;
mi.pszName = LPGEN("&Move to Group");
mi.flags = CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB;
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 4d8d71c438..4af9638e87 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1417,8 +1417,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) static int OptModulesLoaded(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 31f3302252..847fd15839 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -1033,8 +1033,7 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM) int OptProtosLoaded(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
|