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 --- protocols/JabberG/src/jabber_console.cpp | 4 ++-- protocols/JabberG/src/jabber_file.cpp | 4 ++-- protocols/JabberG/src/jabber_icolib.cpp | 10 +++++----- protocols/JabberG/src/jabber_iqid.cpp | 22 +++++++++++----------- protocols/JabberG/src/jabber_menu.cpp | 6 +++--- protocols/JabberG/src/jabber_privacy.cpp | 4 ++-- protocols/JabberG/src/jabber_search.cpp | 16 ++++++++-------- protocols/JabberG/src/jabber_secur.cpp | 10 +++++----- protocols/JabberG/src/jabber_std.cpp | 6 +++--- protocols/JabberG/src/jabber_thread.cpp | 2 +- protocols/JabberG/src/jabber_xstatus.cpp | 2 +- 11 files changed, 43 insertions(+), 43 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 15a5048d18..c0974eba95 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -194,7 +194,7 @@ static void sttEmptyBuf(StringBuf *buf) static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) { char indentLevel[128]; - mir_snprintf(indentLevel, _countof(indentLevel), RTF_INDENT_FMT, (int)(indent*200)); + mir_snprintf(indentLevel, RTF_INDENT_FMT, (int)(indent*200)); sttAppendBufRaw(buf, RTF_BEGINTAG); sttAppendBufRaw(buf, indentLevel); @@ -228,7 +228,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) if (XmlGetChildCount(node)) { sttAppendBufRaw(buf, RTF_BEGINTEXT); char indentTextLevel[128]; - mir_snprintf(indentTextLevel, _countof(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200)); + mir_snprintf(indentTextLevel, RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200)); sttAppendBufRaw(buf, indentTextLevel); } diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 6a00da7d80..6f448c2bab 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -288,7 +288,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) myAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP); char szAddr[256]; - mir_snprintf(szAddr, _countof(szAddr), "http://%s:%d/%s", myAddr, nlb.wPort, pFileName); + mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName); size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2; TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len); @@ -403,7 +403,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, } char fileBuffer[2048]; - int bytes = mir_snprintf(fileBuffer, _countof(fileBuffer), "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size); + int bytes = mir_snprintf(fileBuffer, "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size); WsSend(s, fileBuffer, bytes, MSG_DUMPASTEXT); ft->std.flags |= PFTS_SENDING; diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ebca9d50dd..0008e5443e 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -113,7 +113,7 @@ CIconPool::~CIconPool() void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHAR *szSection, TCHAR *szDescription) { char szSettingName[128]; - mir_snprintf(szSettingName, _countof(szSettingName), "jabber_%s", name); + mir_snprintf(szSettingName, "jabber_%s", name); CPoolItem *item = new CPoolItem; item->m_name = mir_strdup(name); @@ -278,8 +278,8 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, TCHAR *Sec GetModuleFileNameA(NULL, szPath, MAX_PATH); str = strrchr(szPath, '\\'); if (str != NULL) *str = 0; - mir_snprintf(szMyPath, _countof(szMyPath), "%s\\Icons\\%s", szPath, filename); - mir_snprintf(szFullPath, _countof(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i); + mir_snprintf(szMyPath, "%s\\Icons\\%s", szPath, filename); + mir_snprintf(szFullPath, "%s\\Icons\\%s,%d", szPath, filename, i); BOOL nf; HICON hi = ExtractIconFromPath(szFullPath, &nf); if (hi) has_proto_icon = TRUE; @@ -317,7 +317,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) BOOL needFree; int n = skinStatusToJabberStatus[i]; TCHAR *descr = pcli->pfnGetStatusModeDescription(n + ID_STATUS_OFFLINE, 0); - mir_snprintf(Uname, _countof(Uname), "%s_Transport_%s_%d", m_szModuleName, proto, n); + mir_snprintf(Uname, "%s_Transport_%s_%d", m_szModuleName, proto, n); HICON hicon = LoadTransportIcon(defFile, -skinIconStatusToResourceId[i], Uname, Group, descr, -(n + ID_STATUS_OFFLINE), &needFree); int index = (m_transportProtoTableStartIndex[iID] == -1) ? -1 : m_transportProtoTableStartIndex[iID] + n; int added = ImageList_ReplaceIcon(hAdvancedStatusIcon, index, hicon ? hicon : empty); @@ -548,7 +548,7 @@ HANDLE g_GetIconHandle(int iconId) HICON g_LoadIconEx(const char* name, bool big) { char szSettingName[100]; - mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GLOBAL_SETTING_PREFIX, name); + mir_snprintf(szSettingName, "%s_%s", GLOBAL_SETTING_PREFIX, name); return IcoLib_GetIcon(szSettingName, big); } diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5c55583396..475e14a7f3 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -219,7 +219,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) JabberShaStrBuf buf; T2Utf str(m_ThreadInfo->conn.password); char text[200]; - mir_snprintf(text, _countof(text), "%s%s", m_ThreadInfo->szStreamId, str); + mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId, str); query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf))); } else if (XmlGetChild(queryNode, "password") != NULL) @@ -751,13 +751,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (nEmail == 0) mir_strcpy(text, "e-mail"); else - mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1); + mir_snprintf(text, "e-mail%d", nEmail - 1); } - else mir_snprintf(text, _countof(text), "e-mail%d", nEmail); + else mir_snprintf(text, "e-mail%d", nEmail); setTString(hContact, text, XmlGetText(m)); if (hContact == NULL) { - mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail); + mir_snprintf(text, "e-mailFlag%d", nEmail); int nFlag = 0; if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME; if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK; @@ -925,10 +925,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) } else { char text[100]; - mir_snprintf(text, _countof(text), "Phone%d", nPhone); + mir_snprintf(text, "Phone%d", nPhone); setTString(text, XmlGetText(m)); - mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone); + mir_snprintf(text, "PhoneFlag%d", nPhone); int nFlag = 0; if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME; if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK; @@ -1013,7 +1013,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) delSetting(hContact, "e-mail"); else { char text[100]; - mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1); + mir_snprintf(text, "e-mail%d", nEmail - 1); if (db_get_s(hContact, m_szModuleName, text, &dbv)) break; db_free(&dbv); delSetting(hContact, text); @@ -1024,11 +1024,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else { while (true) { char text[100]; - mir_snprintf(text, _countof(text), "e-mail%d", nEmail); + mir_snprintf(text, "e-mail%d", nEmail); if (getString(text, &dbv)) break; db_free(&dbv); delSetting(text); - mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail); + mir_snprintf(text, "e-mailFlag%d", nEmail); delSetting(text); nEmail++; } @@ -1058,11 +1058,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else { while (true) { char text[100]; - mir_snprintf(text, _countof(text), "Phone%d", nPhone); + mir_snprintf(text, "Phone%d", nPhone); if (getString(text, &dbv)) break; db_free(&dbv); delSetting(text); - mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone); + mir_snprintf(text, "PhoneFlag%d", nPhone); delSetting(text); nPhone++; } diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index ba19e2ef1e..2ac9597335 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -424,7 +424,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) CMString szTmp; for (int i = 0; i < nMenuResourceItemsNew; i++) { - mir_snprintf(text, _countof(text), "/UseResource_%d", i); + mir_snprintf(text, "/UseResource_%d", i); if (i >= m_nMenuResourceItems) { CreateProtoServiceParam(text, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i); mi.name.a = ""; @@ -690,7 +690,7 @@ void CJabberProto::MenuInit() mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; mi.root = m_hMenuPriorityRoot; - mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", 0); + mir_snprintf(srvFce, "/menuSetPriority/%d", 0); bool needServices = !ProtoServiceExists(m_szModuleName, srvFce); if (needServices) CreateProtoServiceParam(srvFce, &CJabberProto::OnMenuSetPriority, 0); @@ -702,7 +702,7 @@ void CJabberProto::MenuInit() continue; } - mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", steps[i]); + mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]); if (steps[i] > 0) { mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]); mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP); diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 13fe033689..5f9a47bfdb 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2127,7 +2127,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mi.pszService = srvFce; int i = 0; - mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i); + mir_snprintf(srvFce, "/menuPrivacy%d", i); if (i > m_privacyMenuServiceAllocated) { CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i); m_privacyMenuServiceAllocated = i; @@ -2139,7 +2139,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) for (CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) { i++; - mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i); + mir_snprintf(srvFce, "/menuPrivacy%d", i); if (i > m_privacyMenuServiceAllocated) { CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i); diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index d05e00da66..ee1c82d201 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -493,21 +493,21 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr //search in recent for (int i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(getTStringA(key)); if (szValue == NULL || mir_tstrcmpi(szAddr, szValue)) continue; for (int j = i; j < 10; j++) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j + 1); + mir_snprintf(key, "RecentlySearched_%d", j + 1); szValue = getTStringA(key); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } else { if (deleteLastFromDB) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); delSetting(NULL, key); } break; @@ -523,15 +523,15 @@ void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog) SearchDeleteFromRecent(szAddr); for (int j = 9; j > 0; j--) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j - 1); + mir_snprintf(key, "RecentlySearched_%d", j - 1); ptrT szValue(getTStringA(key)); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } } - mir_snprintf(key, _countof(key), "RecentlySearched_%d", 0); + mir_snprintf(key, "RecentlySearched_%d", 0); setTString(key, szAddr); if (hwndDialog) JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr); @@ -563,7 +563,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR for (i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(dat->ppro->getTStringA(key)); if (szValue != NULL) JabberSearchAddUrlToRecentCombo(hwndDlg, szValue); diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 9edeb32d7e..cf0e6089cf 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -155,7 +155,7 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_state_t ctx; Utils_GetRandom(digest, sizeof(digest)); - mir_snprintf(cnonce, _countof(cnonce), "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3])); + mir_snprintf(cnonce, "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3])); T2Utf uname(info->conn.username), passw(info->conn.password); ptrA serv(mir_utf8encode(info->conn.server)); @@ -182,15 +182,15 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_finish(&ctx, (BYTE*)hash2); mir_md5_init(&ctx); - mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3])); + mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3])); mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf)); mir_md5_append(&ctx, (BYTE*)":", 1); mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce)); - mir_snprintf(tmpBuf, _countof(tmpBuf), ":%08d:", iCallCount); + mir_snprintf(tmpBuf, ":%08d:", iCallCount); mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf)); mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce)); mir_md5_append(&ctx, (BYTE*)":auth:", 6); - mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3])); + mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3])); mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf)); mir_md5_finish(&ctx, (BYTE*)digest); @@ -278,7 +278,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) mir_sha1_finish(&ctx, storedKey); char authmsg[4096]; - int authmsgLen = mir_snprintf(authmsg, _countof(authmsg), "%s,%s,c=biws,r=%s", msg1, chl, snonce); + int authmsgLen = mir_snprintf(authmsg, "%s,%s,c=biws,r=%s", msg1, chl, snonce); BYTE clientSig[MIR_SHA1_HASH_SIZE]; mir_hmac_sha1(clientSig, storedKey, sizeof(storedKey), (BYTE*)authmsg, authmsgLen); diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index e911f2a2c9..ef5cb2a80c 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -72,17 +72,17 @@ void CJabberProto::ConvertPasswords() for (int i = 0;; i++) { char varName[100]; - mir_snprintf(varName, _countof(varName), "rcMuc_%d_server", i); + mir_snprintf(varName, "rcMuc_%d_server", i); ptrA str(getStringA(NULL, varName)); if (str == NULL) break; - mir_snprintf(varName, _countof(varName), "rcMuc_%d", i); + mir_snprintf(varName, "rcMuc_%d", i); passw = JSetStringCrypt(m_szModuleName, NULL, varName); if (passw != NULL) { delSetting(varName); - mir_snprintf(varName, _countof(varName), "password_rcMuc_%d", i); + mir_snprintf(varName, "password_rcMuc_%d", i); setTString(varName, passw); } } diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 31bb9c7241..9122ce016d 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -148,7 +148,7 @@ void ThreadData::xmpp_client_query(void) return; char temp[256]; - mir_snprintf(temp, _countof(temp), "_xmpp-client._tcp.%s", conn.server); + mir_snprintf(temp, "_xmpp-client._tcp.%s", conn.server); DNS_RECORDA *results = NULL; DNS_STATUS status = DnsQuery_A(temp, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, (PDNS_RECORD *)&results, NULL); diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 1837898e5c..42d77dd05c 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1221,7 +1221,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s setTString(hContact, "ListeningTo", szListeningTo); char tuneIcon[128]; - mir_snprintf(tuneIcon, _countof(tuneIcon), "%s_%s", m_szModuleName, "main"); + mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main"); WriteAdvStatus(hContact, ADVSTATUS_TUNE, _T("listening_to"), tuneIcon, TranslateT("Listening To"), szListeningTo); mir_free(szListeningTo); -- cgit v1.2.3