From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/NewAwaySysMod/src/SetAwayMsg.cpp') diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index a485cd6097..d91cae662f 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -434,7 +434,7 @@ void UpdateCheckboxesState(CCList *CList) HICON g_LoadIconEx(const char* name, bool big) { char szSettingName[100]; - mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", "", name); + mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "", name); return IcoLib_GetIcon(szSettingName, big); } @@ -601,7 +601,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } // init image buttons - for (int i = 0; i < SIZEOF(Buttons); i++) { + for (int i = 0; i < _countof(Buttons); i++) { HWND hButton = GetDlgItem(hwndDlg, Buttons[i].DlgItem); SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(Buttons[i].Text), BATF_TCHAR); SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0); @@ -612,7 +612,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.dll"), NULL); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS; - for (int i = 0; i < SIZEOF(Tooltips); i++) { + for (int i = 0; i < _countof(Tooltips); i++) { ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].DlgItemID); ti.lpszText = TranslateTS(Tooltips[i].Text); SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti); @@ -849,7 +849,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA return true; } TCHAR BtnTitle[64]; - mir_sntprintf(BtnTitle, SIZEOF(BtnTitle), TranslateT("Closing in %d"), Countdown); + mir_sntprintf(BtnTitle, _countof(BtnTitle), TranslateT("Closing in %d"), Countdown); SetDlgItemText(hwndDlg, IDC_OK, BtnTitle); Countdown--; } @@ -1013,7 +1013,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA break; case UM_ICONSCHANGED: - for (int i = 0; i < SIZEOF(Buttons); i++) + for (int i = 0; i < _countof(Buttons); i++) if (Buttons[i].IconIndex != ILI_NOICON) SendDlgItemMessage(hwndDlg, Buttons[i].DlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_IconList[Buttons[i].IconIndex]); -- cgit v1.2.3