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/CountryFlags/src/extraimg.cpp | 2 +- plugins/CountryFlags/src/icons.cpp | 8 ++++---- plugins/CountryFlags/src/ip2country.cpp | 6 +++--- plugins/CountryFlags/src/utils.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins/CountryFlags') diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index cc80628b6c..5f887b2745 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -55,7 +55,7 @@ static void CALLBACK SetExtraImage(MCONTACT hContact) ExtraIcon_Clear(hExtraIcon, hContact); else { char szId[20]; - mir_snprintf(szId, SIZEOF(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); + mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); ExtraIcon_SetIcon(hExtraIcon, hContact, szId); } } diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp index 8c4ad30328..c11f0b4b9d 100644 --- a/plugins/CountryFlags/src/icons.cpp +++ b/plugins/CountryFlags/src/icons.cpp @@ -70,7 +70,7 @@ static int __fastcall CountryNumberToBitmapIndex(int countryNumber) } /* binary search in index array */ - int low = 0, i, high = SIZEOF(BitmapIndexMap)-1; + int low = 0, i, high = _countof(BitmapIndexMap)-1; if (countryNumber <= BitmapIndexMap[high]) while (low <= high) { i = low+((high-low)/2); @@ -146,7 +146,7 @@ HICON __fastcall LoadFlagIcon(int countryNumber) szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, countryNumber = 0xFFFF, 0); char szId[20]; - mir_snprintf(szId, SIZEOF(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */ + mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */ return IcoLib_GetIcon(szId); } @@ -197,7 +197,7 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam) POINT aptTriangle[3] = { 0 }; aptTriangle[1].y = bm.bmHeight-1; aptTriangle[2].x = bm.bmWidth-1; - HRGN hrgn = CreatePolygonRgn(aptTriangle,SIZEOF(aptTriangle),WINDING); + HRGN hrgn = CreatePolygonRgn(aptTriangle,_countof(aptTriangle),WINDING); if (hrgn != NULL) { SelectClipRgn(hdc,hrgn); DeleteObject(hrgn); @@ -244,7 +244,7 @@ void InitIcons(void) sid.description.a = (char*)countries[i].szName; /* create identifier */ - mir_snprintf(szId, SIZEOF(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */ + mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */ int index = CountryNumberToBitmapIndex(countries[i].id); /* create icon */ HICON hIcon = ImageList_GetIcon(himl,index,ILD_NORMAL); diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 76976594ba..49dcc881b6 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -226,12 +226,12 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut) /* convert */ for(i=0;ipszProcName=pszProcName; - mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */ + mir_snprintf(szDbgLine,_countof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */ OutputDebugStringA(szDbgLine); if (!idBufferedTimer) { - mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */ + mir_snprintf(szDbgLine,_countof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */ OutputDebugStringA(szDbgLine); } } -- cgit v1.2.3