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/MirFox/src/MirandaOptions.cpp | 6 +++--- plugins/MirFox/src/MirandaUtils.cpp | 4 ++-- plugins/MirFox/src/MirfoxMiranda.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/MirFox/src') diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index f729e9d448..cf06ef7359 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -218,7 +218,7 @@ static void setListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt if(hChildItem) { setListGroupIcons(hwndList, hChildItem, hItem, childCount); //recursion } - for( i=0; i < SIZEOF(iconOn); i++){ + for( i=0; i < _countof(iconOn); i++){ if(iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem,i) == 0){ iconOn[i] = 0; } @@ -234,7 +234,7 @@ static void setListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt } while(hItem) { - for ( i=0; i < SIZEOF(iconOn); i++) { + for ( i=0; i < _countof(iconOn); i++) { iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i); if(iconOn[i] && iImage==0){ iconOn[i]=0; @@ -247,7 +247,7 @@ static void setListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt } //set icons - for( i=0; i < SIZEOF(iconOn); i++) { + for( i=0; i < _countof(iconOn); i++) { SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i,childCount[i]?(iconOn[i]?i+1:0):0xFF)); if(groupChildCount){ groupChildCount[i]+=childCount[i]; diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index b213b3d1c9..b5bb5a0fd6 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -52,7 +52,7 @@ std::wstring& MirandaUtils::getProfileName() } wchar_t mirandaProfileNameW[128] = {0}; - CallService(MS_DB_GETPROFILENAMEW, SIZEOF(mirandaProfileNameW), (WPARAM)mirandaProfileNameW); + CallService(MS_DB_GETPROFILENAMEW, _countof(mirandaProfileNameW), (WPARAM)mirandaProfileNameW); profileName.append(mirandaProfileNameW); return profileName; @@ -68,7 +68,7 @@ std::wstring& MirandaUtils::getDisplayName() displayName.append(L"Miranda NG v."); char mirandaVersion[128]; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)SIZEOF(mirandaVersion), (LPARAM)mirandaVersion); + CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(mirandaVersion), (LPARAM)mirandaVersion); displayName.append(_A2T(mirandaVersion)); displayName.append(L" ("); displayName.append(getProfileName()); diff --git a/plugins/MirFox/src/MirfoxMiranda.cpp b/plugins/MirFox/src/MirfoxMiranda.cpp index bbe1819862..06e02dd65c 100644 --- a/plugins/MirFox/src/MirfoxMiranda.cpp +++ b/plugins/MirFox/src/MirfoxMiranda.cpp @@ -116,7 +116,7 @@ void CMirfoxMiranda::initializeSharedMemoryData(MirfoxData& mirfoxData, SharedMe } else { mirfoxData.processCsmId = result.processCsmId; wchar_t prefix[7]; - mir_sntprintf(prefix, SIZEOF(prefix), L"MNG%d", result.processCsmId); + mir_sntprintf(prefix, _countof(prefix), L"MNG%d", result.processCsmId); logger->set6CharsPrefix(prefix); } -- cgit v1.2.3