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/DbEditorPP/src/icons.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/DbEditorPP/src/icons.cpp') diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index 4bcd1cfc90..1e3d755ff0 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -42,7 +42,7 @@ IconItem iconList[] = { HANDLE GetIcoLibHandle(int icon) { - for (int i = 0; i < SIZEOF(iconList); i++) + for (int i = 0; i < _countof(iconList); i++) if (iconList[i].defIconID == icon) return iconList[i].hIcolib; return INVALID_HANDLE_VALUE; @@ -50,12 +50,12 @@ HANDLE GetIcoLibHandle(int icon) void IcoLibRegister(void) { - Icon_Register(hInst, modFullname, iconList, SIZEOF(iconList)); + Icon_Register(hInst, modFullname, iconList, _countof(iconList)); } HICON LoadSkinnedDBEIcon(int icon) { - for (int i = 0; i < SIZEOF(iconList); i++) + for (int i = 0; i < _countof(iconList); i++) if (iconList[i].defIconID == icon) return IcoLib_GetIconByHandle(iconList[i].hIcolib); @@ -68,11 +68,11 @@ static int protoCount = 0; HIMAGELIST LoadIcons() { HICON hIcon; - HIMAGELIST hil = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, SIZEOF(dbeIcons), 5); + HIMAGELIST hil = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, _countof(dbeIcons), 5); if (!hil) return NULL; - for(int i = 0; i < SIZEOF(dbeIcons); i++) + for(int i = 0; i < _countof(dbeIcons); i++) ImageList_AddIcon(hil, LoadSkinnedDBEIcon(dbeIcons[i])); Proto_EnumAccounts(&protoCount, &protocols); @@ -97,11 +97,11 @@ int GetProtoIconIndex(const char *szProto) if (protoCount && protocols) { for (int i = 0; i < protoCount; i++) { if (!mir_strcmp(protocols[i]->szModuleName, szProto)) - return i + SIZEOF(dbeIcons); + return i + _countof(dbeIcons); } if (Proto_IsProtocolLoaded(szProto)) - return SIZEOF(dbeIcons) - 2; // ICO_ONLINE; + return _countof(dbeIcons) - 2; // ICO_ONLINE; } } - return SIZEOF(dbeIcons) - 1; // ICO_OFFLINE; + return _countof(dbeIcons) - 1; // ICO_OFFLINE; } -- cgit v1.2.3