From c370af60855db957c5b200914bf0bde743845528 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 28 Aug 2015 16:22:41 +0000 Subject: mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/log.cpp | 10 +++++----- plugins/TabSRMM/src/chat/main.cpp | 2 +- plugins/TabSRMM/src/chat/options.cpp | 6 +++--- plugins/TabSRMM/src/chat/tools.cpp | 7 ++----- plugins/TabSRMM/src/chat/window.cpp | 14 +++++++------- 5 files changed, 18 insertions(+), 21 deletions(-) (limited to 'plugins/TabSRMM/src/chat') diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 19e37c2676..f44bea11fc 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -537,7 +537,7 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE); if (g_Settings.bClickableNicks) - mir_sntprintf(szTemp2, _countof(szTemp2), _T("~~++#%s#++~~"), szTemp); + mir_sntprintf(szTemp2, _T("~~++#%s#++~~"), szTemp); else _tcsncpy_s(szTemp2, szTemp, _TRUNCATE); @@ -723,7 +723,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (streamData->dat->dwFlags & MWF_DIVIDERWANTED || lin->dwFlags & MWF_DIVIDERWANTED) { static char szStyle_div[128] = "\0"; if (szStyle_div[0] == 0) - mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5); + mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5); lin->dwFlags |= MWF_DIVIDERWANTED; if (lin->prev || !streamData->bRedraw) @@ -750,13 +750,13 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) int iii; if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) { iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1); - mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u", + mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u", iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY); str.Append(szStyle); } else { iii = lin->bIsHighlighted ? 16 : EventToIndex(lin); - mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u", + mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u", iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY); str.Append(szStyle); } @@ -982,7 +982,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // this uses hidden marks in the rich text to find the events which should be deleted if (si->bTrimmed) { TCHAR szPattern[50]; - mir_sntprintf(szPattern, _countof(szPattern), _T("~-+%d+-~"), si->pLogEnd); + mir_sntprintf(szPattern, _T("~-+%d+-~"), si->pLogEnd); FINDTEXTEX fi; fi.lpstrText = szPattern; diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 9ac88e10b5..3ae21bda9e 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -184,7 +184,7 @@ static void OnLoadSettings() for (int i = 0; i < 5; i++) { char szBuf[40]; - mir_snprintf(szBuf, _countof(szBuf), "NickColor%d", i); + mir_snprintf(szBuf, "NickColor%d", i); g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]); } g_Settings.nickColors[5] = M.GetDword(CHAT_MODULE, "NickColor5", GetSysColor(COLOR_HIGHLIGHT)); diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index cba62770ff..8b857c7eb2 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM TCHAR tszTooltipText[2048]; - mir_sntprintf(tszTooltipText, _countof(tszTooltipText), + mir_sntprintf(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"), @@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM *p1 = 0; TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10]; - mir_sntprintf(tszInitialDir, _countof(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p); + mir_sntprintf(tszInitialDir, _T("%s%s"), M.getChatLogPath(), p); if (!PathFileExists(tszInitialDir)) _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE); TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0; - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0); + mir_sntprintf(tszTemp, _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0); OPENFILENAME ofn = { 0 }; ofn.lpstrInitialDir = tszInitialDir; diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index d33f093eba..5b82f8b8e4 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -113,10 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window"); PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName); - mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"), - (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, - pcli->pfnGetContactDisplayName(hContact, 0)); - + mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0)); _tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE); pd.iSeconds = g_Settings.iPopupTimeout; @@ -536,7 +533,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) { TCHAR szMenuText[4096]; - mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText); + mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText); ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText); } else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up")); diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 56cc362ab0..a7490efb38 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1323,7 +1323,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), TranslateT("Nickname"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s:\t%s\n%s:\t%s\n%s:\t%s"), + mir_sntprintf(tszBuf, _T("%s:\t%s\n%s:\t%s\n%s:\t%s"), TranslateT("Nick"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1976,17 +1976,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else if (diff > 59) { DWORD hours = diff / 60; DWORD minutes = diff % 60; - mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? + mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? TranslateT("hours") : TranslateT("hour"), minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute")); } - else mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); + else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); } - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); + mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); } else { if (si->ptszStatusbarText) - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); + mir_sntprintf(szFinalStatusBarText, _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); else _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } @@ -3165,7 +3165,7 @@ LABEL_SHOWWINDOW: DBVARIANT dbv = { 0 }; char szIndex[10]; char *szKey = "TAB_ContainersW"; - mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU); + mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU); if (iSelection - IDM_CONTAINERMENU >= 0) { if (!db_get_ts(NULL, szKey, szIndex, &dbv)) { SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal); -- cgit v1.2.3