diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/CountryFlags/src/icons.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CountryFlags/src/icons.cpp')
-rw-r--r-- | plugins/CountryFlags/src/icons.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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);
|