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/GTalkExt/src/avatar.cpp | 4 ++-- protocols/GTalkExt/src/menu.cpp | 2 +- protocols/GTalkExt/src/notifications.cpp | 2 +- protocols/GTalkExt/src/options.cpp | 2 +- protocols/GTalkExt/src/tipper_items.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/GTalkExt/src') diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 833bfeef0a..bf6ec8389e 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -33,7 +33,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile) { TCHAR name[MAX_PATH + 2]; - if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(name), (LPARAM)&name)) + if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(name), (LPARAM)&name)) return NULL; TCHAR *p = _tcsrchr(name, '.'); @@ -41,7 +41,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile) *p = 0; TCHAR path[MAX_PATH + 2]; - if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)SIZEOF(path), (LPARAM)&path)) + if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)&path)) return NULL; TCHAR full[MAX_PATH + 2]; diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index b640317fe3..50e88caa18 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -41,7 +41,7 @@ int InitMenus(WPARAM wParam, LPARAM lParam) if (pga != NULL) { LPCSTR szModuleName = pga->m_japi->GetModuleName(); char szServiceName[100]; - mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX); + mir_snprintf(szServiceName, _countof(szServiceName), "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX); CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)szModuleName); CLISTMENUITEM cmi = { sizeof(cmi) }; diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index 9f0dd6dbde..c4e21d177d 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -199,7 +199,7 @@ static MEVENT AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *da dbei.eventType = EVENTTYPE_MESSAGE; char szEventText[4096]; - dbei.cbBlob = mir_snprintf(szEventText, SIZEOF(szEventText), "%s\r\n%s", szUrl, szText); + dbei.cbBlob = mir_snprintf(szEventText, _countof(szEventText), "%s\r\n%s", szUrl, szText); dbei.pBlob = (PBYTE)szEventText; return db_event_add(hContact, &dbei); } diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index eb5286d7f5..d82087963b 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -218,7 +218,7 @@ INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM db_set_dw(0, SHORT_PLUGIN_NAME, BACK_COLOR_SETTING, (DWORD)SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_GETCOLOUR, 0, 0)); db_set_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, (DWORD)SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_GETCOLOUR, 0, 0)); - GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, SIZEOF(timeout)); + GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, _countof(timeout)); db_set_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, _ttoi(timeout)); } return 0; diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp index a17127abda..b4f366d743 100644 --- a/protocols/GTalkExt/src/tipper_items.cpp +++ b/protocols/GTalkExt/src/tipper_items.cpp @@ -112,7 +112,7 @@ void AddTipperItem() } } - for (i = 0; i < SIZEOF(TipperItemProps); i++) + for (i = 0; i < _countof(TipperItemProps); i++) ShiftTipperSettings(setting, itemCount, TipperItemProps[i]); #define WRITE_TIPPER_PROPS(index, value)\ -- cgit v1.2.3