From 156e56230c1819245c0d9165629f8077b6417167 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 May 2018 20:23:43 +0200 Subject: code cleaning (using new MS coding style) --- 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 ++-- 5 files changed, 31 insertions(+), 23 deletions(-) (limited to 'plugins/UserInfoEx') 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); -- cgit v1.2.3