summaryrefslogtreecommitdiff
path: root/plugins/NewAwaySysMod/src/MsgTree.cpp
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/NewAwaySysMod/src/MsgTree.cpp
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/NewAwaySysMod/src/MsgTree.cpp')
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 921c52d620..4eb3f9ba12 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -174,7 +174,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
TreeView_GetItemRect(lpNMCD->nmcd.hdr.hwndFrom, (HTREEITEM)lpNMCD->nmcd.dwItemSpec, &rc, true);
int iSize = GetSystemMetrics(SM_CXSMICON);
int x = rc.left - iSize - 5;
- for (int i = 0; i < SIZEOF(SettingsList); i++) {
+ for (int i = 0; i < _countof(SettingsList); i++) {
if (lpNMCD->nmcd.lItemlParam == dat->MsgTreePage.GetValue(SettingsList[i].DBSetting)) {
DrawIconEx(lpNMCD->nmcd.hdc, x, rc.top, Skin_LoadProtoIcon(NULL, SettingsList[i].Status), iSize, iSize, 0, GetSysColorBrush(COLOR_WINDOW), DI_NORMAL);
x -= iSize + 1;
@@ -391,13 +391,13 @@ static LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,
mii.fMask = MIIM_BITMAP | MIIM_DATA | MIIM_STATE | MIIM_CHECKMARKS;
mii.hbmpItem = HBMMENU_CALLBACK;
int i;
- for (i = 0; i < SIZEOF(MenuItems); i++) { // set icons
+ for (i = 0; i < _countof(MenuItems); i++) { // set icons
mii.dwItemData = MenuItems[i].IconID;
SetMenuItemInfo(hPopupMenu, MenuItems[i].ItemID, false, &mii);
}
mii.fMask = MIIM_STATE;
mii.fState = MFS_CHECKED;
- for (i = 0; i < SIZEOF(SettingsList); i++) // set checkmarks
+ for (i = 0; i < _countof(SettingsList); i++) // set checkmarks
if (TreeCtrl->Value[Order].ID == dat->MsgTreePage.GetValue(SettingsList[i].DBSetting))
SetMenuItemInfo(hPopupMenu, SettingsList[i].MenuItemID, false, &mii);
@@ -424,7 +424,7 @@ static LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,
case IDR_MSGTREEMENU_DEF_INV:
case IDR_MSGTREEMENU_DEF_OTP:
case IDR_MSGTREEMENU_DEF_OTL:
- for (int i = 0; i < SIZEOF(SettingsList); i++) {
+ for (int i = 0; i < _countof(SettingsList); i++) {
if (SettingsList[i].MenuItemID == MenuResult) {
dat->SetDefMsg(SettingsList[i].Status, tvi.lParam);
break;
@@ -513,7 +513,7 @@ bool CMsgTree::SetSelection(int ID, int Flags) // set ID = -1 to unselect; retur
int CMsgTree::GetDefMsg(int iMode)
{
- for (int i = 0; i < SIZEOF(SettingsList); i++)
+ for (int i = 0; i < _countof(SettingsList); i++)
if (SettingsList[i].Status == iMode)
return MsgTreePage.GetValue(SettingsList[i].DBSetting);
@@ -522,7 +522,7 @@ int CMsgTree::GetDefMsg(int iMode)
void CMsgTree::SetDefMsg(int iMode, int ID)
{
- for (int i = 0; i < SIZEOF(SettingsList); i++) {
+ for (int i = 0; i < _countof(SettingsList); i++) {
if (SettingsList[i].Status == iMode) {
if (MsgTreePage.GetValue(SettingsList[i].DBSetting) != ID) {
RECT rc;