diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
commit | c370af60855db957c5b200914bf0bde743845528 (patch) | |
tree | 0bd2ef127097c9e937c2650e8b202c3f09453323 /protocols/IRCG | |
parent | 7f082bd5d4865c30b313661b7a02f048b4b137be (diff) |
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
Diffstat (limited to 'protocols/IRCG')
-rw-r--r-- | protocols/IRCG/src/clist.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/commandmonitor.cpp | 14 | ||||
-rw-r--r-- | protocols/IRCG/src/input.cpp | 6 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 10 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 12 | ||||
-rw-r--r-- | protocols/IRCG/src/services.cpp | 6 | ||||
-rw-r--r-- | protocols/IRCG/src/windows.cpp | 8 |
7 files changed, 29 insertions, 29 deletions
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 8e403f4198..d63dc3cfc1 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -69,7 +69,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, cle.hIcon = LoadIconEx(IDI_DCC);
mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName);
cle.pszService = szService;
- mir_sntprintf(szNick, _countof(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
+ mir_sntprintf(szNick, TranslateT("CTCP chat request from %s"), name.c_str());
cle.ptszTooltip = szNick;
cle.lParam = (LPARAM)pdci;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index a73cec6b40..41befe1236 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -70,9 +70,9 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) TCHAR temp2[270];
if (!ppro->m_info.sServerName.IsEmpty())
- mir_sntprintf(temp2, _countof(temp2), _T("PING %s"), ppro->m_info.sServerName.c_str());
+ mir_sntprintf(temp2, _T("PING %s"), ppro->m_info.sServerName.c_str());
else
- mir_sntprintf(temp2, _countof(temp2), _T("PING %u"), time(0));
+ mir_sntprintf(temp2, _T("PING %u"), time(0));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -259,7 +259,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di) bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
{
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
return false;
}
@@ -670,7 +670,7 @@ bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg) {
if (pmsg->m_bIncoming && pmsg->sCommand == _T("PING")) {
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
}
@@ -1677,7 +1677,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg) TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
mir_tstrcat(temp, _T("%s\r\n"));
- mir_sntprintf(temp2, _countof(temp2), temp, pmsg->parameters[2].c_str());
+ mir_sntprintf(temp2, temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
ShowMessage(pmsg);
@@ -1727,7 +1727,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg) TCHAR tTimeBuf[128], *tStopStr;
time_t ttTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
_tcsftime(tTimeBuf, 128, _T("%c"), localtime(&ttTime));
- mir_sntprintf(temp3, _countof(temp3), TranslateT("online since %s, idle %s"), tTimeBuf, temp);
+ mir_sntprintf(temp3, TranslateT("online since %s, idle %s"), tTimeBuf, temp);
m_whoisDlg->m_AwayTime.SetText(temp3);
}
ShowMessage(pmsg);
@@ -1813,7 +1813,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg) if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_tstrcmp(pmsg->parameters[1].c_str(), m_alternativeNick))) {
TCHAR m[200];
- mir_sntprintf(m, _countof(m), _T("NICK %s"), m_alternativeNick);
+ mir_sntprintf(m, _T("NICK %s"), m_alternativeNick);
if (IsConnected())
SendIrcMessage(m);
}
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index d5967a7b22..ef2611db39 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -121,7 +121,7 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) TCHAR buf[5];
for (int index = 1; index < 8; index++) {
- mir_sntprintf(buf, _countof(buf), _T("#$%u"), index);
+ mir_sntprintf(buf, _T("#$%u"), index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
str.Replace(buf, GetWord(line, index).c_str());
else {
@@ -131,11 +131,11 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) }
}
for (int index2 = 1; index2 < 8; index2++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u-"), index2);
+ mir_sntprintf(buf, _T("$%u-"), index2);
str.Replace(buf, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u"), index3);
+ mir_sntprintf(buf, _T("$%u"), index3);
str.Replace(buf, GetWord(line, index3).c_str());
}
Messageout += GetWordAddress(str.c_str(), 1);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 9625abd87a..91c2744542 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -181,15 +181,15 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(name, _countof(name), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
char szTemp2[256];
- mir_snprintf(szTemp2, _countof(szTemp2), "%s DCC", m_szModuleName);
+ mir_snprintf(szTemp2, "%s DCC", m_szModuleName);
nlu.szSettingsModule = szTemp2;
- mir_sntprintf(name, _countof(name), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.ptszDescriptiveName = name;
hNetlibDCC = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -274,13 +274,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) if (m_nick[0]) {
TCHAR szBuf[40];
if (mir_tstrlen(m_alternativeNick) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("%s%u"), m_nick, rand() % 9999);
+ mir_sntprintf(szBuf, _T("%s%u"), m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
mir_tstrncpy(m_alternativeNick, szBuf, 30);
}
if (mir_tstrlen(m_name) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("Miranda%u"), rand() % 9999);
+ mir_sntprintf(szBuf, _T("Miranda%u"), rand() % 9999);
setTString("Name", szBuf);
mir_tstrncpy(m_name, szBuf, 200);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index dff5b71451..e187f941e6 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -398,7 +398,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> pData->m_name = m_server.GetTextA();
char temp[255];
- mir_snprintf(temp, _countof(temp), "%s: %s", pData->m_group, pData->m_name);
+ mir_snprintf(temp, "%s: %s", pData->m_group, pData->m_name);
mir_free(pData->m_name);
pData->m_name = mir_strdup(temp);
@@ -776,9 +776,9 @@ void CConnectPrefsDlg::OnApply() char TextLine[512];
if (pData->m_iSSL > 0)
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
else
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
db_set_s(NULL, SERVERSMODULE, pData->m_name, TextLine);
// combobox might contain new items
@@ -1372,7 +1372,7 @@ void CIrcProto::InitIgnore(void) int idx = 0;
char settingName[40];
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", idx++);
+ mir_snprintf(settingName, "IGNORE:%d", idx++);
DBVARIANT dbv;
if (getTString(settingName, &dbv))
@@ -1392,13 +1392,13 @@ void CIrcProto::RewriteIgnoreSettings(void) int i = 0;
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i++);
+ mir_snprintf(settingName, "IGNORE:%d", i++);
if (db_unset(NULL, m_szModuleName, settingName))
break;
}
for (i = 0; i < m_ignoreItems.getCount(); i++) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i);
+ mir_snprintf(settingName, "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
setTString(settingName, (C.mask + _T(" ") + C.flags + _T(" ") + C.network).c_str());
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 579c409c47..8a293c72da 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -116,7 +116,7 @@ int IrcPrebuildContactMenu(WPARAM wParam, LPARAM lParam) void InitContactMenus(void)
{
char temp[MAXMODULELABELLENGTH];
- char *d = temp + mir_snprintf(temp, _countof(temp), "IRC");
+ char *d = temp + mir_snprintf(temp, "IRC");
CMenuItem mi;
mi.pszService = temp;
@@ -438,7 +438,7 @@ static void DoChatFormatting(TCHAR* pszText) if (p1 - 3 >= pszText && p1[-3] == '\003')
mir_tstrcpy(InsertThis, _T(","));
else if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,"));
@@ -447,7 +447,7 @@ static void DoChatFormatting(TCHAR* pszText) case 'F':
if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,99"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,99"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,99"));
iRemoveChars = 2;
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 2b40c291fe..fded5db590 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -376,13 +376,13 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) ShowWindow(m_list.GetHwnd(), SW_HIDE);
// New dialog title
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
+ mir_sntprintf(newTitle, TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
SetWindowText(m_hwnd, newTitle);
}
else {
ShowWindow(m_list.GetHwnd(), SW_SHOW);
ShowWindow(m_list2.GetHwnd(), SW_HIDE);
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("Channels on server"));
+ mir_sntprintf(newTitle, TranslateT("Channels on server"));
SetWindowText(m_hwnd, newTitle);
}
}
@@ -967,7 +967,7 @@ void CManagerDlg::OnAdd(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s %s %s"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s %s %s"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1010,7 +1010,7 @@ void CManagerDlg::OnEdit(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
|