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/FavContacts | |
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/FavContacts')
-rw-r--r-- | plugins/FavContacts/src/contact_cache.cpp | 8 | ||||
-rw-r--r-- | plugins/FavContacts/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/FavContacts/src/menu.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 896eae5cca..d35e8c890e 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -148,8 +148,8 @@ void CContactCache::TContactInfo::LoadInfo() CNF_CONAME, CNF_CODEPT, CNF_COCITY, CNF_COSTATE, CNF_COSTREET, CNF_COCOUNTRY
};
- for (int i = 0; i < SIZEOF(items); ++i)
- if (AppendInfo(p, SIZEOF(info) - (p - info), hContact, items[i]))
+ for (int i = 0; i < _countof(items); ++i)
+ if (AppendInfo(p, _countof(info) - (p - info), hContact, items[i]))
p += mir_tstrlen(p) + 1;
*p = 0;
@@ -180,7 +180,7 @@ bool CContactCache::filter(int rate, TCHAR *str) HKL kbdLayoutActive = GetKeyboardLayout(GetCurrentThreadId());
HKL kbdLayouts[10];
- int nKbdLayouts = GetKeyboardLayoutList(SIZEOF(kbdLayouts), kbdLayouts);
+ int nKbdLayouts = GetKeyboardLayoutList(_countof(kbdLayouts), kbdLayouts);
TCHAR buf[256];
BYTE keyState[256] = { 0 };
@@ -193,7 +193,7 @@ bool CContactCache::filter(int rate, TCHAR *str) for (i = 0; str[i]; ++i) {
UINT vk = VkKeyScanEx(str[i], kbdLayoutActive);
UINT scan = MapVirtualKeyEx(vk, 0, kbdLayoutActive);
- ToUnicodeEx(vk, scan, keyState, buf + i, SIZEOF(buf) - i, 0, kbdLayouts[iLayout]);
+ ToUnicodeEx(vk, scan, keyState, buf + i, _countof(buf) - i, 0, kbdLayouts[iLayout]);
}
buf[i] = 0;
}
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 62579e9ba2..42cc773ae7 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -78,7 +78,7 @@ extern "C" __declspec(dllexport) int Load(void) /////////////////////////////////////////////////////////////////////////////////////
- Icon_Register(g_hInst, LPGEN("Favorites"), iconList, SIZEOF(iconList));
+ Icon_Register(g_hInst, LPGEN("Favorites"), iconList, _countof(iconList));
LoadHttpApi();
return 0;
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 0045f5da1b..2bb6fef449 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -394,7 +394,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, g_filter[l-1] = 0;
}
else if (_istalnum(LOWORD(wParam))) {
- if (mir_tstrlen(g_filter) < SIZEOF(g_filter) - 1) {
+ if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) {
TCHAR s[] = { LOWORD(wParam), 0 };
mir_tstrcat(g_filter, s);
}
|