summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/chat.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 /protocols/WhatsApp/src/chat.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 'protocols/WhatsApp/src/chat.cpp')
-rw-r--r--protocols/WhatsApp/src/chat.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp
index 9a80485c3f..766bb63425 100644
--- a/protocols/WhatsApp/src/chat.cpp
+++ b/protocols/WhatsApp/src/chat.cpp
@@ -166,14 +166,14 @@ void WhatsAppProto::EditChatSubject(WAChatInfo *pInfo)
void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo)
{
TCHAR tszFileName[MAX_PATH], filter[256];
- Bitmap_GetFilter(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.lpstrFilter = filter;
ofn.hwndOwner = 0;
ofn.lpstrFile = tszFileName;
- ofn.nMaxFile = ofn.nMaxFileTitle = SIZEOF(tszFileName);
+ ofn.nMaxFile = ofn.nMaxFileTitle = _countof(tszFileName);
ofn.Flags = OFN_HIDEREADONLY;
ofn.lpstrInitialDir = _T(".");
ofn.lpstrDefExt = _T("");
@@ -274,11 +274,11 @@ int WhatsAppProto::OnChatMenu(WPARAM wParam, LPARAM lParam)
return 0;
if (gcmi->Type == MENU_ON_LOG) {
- gcmi->nItems = SIZEOF(sttLogListItems);
+ gcmi->nItems = _countof(sttLogListItems);
gcmi->Item = sttLogListItems;
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
- gcmi->nItems = SIZEOF(sttNickListItems);
+ gcmi->nItems = _countof(sttNickListItems);
gcmi->Item = sttNickListItems;
}
@@ -313,7 +313,7 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n
GCDEST gcd = { m_szModuleName, ptszJid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
- for (int i = SIZEOF(sttStatuses) - 1; i >= 0; i--) {
+ for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
gce.ptszStatus = TranslateTS(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}