From 6a6f2b9e3b2749f16b513dfc98d5d5038b5628fb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 May 2018 20:40:49 +0200 Subject: merge from master --- plugins/BasicHistory/src/HistoryWindow.cpp | 2 +- plugins/Clist_nicer/src/coolscroll.cpp | 2 +- plugins/DbEditorPP/src/copymodule.cpp | 3 +- plugins/DbEditorPP/src/deletemodule.cpp | 5 +- plugins/DbEditorPP/src/exportimport.cpp | 3 +- plugins/DbEditorPP/src/renamemodule.cpp | 3 +- plugins/DbEditorPP/src/settinglist.cpp | 13 +++-- plugins/DbEditorPP/src/settingsdlg.cpp | 3 +- plugins/MenuItemEx/src/main.cpp | 6 +-- plugins/PluginUpdater/src/Options.cpp | 3 +- plugins/Scriver/src/chat_window.cpp | 4 +- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msglog.cpp | 3 +- plugins/TabSRMM/src/chat_main.cpp | 2 +- plugins/TabSRMM/src/chat_options.cpp | 68 ++++++++++++------------ plugins/TabSRMM/src/chat_window.cpp | 4 +- plugins/TabSRMM/src/msgdialog.cpp | 2 +- plugins/TabSRMM/src/msglog.cpp | 2 +- plugins/TipperYM/src/options.cpp | 10 ++-- plugins/TopToolBar/src/toolbarwnd.cpp | 2 +- plugins/UserInfoEx/src/ctrl_contact.cpp | 3 +- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 6 ++- plugins/UserInfoEx/src/mir_icolib.cpp | 3 +- plugins/UserInfoEx/src/psp_anniversary.cpp | 36 +++++++------ plugins/UserInfoEx/src/psp_options.cpp | 6 ++- plugins/Variables/src/help.cpp | 2 +- plugins/Weather/src/weather_contacts.cpp | 6 ++- plugins/Weather/src/weather_ini.cpp | 3 +- plugins/YAMN/src/browser/mailbrowser.cpp | 3 +- 29 files changed, 115 insertions(+), 95 deletions(-) (limited to 'plugins') diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 8425368ad1..25f8cd4f7a 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -594,8 +594,8 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP ResetCList(hwndDlg); return FALSE; } + __fallthrough; - //fall through case IDC_SHOWHIDE: case IDC_FIND_TEXT: case IDC_EDIT: diff --git a/plugins/Clist_nicer/src/coolscroll.cpp b/plugins/Clist_nicer/src/coolscroll.cpp index 9e2ea12830..0d6b91aa0e 100644 --- a/plugins/Clist_nicer/src/coolscroll.cpp +++ b/plugins/Clist_nicer/src/coolscroll.cpp @@ -1190,7 +1190,7 @@ static UINT DrawScrollButton(SCROLLBUT *sbut, HDC hdc, const RECT *pctrl, UINT f if (sbut->uState != SBBS_NORMAL) flags |= SBBS_PUSHED; - //intentionally fall through here... + __fallthrough; case SBBT_PUSHBUTTON: diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 5ca149ee4e..052b6fd8d5 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -67,7 +67,8 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar SetCursor(LoadCursor(nullptr, IDC_ARROW)); } refreshTree(1); - // fall through + __fallthrough; + case IDCANCEL: mir_free(mac); DestroyWindow(hwnd); diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 4b07c0519b..2c08c762e4 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -90,7 +90,6 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - { char module[FLD_SIZE]; GetDlgItemTextA(hwnd, IDC_CONTACTS, module, _countof(module)); SetCursor(LoadCursor(nullptr, IDC_WAIT)); @@ -101,8 +100,8 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) deleteModule(NULL, module, 0); SetCursor(LoadCursor(nullptr, IDC_ARROW)); refreshTree(1); - } - // fall through + __fallthrough; + case IDCANCEL: if (working == 1) { working = 0; diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index b7a404c980..425abae95a 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -390,7 +390,8 @@ void importSettings(MCONTACT hContact, char *utf8) memmove(pstr + 1, pstr + 2, mir_strlen(pstr + 2) + 1); } } - // fall through - write it to database + __fallthrough; // write it to database + case 'u': case 'U': db_set_utf(hContact, module, setting, (end + 2)); diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp index f242fe5f1f..89122b9b39 100644 --- a/plugins/DbEditorPP/src/renamemodule.cpp +++ b/plugins/DbEditorPP/src/renamemodule.cpp @@ -51,7 +51,8 @@ static INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA refreshTree(1); } - // fall through + __fallthrough; + case IDCANCEL: DestroyWindow(hwnd); break; diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 26f5a6f9f7..aaa8591c8b 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -62,11 +62,13 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i case DBVT_WCHAR: if (!value) value = mir_wstrdup(dbv.pwszVal); - // fall through + __fallthrough; + case DBVT_UTF8: if (!value) value = mir_utf8decodeW(dbv.pszVal); - // fall through + __fallthrough; + case DBVT_ASCIIZ: if (!value) value = mir_a2u(dbv.pszVal); @@ -519,7 +521,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM case '0': i = 1; - // fall through + __fallthrough; + case '1': case '2': case '3': @@ -579,8 +582,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM msg(TranslateT("Unable to store value in this data type!")); break; } - - } // fall through + } + __fallthrough; case IDCANCEL: DestroyWindow(hwnd); diff --git a/plugins/DbEditorPP/src/settingsdlg.cpp b/plugins/DbEditorPP/src/settingsdlg.cpp index 30ddd1b373..10201f6965 100644 --- a/plugins/DbEditorPP/src/settingsdlg.cpp +++ b/plugins/DbEditorPP/src/settingsdlg.cpp @@ -247,7 +247,8 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l db_unset(dbsetting->hContact, dbsetting->module, dbsetting->setting); } - } // fall through + } + __fallthrough; case IDCANCEL: struct DBsetting *dbsetting = (struct DBsetting*)GetWindowLongPtr(hwnd, GWLP_USERDATA); diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 29a0aa89df..0a14892c56 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -389,11 +389,11 @@ static INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARA case WM_COMMAND: switch (LOWORD(wparam)) { case IDOK: - { - wchar_t tszReason[256] = { 0 }; + wchar_t tszReason[256]; GetDlgItemText(hdlg, IDC_REASON, tszReason, _countof(tszReason)); ProtoChainSend(hcontact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason); - } // fall through + __fallthrough; + case IDCANCEL: DestroyWindow(hdlg); break; diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 660b676d07..b8bbc5363c 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -161,7 +161,8 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar switch (LOWORD(wParam)) { case IDC_UPDATEONSTARTUP: EnableWindow(GetDlgItem(hwndDlg, IDC_ONLYONCEADAY), IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP)); - // fall through + __fallthrough; + case IDC_SILENTMODE: case IDC_ONLYONCEADAY: case IDC_BACKUP: diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 5021e20fb0..7331033f84 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -915,7 +915,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) tcd.iFlags = TCDF_TEXT; tcd.pszText = m_si->ptszName; SendMessage(m_hwndParent, CM_UPDATETABCONTROL, (WPARAM)&tcd, (LPARAM)m_hwnd); - // fall through + __fallthrough; case DM_ACTIVATE: if (m_si->wState & STATE_TALK) { @@ -1012,7 +1012,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) != WA_ACTIVE) break; - // fall through + __fallthrough; case WM_MOUSEACTIVATE: if (uMsg != WM_ACTIVATE) SetFocus(m_message.GetHwnd()); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 214c915608..faddf76067 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1302,7 +1302,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) != WA_ACTIVE) break; - //fall through + __fallthrough; case WM_MOUSEACTIVATE: if (m_hDbUnreadEventFirst != 0) { MEVENT hDbEvent = m_hDbUnreadEventFirst; diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index f388f9eae8..f594b637c1 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -695,7 +695,8 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG break; dat->stage = STREAMSTAGE_TAIL; - //fall through + __fallthrough; + case STREAMSTAGE_TAIL: dat->buffer = CreateRTFTail(); dat->stage = STREAMSTAGE_STOP; diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index 16bce15921..383267c89a 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -216,7 +216,7 @@ int Chat_Load() CheckUpdate(); Utils::RTF_CTableInit(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message Sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER }; pci = Chat_GetInterface(&data); pci->OnCreateModule = OnCreateModule; diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 49d8027208..613588c0e7 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -58,34 +58,34 @@ struct ColorOptionsList * (GetSysColor(default_color & 0x00ffffff)), not a rgb value. */ static ColorOptionsList _clrs[] = { - { 0, LPGENW("Message Sessions"), LPGENW("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR }, - { 1, LPGENW("Message Sessions"), LPGENW("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR }, - { 0, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR }, - { 1, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR }, - { 2, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR }, - { 3, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR }, - { 4, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR }, - { 5, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) }, - { 0, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background low"), "ipfieldsbg", 0x62caff }, - { 1, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 }, - { 0, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background high"), "tbBgHigh", 0 }, - { 1, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background low"), "tbBgLow", 0 }, - { 2, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Window fill color"), "fillColor", 0 }, - { 3, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Text area borders"), "cRichBorders", 0 }, - { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) }, - { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT }, + { 0, LPGENW("Message sessions"), LPGENW("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR }, + { 1, LPGENW("Message sessions"), LPGENW("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR }, + { 0, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR }, + { 1, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR }, + { 2, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR }, + { 3, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR }, + { 4, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR }, + { 5, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), LPGENW("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) }, + { 0, LPGENW("Message sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background low"), "ipfieldsbg", 0x62caff }, + { 1, LPGENW("Message sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 }, + { 0, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background high"), "tbBgHigh", 0 }, + { 1, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background low"), "tbBgLow", 0 }, + { 2, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Window fill color"), "fillColor", 0 }, + { 3, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Text area borders"), "cRichBorders", 0 }, + { 4, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) }, + { 4, LPGENW("Message sessions") L"/" LPGENW("Common colors"), LPGENW("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT }, }; static ColorOptionsList _tabclrs[] = { - { 0, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT }, - { 1, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT }, - { 2, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT }, - { 3, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT }, - - { 4, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE }, - { 5, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE }, - { 6, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE }, - { 7, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE } + { 0, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT }, + { 1, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT }, + { 2, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT }, + { 3, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT }, + + { 4, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE }, + { 5, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE }, + { 6, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE }, + { 7, LPGENW("Message sessions") L"/" LPGENW("Tabs"), LPGENW("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE } }; extern LOGFONT lfDefault; @@ -506,8 +506,8 @@ void RegisterFontServiceFonts() fid.deffontsettings.charset = lf.lfCharSet; fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL); wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE); - wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.backgroundGroup)); - wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), _countof(fid.backgroundGroup)); + wcsncpy(fid.group, LPGENW("Message sessions") L"/" LPGENW("Single Messaging"), _countof(fid.group)); switch (i) { case MSGFONTID_MYMSG: case 1: @@ -529,8 +529,8 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, LPGENW("Incoming background(old)"), _countof(fid.backgroundName)); break; case MSGFONTID_MESSAGEAREA: - wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group)); - wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup)); + wcsncpy(fid.group, LPGENW("Message sessions"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, LPGENW("Message sessions"), _countof(fid.backgroundGroup)); wcsncpy(fid.backgroundName, LPGENW("Input area background"), _countof(fid.backgroundName)); break; case 17: @@ -539,7 +539,7 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, LPGENW("Status background"), _countof(fid.backgroundName)); break; case 18: - wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup)); + wcsncpy(fid.backgroundGroup, LPGENW("Message sessions"), _countof(fid.backgroundGroup)); wcsncpy(fid.backgroundName, LPGENW("Log background"), _countof(fid.backgroundName)); break; case 19: @@ -554,8 +554,8 @@ void RegisterFontServiceFonts() fontOptionsList = IP_fontOptionsList; fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; - wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.group)); - wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.backgroundGroup)); + wcsncpy(fid.group, LPGENW("Message sessions") L"/" LPGENW("Info Panel"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, LPGENW("Message sessions") L"/" LPGENW("Info Panel"), _countof(fid.backgroundGroup)); wcsncpy(fid.backgroundName, LPGENW("Fields background"), _countof(fid.backgroundName)); for (int i = 0; i < IPFONTCOUNT; i++) { LoadMsgDlgFont(FONTSECTION_IP, i, &lf, &fontOptionsList[i].colour, FONTMODULE); @@ -572,12 +572,12 @@ void RegisterFontServiceFonts() if (i == IPFONTCOUNT - 1) { wcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup)); wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName)); - wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group)); + wcsncpy(fid.group, LPGENW("Message sessions"), _countof(fid.group)); } Font_RegisterW(&fid); } - wcsncpy(cid.group, LPGENW("Message Sessions") L"/" LPGENW("Group chats"), _countof(cid.group)); + wcsncpy(cid.group, LPGENW("Message sessions") L"/" LPGENW("Group chats"), _countof(cid.group)); strncpy(cid.dbSettingsGroup, CHAT_MODULE, _countof(cid.dbSettingsGroup)); for (int i = 0; i <= 7; i++) { mir_snprintf(cid.setting, "NickColor%d", i); diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index bf86bd245e..da2636eccf 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -1388,7 +1388,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) m_iLastEnterTime = 0; return 0; } - // fall through + __fallthrough; case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: @@ -1936,7 +1936,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) m_pContainer->hwndSaved = nullptr; break; } - // fall through + __fallthrough; case WM_MOUSEACTIVATE: UpdateWindowState(WM_ACTIVATE); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 41a908d09c..be9485c0e8 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2472,7 +2472,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ACTIVATE: if (LOWORD(wParam) != WA_ACTIVE) break; - // fall through + __fallthrough; case WM_MOUSEACTIVATE: MsgWindowUpdateState(WM_ACTIVATE); diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index c4c0ac3a40..e083b545fd 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1032,8 +1032,8 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG break; } dat->stage = STREAMSTAGE_TAIL; + __fallthrough; - // fall through case STREAMSTAGE_TAIL: mir_free(dat->buffer); dat->buffer = CreateRTFTail(); diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 13cf5ad354..67de4e4143 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1876,7 +1876,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_dw(0, MODULE, "FavContFlags", opt.iFavoriteContFlags); } - // fall through + __fallthrough; case IDC_BTN_CANCEL: DestroyWindow(hwndDlg); @@ -1943,8 +1943,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_CHK_ENABLETRAYTIP: state = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HANDLEBYTIPPER), state); - // fall through - + __fallthrough; + case IDC_CHK_HANDLEBYTIPPER: state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP); @@ -1953,8 +1953,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), state); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_FAVCONTACTS), state); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_EXPAND), state); - // fall through - + __fallthrough; + case IDC_CHK_EXPAND: state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index e0faf32262..332585f4f1 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -138,7 +138,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara supressRepos = false; break; } - // fall through + __fallthrough; case TTB_REPOSBUTTONS: if (g_ctrl->hWnd == hwnd) { diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 342a760f11..125b7575d3 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -306,7 +306,8 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam if ((int)IsDlgButtonChecked(hDlg, CHECK_SMS) != ((cbi->wFlags & CBEXIF_SMS) == CBEXIF_SMS)) cbi->wFlags ^= CBEXIF_SMS; } - //fall through + __fallthrough; + case IDCANCEL: if (HIWORD(wParam) == BN_CLICKED) EndDialog(hDlg, wParam); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index 1b7b7b3a76..8be503a6db 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -230,13 +230,15 @@ static DWORD ImportreadLine(FILE* file, LPSTR &str) case ';': // found a comment line bComment |= (l == 0); - // fall through + __fallthrough; + case '\t': case ' ': // ignore space and tab at the beginning of the line if (l == 0) break; - // fall through + __fallthrough; + default: if (!bComment) { str = mir_strncat_c(str, c); diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index a197d9d27c..3c3ed95943 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -193,7 +193,8 @@ void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, BYTE numCtrls) case STM_SETICON: case STM_SETIMAGE: ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE); - // fall through + __fallthrough; + case BM_SETIMAGE: SendMessage(hCtrl, pCtrl[i].Message, IMAGE_ICON, (LPARAM)hIcon); } diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp index fb51299823..f4f3b89427 100644 --- a/plugins/UserInfoEx/src/psp_anniversary.cpp +++ b/plugins/UserInfoEx/src/psp_anniversary.cpp @@ -71,26 +71,28 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w EnableWindow(GetDlgItem(hDlg, IDOK), GetWindowTextLength((HWND)lParam) > 0); break; - case IDOK: { - // read new description - HWND hEdit = GetDlgItem(hDlg, EDIT_CATEGORY); - int len = Edit_GetTextLength(hEdit); - LPTSTR pszText; - - if (len == 0 - || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(wchar_t))) == nullptr - || !Edit_GetText(hEdit, pszText, len + 1)) + case IDOK: { - MsgErr(hDlg, LPGENW("Please enter a valid description first!")); - break; - } + // read new description + HWND hEdit = GetDlgItem(hDlg, EDIT_CATEGORY); + int len = Edit_GetTextLength(hEdit); + LPTSTR pszText; + + if (len == 0 + || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(wchar_t))) == nullptr + || !Edit_GetText(hEdit, pszText, len + 1)) + { + MsgErr(hDlg, LPGENW("Please enter a valid description first!")); + break; + } - if (mir_wstrcmpi(pszText, pDlgEditAnniv->Description())) { - pDlgEditAnniv->Description(pszText); - pDlgEditAnniv->SetFlags(MAnnivDate::MADF_HASCUSTOM | MAnnivDate::MADF_CHANGED); + if (mir_wstrcmpi(pszText, pDlgEditAnniv->Description())) { + pDlgEditAnniv->Description(pszText); + pDlgEditAnniv->SetFlags(MAnnivDate::MADF_HASCUSTOM | MAnnivDate::MADF_CHANGED); + } } - } - // fall through + __fallthrough; + case IDCANCEL: return EndDialog(hDlg, LOWORD(wParam)); diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 057bc4c325..8c98ef6c57 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -554,7 +554,8 @@ static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wPar EnableControls(hDlg, idCtrl, _countof(idCtrl), bChecked); } - // fall through + __fallthrough; + case CHECK_OPT_GROUPS: case CHECK_OPT_SORTTREE: case CHECK_OPT_AEROADAPTION: @@ -707,7 +708,8 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam EnableControls(hDlg, idCtrl, _countof(idCtrl), bEnabled); } - // fall through + __fallthrough; + case EDIT_BIRTHMODULE: if (bInitialized && HIWORD(wParam) == CBN_SELCHANGE) NotifyParentOfChange(hDlg); diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index a605833839..59fd3b5170 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -952,7 +952,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l } dat->vhs->fi->hContact = (MCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0); } - // fall through + __fallthrough; case IDC_CANCEL: if (GetParent(hwndDlg) == nullptr) diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 2348e9b69b..c770ebd5d0 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -260,7 +260,8 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); if (!(BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) return TRUE; - // fall through + __fallthrough; + case IDC_BROWSE: // browse for the external log file GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str)); @@ -374,7 +375,8 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // re-enable the protocol and update the data for the station db_set_s(hContact, WEATHERPROTONAME, "LastCondition", "None"); UpdateSingleStation(hContact, 0); - // fall through + __fallthrough; + case IDCANCEL: // remove the dialog from window list and close it DestroyWindow(hwndDlg); diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index 994f80ce11..5e1caf5cef 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -199,7 +199,8 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_STEP4: WeatherAdd(0, 0); - // fall through + __fallthrough; + case IDCANCEL: // close the info window DestroyWindow(hwndDlg); diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 60ca3431e3..b5ffce0881 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -845,7 +845,8 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) pcli->pfnRemoveEvent(hContact, hContact); } - // fall through + __fallthrough; + case WM_CONTEXTMENU: PUDeletePopup(hWnd); break; -- cgit v1.2.3