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 --- protocols/WhatsApp/src/chat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/WhatsApp/src/chat.cpp') 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); } -- cgit v1.2.3