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/AwaySys.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/NewAwaySysMod/src/AwaySys.cpp') diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 90976f1d3c..769ec125ae 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -231,7 +231,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) } int i; - for (i = SIZEOF(StatusModeList) - 1; i >= 0; i--) + for (i = _countof(StatusModeList) - 1; i >= 0; i--) if (wParam == StatusModeList[i].Status) break; if (i < 0) @@ -300,20 +300,20 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) TCHAR szSetStr[256], szReadStr[256]; if (szProto) { int i; - for (i = SIZEOF(StatusModeList) - 1; i >= 0; i--) + for (i = _countof(StatusModeList) - 1; i >= 0; i--) if (iMode == StatusModeList[i].Status) break; // the protocol supports status message sending for current status, or autoreplying if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) || ((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID)))) { - mir_sntprintf(szSetStr, SIZEOF(szSetStr), TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szSetStr, _countof(szSetStr), TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0)); miSetMsg.ptszName = szSetStr; miSetMsg.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME; } // the protocol supports status message reading for contact's status if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) { - mir_sntprintf(szReadStr, SIZEOF(szReadStr), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0)); + mir_sntprintf(szReadStr, _countof(szReadStr), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0)); miReadMsg.ptszName = szReadStr; miReadMsg.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME | CMIM_ICON; miReadMsg.hIcon = Skin_LoadProtoIcon(szProto, iContactMode); @@ -692,7 +692,7 @@ int MirandaLoaded(WPARAM, LPARAM) tr.szService = MS_AWAYSYS_VARIABLESHANDLER; tr.szCleanupService = MS_AWAYSYS_FREEVARMEM; tr.memType = TR_MEM_OWNER; - for (int i = 0; i < SIZEOF(Variables); i++) { + for (int i = 0; i < _countof(Variables); i++) { tr.flags = Variables[i].Flags | TRF_CALLSVC | TRF_TCHAR; tr.tszTokenString = Variables[i].Name; tr.szHelpText = Variables[i].Descr; @@ -713,7 +713,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); - Icon_Register(g_hInstance, MOD_NAME, iconList, SIZEOF(iconList), "nas"); + Icon_Register(g_hInstance, MOD_NAME, iconList, _countof(iconList), "nas"); InitCommonControls(); InitOptions(); // must be called before we hook CallService -- cgit v1.2.3