summaryrefslogtreecommitdiff
path: root/plugins/Scriver
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/Scriver
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/Scriver')
-rw-r--r--plugins/Scriver/src/chat/options.cpp22
-rw-r--r--plugins/Scriver/src/chat/tools.cpp4
-rw-r--r--plugins/Scriver/src/chat/window.cpp16
-rw-r--r--plugins/Scriver/src/globals.cpp6
-rw-r--r--plugins/Scriver/src/input.cpp4
-rw-r--r--plugins/Scriver/src/msgdialog.cpp22
-rw-r--r--plugins/Scriver/src/msglog.cpp16
-rw-r--r--plugins/Scriver/src/msgoptions.cpp26
-rw-r--r--plugins/Scriver/src/msgs.cpp8
-rw-r--r--plugins/Scriver/src/msgwindow.cpp32
-rw-r--r--plugins/Scriver/src/utils.cpp16
11 files changed, 86 insertions, 86 deletions
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index 8559d96745..3005ae0dd6 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -246,8 +246,8 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(db_get_b(NULL,CHAT_MODULE,"NicklistRowDist",12),0));
hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance and functionality of chat windows"), db_get_b(NULL, CHAT_MODULE, "Branch1Exp", 0)?TRUE:FALSE);
hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Icons to display in the tray"), db_get_b(NULL, CHAT_MODULE, "Branch5Exp", 0)?TRUE:FALSE);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, branch1, SIZEOF(branch1), 0);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, SIZEOF(branch4), 0x1000);
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, branch1, _countof(branch1), 0);
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, _countof(branch4), 0x1000);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
{
TCHAR* pszGroup = NULL;
@@ -323,8 +323,8 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
db_set_b(NULL, CHAT_MODULE, "NicklistRowDist", (BYTE)iLen);
else
db_unset(NULL, CHAT_MODULE, "NicklistRowDist");
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, SIZEOF(branch1));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, SIZEOF(branch4));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, _countof(branch1));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, _countof(branch4));
pci->ReloadSettings();
pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
@@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
TCHAR tszTooltipText[2048];
RECT rect;
- mir_sntprintf(tszTooltipText, SIZEOF(tszTooltipText),
+ mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
@@ -417,8 +417,8 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance"), db_get_b(NULL, CHAT_MODULE, "Branch2Exp", 0) ? TRUE : FALSE);
hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Default events to show in new chat rooms if the 'event filter' is enabled"), db_get_b(NULL, CHAT_MODULE, "Branch3Exp", 0) ? TRUE : FALSE);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, branch2, SIZEOF(branch2), 0x0);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, branch3, SIZEOF(branch3), 0x03E0);
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, branch2, _countof(branch2), 0x0);
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, branch3, _countof(branch3), 0x03E0);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
break;
@@ -592,8 +592,8 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
db_set_w(NULL, CHAT_MODULE, "LoggingLimit", (WORD)iLen);
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch2, SIZEOF(branch2));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch3, SIZEOF(branch3));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch2, _countof(branch2));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch3, _countof(branch3));
mir_free(pszText);
@@ -654,7 +654,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_SETRANGE, 0, MAKELONG(100, -1));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_SETPOS, 0, MAKELONG(g_Settings.iPopupTimeout, 0));
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), NULL, branch6, SIZEOF(branch6), 0x0000);
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), NULL, branch6, _countof(branch6), 0x0000);
break;
case WM_COMMAND:
@@ -714,7 +714,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam
db_set_dw(NULL, CHAT_MODULE, "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_GETCOLOUR, 0, 0));
g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_GETCOLOUR, 0, 0);
db_set_dw(NULL, CHAT_MODULE, "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_GETCOLOUR, 0, 0));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch6, SIZEOF(branch6));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch6, _countof(branch6));
}
return TRUE;
}
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp
index c099d50a83..280700fbcb 100644
--- a/plugins/Scriver/src/chat/tools.cpp
+++ b/plugins/Scriver/src/chat/tools.cpp
@@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, SIZEOF(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
}
@@ -65,7 +65,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
if (pszWordText)
mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
- mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
+ mir_tstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1);
if (mir_tstrlen(szTemp) > 40)
mir_tstrncpy(szTemp + 40, _T("..."), 4);
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index cb1655aabc..1ad222c2d8 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -138,7 +138,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h)
BOOL bToolbar = SendMessage(GetParent(hwndDlg), CM_GETTOOLBARSTATUS, 0, 0);
int buttonVisibility = bToolbar ? g_dat.chatBbuttonVisibility : 0;
int hSplitterMinTop = TOOLBAR_HEIGHT + si->minLogBoxHeight, hSplitterMinBottom = si->minEditBoxHeight;
- int toolbarHeight = bToolbar ? IsToolbarVisible(SIZEOF(toolbarButtons), g_dat.chatBbuttonVisibility) ? TOOLBAR_HEIGHT : TOOLBAR_HEIGHT / 3 : 0;
+ int toolbarHeight = bToolbar ? IsToolbarVisible(_countof(toolbarButtons), g_dat.chatBbuttonVisibility) ? TOOLBAR_HEIGHT : TOOLBAR_HEIGHT / 3 : 0;
si->iSplitterY = si->desiredInputAreaHeight + SPLITTER_HEIGHT + 3;
@@ -147,7 +147,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h)
if (si->iSplitterY < hSplitterMinBottom)
si->iSplitterY = hSplitterMinBottom;
- ShowToolbarControls(hwndDlg, SIZEOF(toolbarButtons), toolbarButtons, buttonVisibility, SW_SHOW);
+ ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, buttonVisibility, SW_SHOW);
ShowWindow(GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX), bNick ? SW_SHOW : SW_HIDE);
if (si->iType != GCW_SERVER)
ShowWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIST), si->bNicklistEnabled ? SW_SHOW : SW_HIDE);
@@ -178,7 +178,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h)
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX), 0, w - si->iSplitterX, 1, 2, toolbarTopY - 1, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERY), 0, 0, h - si->iSplitterY, w, SPLITTER_HEIGHT, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), 0, 1, h - si->iSplitterY + SPLITTER_HEIGHT, w - 2, si->iSplitterY - SPLITTER_HEIGHT - 1, SWP_NOZORDER);
- hdwp = ResizeToolbar(hwndDlg, hdwp, w, toolbarTopY + 1, toolbarHeight - 1, SIZEOF(toolbarButtons), toolbarButtons, buttonVisibility);
+ hdwp = ResizeToolbar(hwndDlg, hdwp, w, toolbarTopY + 1, toolbarHeight - 1, _countof(toolbarButtons), toolbarButtons, buttonVisibility);
EndDeferWindowPos(hdwp);
if (si->hwndLog != NULL) {
IEVIEWWINDOW ieWindow;
@@ -799,7 +799,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p
}
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, SIZEOF(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -967,7 +967,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
TCHAR szNew[2];
szNew[0] = (TCHAR)wParam;
szNew[1] = '\0';
- if (mir_tstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) {
+ if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
@@ -1432,7 +1432,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
static TCHAR ptszBuf[128];
- mir_sntprintf(ptszBuf, SIZEOF(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick);
+ mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick);
@@ -1641,7 +1641,7 @@ LABEL_SHOWWINDOW:
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static TCHAR ptszBuf[1024];
- mir_sntprintf(ptszBuf, SIZEOF(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -1919,7 +1919,7 @@ LABEL_SHOWWINDOW:
case WM_RBUTTONUP:
hToolbarMenu = CreatePopupMenu();
- for (int i = 0; i < SIZEOF(toolbarButtons); i++) {
+ for (int i = 0; i < _countof(toolbarButtons); i++) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
mii.fType = MFT_STRING;
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 3ef13e7fa4..d7ebe89278 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -212,7 +212,7 @@ void ReleaseIcons()
HICON GetCachedIcon(const char *name)
{
- for (int i = 0; i < SIZEOF(iconList); i++)
+ for (int i = 0; i < _countof(iconList); i++)
if (!mir_strcmp(iconList[i].szName, name))
return IcoLib_GetIconByHandle(iconList[i].hIcolib);
@@ -231,13 +231,13 @@ void LoadGlobalIcons()
ImageList_RemoveAll(g_dat.hChatButtonIconList);
ImageList_RemoveAll(g_dat.hHelperIconList);
ImageList_RemoveAll(g_dat.hSearchEngineIconList);
- for (i = 0; i < SIZEOF(buttonIcons); i++) {
+ for (i = 0; i < _countof(buttonIcons); i++) {
if (buttonIcons[i] == NULL)
ImageList_AddIcon_ProtoEx(g_dat.hButtonIconList, NULL, ID_STATUS_OFFLINE);
else
ImageList_AddIcon(g_dat.hButtonIconList, GetCachedIcon(buttonIcons[i]));
}
- for (i = 0; i < SIZEOF(chatButtonIcons); i++)
+ for (i = 0; i < _countof(chatButtonIcons); i++)
ImageList_AddIcon(g_dat.hChatButtonIconList, GetCachedIcon(chatButtonIcons[i]));
ImageList_AddIcon(g_dat.hHelperIconList, GetCachedIcon("scriver_OVERLAY"));
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index 69f9219bf2..a0f1370476 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -293,8 +293,8 @@ void RegisterKeyBindings()
desc.pszName = strName;
desc.pszDescription = strDesc;
for (int i = 0; i < 9; i++) {
- mir_snprintf(strName, SIZEOF(strName), "Scriver/Nav/Tab %d", i + 1);
- mir_snprintf(strDesc, SIZEOF(strDesc), Translate("Navigate: tab %d"), i + 1);
+ mir_snprintf(strName, _countof(strName), "Scriver/Nav/Tab %d", i + 1);
+ mir_snprintf(strDesc, _countof(strDesc), Translate("Navigate: tab %d"), i + 1);
desc.lParam = KB_TAB1 + i;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, '1' + i);
Hotkey_Register(&desc);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 995921af6d..5157c96e90 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -191,14 +191,14 @@ static void SetDialogToType(HWND hwndDlg)
ShowWindow(dat->infobarData->hWnd, SW_HIDE);
if (dat->hContact) {
- ShowToolbarControls(hwndDlg, SIZEOF(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, showToolbar ? SW_SHOW : SW_HIDE);
+ ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, showToolbar ? SW_SHOW : SW_HIDE);
if (!db_get_b(dat->hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
if (!g_dat.smileyAddInstalled)
ShowWindow(GetDlgItem(hwndDlg, IDC_SMILEYS), SW_HIDE);
}
- else ShowToolbarControls(hwndDlg, SIZEOF(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, SW_HIDE);
+ else ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), SW_SHOW);
if (dat->hwndLog != NULL)
@@ -302,7 +302,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
ptrT pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, SIZEOF(szMenuText), TranslateT("Look up '%s':"), pszWord);
+ mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
}
@@ -457,7 +457,7 @@ static void SubclassLogEdit(HWND hwnd)
static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
{
ParentWindowData *pdat = dat->parent;
- int hSplitterPos = dat->splitterPos, toolbarHeight = pdat->flags2&SMF2_SHOWTOOLBAR ? IsToolbarVisible(SIZEOF(toolbarButtons), g_dat.buttonVisibility) ? dat->toolbarSize.cy : dat->toolbarSize.cy / 3 : 0;
+ int hSplitterPos = dat->splitterPos, toolbarHeight = pdat->flags2&SMF2_SHOWTOOLBAR ? IsToolbarVisible(_countof(toolbarButtons), g_dat.buttonVisibility) ? dat->toolbarSize.cy : dat->toolbarSize.cy / 3 : 0;
int hSplitterMinTop = toolbarHeight + dat->minLogBoxHeight, hSplitterMinBottom = dat->minEditBoxHeight;
int infobarInnerHeight = INFO_BAR_INNER_HEIGHT;
int infobarHeight = INFO_BAR_HEIGHT;
@@ -522,7 +522,7 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_AVATAR), 0, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTER), 0, 0, h - hSplitterPos - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER);
- hdwp = ResizeToolbar(hwndDlg, hdwp, toolbarWidth, h - hSplitterPos - toolbarHeight + 1, toolbarHeight, SIZEOF(toolbarButtons), toolbarButtons, g_dat.buttonVisibility);
+ hdwp = ResizeToolbar(hwndDlg, hdwp, toolbarWidth, h - hSplitterPos - toolbarHeight + 1, toolbarHeight, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility);
EndDeferWindowPos(hdwp);
if (dat->hwndLog != NULL) {
@@ -750,7 +750,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dat->minEditBoxHeight = minEditInit.bottom - minEditInit.top;
dat->minLogBoxHeight = dat->minEditBoxHeight;
dat->toolbarSize.cy = TOOLBAR_HEIGHT;
- dat->toolbarSize.cx = GetToolbarWidth(SIZEOF(toolbarButtons), toolbarButtons);
+ dat->toolbarSize.cx = GetToolbarWidth(_countof(toolbarButtons), toolbarButtons);
if (dat->splitterPos == -1)
dat->splitterPos = dat->minEditBoxHeight;
WindowList_Add(g_dat.hMessageWindowList, hwndDlg, dat->hContact);
@@ -770,7 +770,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(hwndDlg, DM_CHANGEICONS, 0, 0);
// Make them flat buttons
- for (int i = 0; i < SIZEOF(toolbarButtons); i++)
+ for (int i = 0; i < _countof(toolbarButtons); i++)
SendDlgItemMessage(hwndDlg, toolbarButtons[i].controlId, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_ADD, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Add contact permanently to list"), 0);
@@ -926,7 +926,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_RBUTTONUP:
hToolbarMenu = CreatePopupMenu();
- for (int i = 0; i < SIZEOF(toolbarButtons); i++) {
+ for (int i = 0; i < _countof(toolbarButtons); i++) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
mii.fType = MFT_STRING;
@@ -959,7 +959,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i;
TCHAR** ppFiles = NULL;
for (i = 0; i < fileCount; i++) {
- DragQueryFile(hDrop, i, szFilename, SIZEOF(szFilename));
+ DragQueryFile(hDrop, i, szFilename, _countof(szFilename));
AddToFileList(&ppFiles, &totalCount, szFilename);
}
CallServiceSync(MS_FILE_SENDSPECIFICFILEST, dat->hContact, (LPARAM)ppFiles);
@@ -1367,8 +1367,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
else if (dat->lastMessage) {
TCHAR date[64], time[64];
- TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, SIZEOF(date), 0);
- TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, SIZEOF(time), 0);
+ TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0);
+ TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0);
mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
sbd.pszText = szText;
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index 537673b5a2..82c42d91de 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern int RTL_Detect(WCHAR *pszwText);
static int logPixelSY;
static char* pLogIconBmpBits[3];
-static size_t logIconBmpSize[SIZEOF(pLogIconBmpBits)];
+static size_t logIconBmpSize[_countof(pLogIconBmpBits)];
static HIMAGELIST g_hImageList;
#define STREAMSTAGE_HEADER 0
@@ -379,7 +379,7 @@ static char* SetToStyle(int style)
static char szStyle[128];
LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL);
- mir_snprintf(szStyle, SIZEOF(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
+ mir_snprintf(szStyle, _countof(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
return szStyle;
}
@@ -425,8 +425,8 @@ TCHAR* TimestampToString(DWORD dwFlags, time_t check, int mode)
mir_tstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? _T("s") : _T("t"));
}
if (format[0] != '\0') {
- TimeZone_PrintTimeStamp(NULL, check, format, str, SIZEOF(str), 0);
- mir_tstrncat(szResult, str, SIZEOF(szResult) - mir_tstrlen(szResult));
+ TimeZone_PrintTimeStamp(NULL, check, format, str, _countof(str), 0);
+ mir_tstrncat(szResult, str, _countof(szResult) - mir_tstrlen(szResult));
}
return szResult;
}
@@ -465,7 +465,7 @@ static int DetectURL(wchar_t *text, BOOL firstChar) {
if (!((c >= '0' && c<='9') || (c >= 'A' && c<='Z') || (c >= 'a' && c<='z'))) {
int found = 0;
int i, len = 0;
- int prefixlen = SIZEOF(prefixes);
+ int prefixlen = _countof(prefixes);
for (i = 0; i < prefixlen; i++) {
if (!wcsncmp(text, prefixes[i].text, prefixes[i].length)) {
len = prefixes[i].length;
@@ -909,7 +909,7 @@ void LoadMsgLogIcons(void)
HICON hIcon = NULL;
RECT rc;
- g_hImageList = ImageList_Create(10, 10, ILC_COLOR32 | ILC_MASK, SIZEOF(pLogIconBmpBits), 0);
+ g_hImageList = ImageList_Create(10, 10, ILC_COLOR32 | ILC_MASK, _countof(pLogIconBmpBits), 0);
HBRUSH hBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
HBRUSH hInBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_INCOMINGBKGCOLOUR, SRMSGDEFSET_INCOMINGBKGCOLOUR));
HBRUSH hOutBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_OUTGOINGBKGCOLOUR, SRMSGDEFSET_OUTGOINGBKGCOLOUR));
@@ -929,7 +929,7 @@ void LoadMsgLogIcons(void)
HDC hdcMem = CreateCompatibleDC(hdc);
PBYTE pBmpBits = (PBYTE)mir_alloc(widthBytes * bih.biHeight);
HBRUSH hBrush = hBkgBrush;
- for (int i = 0; i < SIZEOF(pLogIconBmpBits); i++) {
+ for (int i = 0; i < _countof(pLogIconBmpBits); i++) {
switch (i) {
case LOGICON_MSG_IN:
ImageList_AddIcon(g_hImageList, GetCachedIcon("scriver_INCOMING"));
@@ -976,7 +976,7 @@ void LoadMsgLogIcons(void)
void FreeMsgLogIcons(void)
{
- for (int i = 0; i < SIZEOF(pLogIconBmpBits); i++)
+ for (int i = 0; i < _countof(pLogIconBmpBits); i++)
mir_free(pLogIconBmpBits[i]);
ImageList_RemoveAll(g_hImageList);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 171ebfca17..7b56f8f3d2 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -76,7 +76,7 @@ static const FontOptionsList fontOptionsList[] = {
{ LPGENT("Info bar status message"), RGB(50, 50, 50), _T("Arial"), FONTF_ITALIC, -11, LPGENT("Info bar background")}
};
-int fontOptionsListSize = SIZEOF(fontOptionsList);
+int fontOptionsListSize = _countof(fontOptionsList);
struct ColourOptionsList
{
@@ -108,37 +108,37 @@ void RegisterFontServiceFonts()
FontIDT fid = { sizeof(fid) };
_tcsncpy_s(fid.group, LPGENT("Messaging"), _TRUNCATE);
_tcsncpy_s(fid.backgroundGroup, LPGENT("Messaging"), _TRUNCATE);
- strncpy(fid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
+ strncpy(fid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID | FIDF_DEFAULTVALID;
- for (int i = 0; i < SIZEOF(fontOptionsList); i++) {
+ for (int i = 0; i < _countof(fontOptionsList); i++) {
fid.order = i;
char szTemp[100];
mir_snprintf(szTemp, "SRMFont%d", i);
- strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
+ strncpy(fid.prefix, szTemp, _countof(fid.prefix));
+ _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].defColour;
fid.deffontsettings.size = fontOptionsList[i].defSize;
fid.deffontsettings.style = fontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
- _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fid.deffontsettings.szFace));
- _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
+ _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
FontRegisterT(&fid);
}
ColourIDT cid = { sizeof(cid) };
_tcsncpy_s(cid.group, LPGENT("Messaging"), _TRUNCATE);
- strncpy(cid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
+ strncpy(cid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
cid.flags = 0;
- for (int i = 0; i < SIZEOF(colourOptionsList); i++) {
+ for (int i = 0; i < _countof(colourOptionsList); i++) {
cid.order = i;
- _tcsncpy(cid.name, colourOptionsList[i].szName, SIZEOF(cid.name));
+ _tcsncpy(cid.name, colourOptionsList[i].szName, _countof(cid.name));
if (colourOptionsList[i].systemColor != -1)
cid.defcolour = GetSysColor(colourOptionsList[i].systemColor);
else
cid.defcolour = colourOptionsList[i].defColour;
- strncpy(cid.setting, colourOptionsList[i].szSettingName, SIZEOF(cid.setting));
+ strncpy(cid.setting, colourOptionsList[i].szSettingName, _countof(cid.setting));
ColourRegisterT(&cid);
}
}
@@ -192,7 +192,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
- _tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName));
+ _tcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
mir_snprintf(str, "%s%dSet", "SRMFont", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
@@ -957,7 +957,7 @@ int OptInitialise(WPARAM wParam, LPARAM)
odp.hInstance = g_hInst;
odp.pszTitle = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
- for (int i = 0; i < SIZEOF(tabPages); i++) {
+ for (int i = 0; i < _countof(tabPages); i++) {
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId);
odp.pfnDlgProc = tabPages[i].dlgProc;
odp.pszTab = (char *)tabPages[i].tabName;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index ba09683dd0..fc46292811 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -129,7 +129,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
cle.hDbEvent = hDbEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName);
+ mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
@@ -208,7 +208,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
if ( ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -282,7 +282,7 @@ static void RestoreUnreadMessageAlerts(void)
else {
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -629,7 +629,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU
STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, SIZEOF(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index c1071ad415..6a88b6ea87 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -88,7 +88,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
size_t i, len;
for (len = 0, p = tmplt; *p; p++, len++) {
if (*p == '%') {
- for (i = 0; i < SIZEOF(titleTokenNames); i++) {
+ for (i = 0; i < _countof(titleTokenNames); i++) {
int tnlen = (int)mir_tstrlen(titleTokenNames[i]);
if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
len += tokenLen[i] - 1;
@@ -104,7 +104,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
TCHAR *title = (TCHAR*)mir_alloc(sizeof(TCHAR) * (len + 1));
for (len = 0, p = tmplt; *p; p++) {
if (*p == '%') {
- for (i = 0; i < SIZEOF(titleTokenNames); i++) {
+ for (i = 0; i < _countof(titleTokenNames); i++) {
size_t tnlen = mir_tstrlen(titleTokenNames[i]);
if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
if (tokens[i] != NULL) {
@@ -115,7 +115,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
break;
}
}
- if (i < SIZEOF(titleTokenNames))
+ if (i < _countof(titleTokenNames))
continue;
}
title[len++] = *p;
@@ -128,7 +128,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
if (isTemplate)
mir_free(tmplt);
- for (i = 0; i < SIZEOF(titleTokenNames); i++)
+ for (i = 0; i < _countof(titleTokenNames); i++)
mir_free(tokens[i]);
mir_free(pszNewTitleEnd);
@@ -518,9 +518,9 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
curSel = TabCtrl_GetCurSel(hwnd);
item.mask = TCIF_IMAGE | TCIF_PARAM | TCIF_TEXT;
item.pszText = sBuffer;
- item.cchTextMax = SIZEOF(sBuffer);
+ item.cchTextMax = _countof(sBuffer);
TabCtrl_GetItem(hwnd, dat->srcTab, &item);
- sBuffer[SIZEOF(sBuffer) - 1] = '\0';
+ sBuffer[_countof(sBuffer) - 1] = '\0';
if (curSel == dat->srcTab)
curSel = dat->destTab;
@@ -1133,14 +1133,14 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
char *szNamePrefix = (!savePerContact && dat->isChat) ? "chat" : "";
if (!dat->windowWasCascaded) {
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.top);
}
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(hContact, SRMMMOD, SRMSGSET_TOPMOST, (BYTE)dat->bTopmost);
if (g_dat.lastParent == dat)
@@ -1259,7 +1259,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (tbd != NULL && dat->hwndActive == hwnd) {
if (tbd->iFlags & TBDF_TEXT) {
TCHAR oldtitle[256];
- GetWindowText(hwndDlg, oldtitle, SIZEOF(oldtitle));
+ GetWindowText(hwndDlg, oldtitle, _countof(oldtitle));
if (mir_tstrcmp(tbd->pszText, oldtitle))
SetWindowText(hwndDlg, tbd->pszText);
}
@@ -1400,7 +1400,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM, LPARAM lParam)
TCITEM tci;
tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_STATE;
tci.pszText = szLabel;
- tci.cchTextMax = SIZEOF(szLabel);
+ tci.cchTextMax = _countof(szLabel);
tci.dwStateMask = TCIS_HIGHLIGHTED;
if (TabCtrl_GetItem(hwnd, iTabIndex, &tci)) {
IMAGEINFO info;
@@ -1508,9 +1508,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod
GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
int y = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
return 1;
@@ -1520,9 +1520,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod
else {
wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
wp.rcNormalPosition.right = wp.rcNormalPosition.left + db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
wp.rcNormalPosition.bottom = wp.rcNormalPosition.top + db_get_dw(hContact, szModule, szSettingName, -1);
}
wp.flags = 0;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index 9b292f7a20..fad8d388c0 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -374,29 +374,29 @@ void SearchWord(TCHAR * word, int engine)
ptrA wordURL(mir_urlEncode(wordUTF));
switch (engine) {
case SEARCHENGINE_WIKIPEDIA:
- mir_snprintf(szURL, SIZEOF(szURL), "http://en.wikipedia.org/wiki/%s", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://en.wikipedia.org/wiki/%s", wordURL);
break;
case SEARCHENGINE_YAHOO:
- mir_snprintf(szURL, SIZEOF(szURL), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
break;
case SEARCHENGINE_FOODNETWORK:
- mir_snprintf(szURL, SIZEOF(szURL), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
break;
case SEARCHENGINE_BING:
- mir_snprintf(szURL, SIZEOF(szURL), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
break;
case SEARCHENGINE_GOOGLE_MAPS:
- mir_snprintf(szURL, SIZEOF(szURL), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_GOOGLE_TRANSLATE:
- mir_snprintf(szURL, SIZEOF(szURL), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_YANDEX:
- mir_snprintf(szURL, SIZEOF(szURL), "http://yandex.ru/yandsearch?text=%s", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://yandex.ru/yandsearch?text=%s", wordURL);
break;
case SEARCHENGINE_GOOGLE:
default:
- mir_snprintf(szURL, SIZEOF(szURL), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, _countof(szURL), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
}