summaryrefslogtreecommitdiff
path: root/plugins/ModernOpt/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/ModernOpt/src
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (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/ModernOpt/src')
-rw-r--r--plugins/ModernOpt/src/modernopt.cpp2
-rw-r--r--plugins/ModernOpt/src/mopt_home.cpp4
-rw-r--r--plugins/ModernOpt/src/mopt_selector.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp
index b661a453ae..0e7d47fb0d 100644
--- a/plugins/ModernOpt/src/modernopt.cpp
+++ b/plugins/ModernOpt/src/modernopt.cpp
@@ -188,7 +188,7 @@ static INT_PTR CALLBACK ModernOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
hwndCtrl = GetDlgItem(hwndDlg, IDC_ICOTABS);
- for (i = 0; i < SIZEOF(g_ModernOptPages); ++i)
+ for (i = 0; i < _countof(g_ModernOptPages); ++i)
if (g_ModernOptPages[i].bShow && g_ModernOptPages[i].bShowTab)
{
HICON hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(g_ModernOptPages[i].iIcon), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
diff --git a/plugins/ModernOpt/src/mopt_home.cpp b/plugins/ModernOpt/src/mopt_home.cpp
index ad5682d23a..c8154a4e12 100644
--- a/plugins/ModernOpt/src/mopt_home.cpp
+++ b/plugins/ModernOpt/src/mopt_home.cpp
@@ -35,7 +35,7 @@ INT_PTR CALLBACK ModernOptHome_DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- for (i = 0; i < SIZEOF(g_ModernOptPages); ++i) {
+ for (i = 0; i < _countof(g_ModernOptPages); ++i) {
if (g_ModernOptPages[i].idcButton) {
HWND hwndCtrl = GetDlgItem(hwndDlg, g_ModernOptPages[i].idcButton);
if (g_ModernOptPages[i].bShow) {
@@ -57,7 +57,7 @@ INT_PTR CALLBACK ModernOptHome_DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
default:
- for (i = 0; i < SIZEOF(g_ModernOptPages); ++i) {
+ for (i = 0; i < _countof(g_ModernOptPages); ++i) {
if (g_ModernOptPages[i].idcButton == LOWORD(wParam))
{
CallService(MS_MODERNOPT_SELECTPAGE, i, 0);
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp
index 2b49e1ddf8..70d47e9239 100644
--- a/plugins/ModernOpt/src/mopt_selector.cpp
+++ b/plugins/ModernOpt/src/mopt_selector.cpp
@@ -85,7 +85,7 @@ struct TSkinListItem
if (TCHAR *p = _tcsrchr(title, _T('.'))) *p = 0;
TCHAR curPath[MAX_PATH];
- GetCurrentDirectory(SIZEOF(curPath), curPath);
+ GetCurrentDirectory(_countof(curPath), curPath);
path = (TCHAR *)mir_alloc(MAX_PATH * sizeof(TCHAR));
PathToRelativeT(curPath, path);
@@ -130,7 +130,7 @@ static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool
{
if (start) {
static TCHAR mirPath[MAX_PATH];
- GetModuleFileName(NULL, mirPath, SIZEOF(mirPath));
+ GetModuleFileName(NULL, mirPath, _countof(mirPath));
if (TCHAR *p = _tcsrchr(mirPath, _T('\\'))) *p = 0;
SetCurrentDirectory(mirPath);
SendMessage(hwndList, LB_RESETCONTENT, 0, 0);