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/AimOscar/src/client.cpp | 2 +- protocols/AimOscar/src/file.cpp | 4 ++-- protocols/AimOscar/src/popup.cpp | 2 +- protocols/AimOscar/src/proto.cpp | 4 ++-- protocols/AimOscar/src/server.cpp | 16 ++++++++-------- protocols/AimOscar/src/services.cpp | 2 +- protocols/AimOscar/src/theme.cpp | 4 ++-- protocols/AimOscar/src/utility.cpp | 14 +++++++------- 8 files changed, 24 insertions(+), 24 deletions(-) (limited to 'protocols/AimOscar') diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index b99ca2e133..1718f23ef5 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -54,7 +54,7 @@ int CAimProto::aim_auth_request(HANDLE hServerConn, unsigned short &seqno, const char client_id[64], mirver[64]; CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver); - int client_id_len = mir_snprintf(client_id, _countof(client_id), "Miranda AIM, version %s", mirver); + int client_id_len = mir_snprintf(client_id, "Miranda AIM, version %s", mirver); char* buf = (char*)alloca(SNAC_SIZE + TLV_HEADER_SIZE * 14 + MD5_HASH_LENGTH + mir_strlen(username) + client_id_len + 30 + mir_strlen(language) + mir_strlen(country)); diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 33bcbf0afe..aaf531eb22 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -97,7 +97,7 @@ void CAimProto::report_file_error(TCHAR *fname) { TCHAR errmsg[512]; TCHAR* error = mir_a2t(_strerror(NULL)); - mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s : %s"), fname, error); + mir_sntprintf(errmsg, TranslateT("Failed to open file: %s : %s"), fname, error); mir_free(error); ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP); } @@ -324,7 +324,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET mir_free(buf); TCHAR fname[256]; - mir_sntprintf(fname, _countof(fname), _T("%s%s"), ft->pfts.tszWorkingDir, name); + mir_sntprintf(fname, _T("%s%s"), ft->pfts.tszWorkingDir, name); mir_free(name); mir_free(ft->pfts.tszCurrentFile); ft->pfts.tszCurrentFile = mir_tstrdup(fname); diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index 01eec9d9b2..13d1888690 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -65,7 +65,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url) { POPUPDATAT ppd = {0}; - mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("%s Protocol"), m_tszUserName); + mir_sntprintf(ppd.lptzContactName, TranslateT("%s Protocol"), m_tszUserName); if (flags & ERROR_POPUP) { diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 276706acc7..2d359ac09e 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -57,7 +57,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); char szP2P[128]; - mir_snprintf(szP2P, _countof(szP2P), "%sP2P", m_szModuleName); + mir_snprintf(szP2P, "%sP2P", m_szModuleName); nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR; mir_sntprintf(descr, TranslateT("%s Client-to-client connection"), m_tszUserName); nlu.szSettingsModule = szP2P; @@ -672,7 +672,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE: char szDbsettings[64]; - mir_snprintf(szDbsettings, _countof(szDbsettings), "%sP2P", m_szModuleName); + mir_snprintf(szDbsettings, "%sP2P", m_szModuleName); CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings); break; diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index a69a768d25..c780fb5129 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -289,7 +289,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13]; char g = cap[14]; char h = cap[15]; - mir_snprintf(client, _countof(client), CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e)); + mir_snprintf(client, CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e)); } else if (memcmp(cap, "MirandaA", 8) == 0) { char a = cap[8]; @@ -300,7 +300,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13]; char g = cap[14]; char h = cap[15]; - mir_snprintf(client, _countof(client), CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h); + mir_snprintf(client, CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h); } if (memcmp(cap, "sinj", 4) == 0) { char a = cap[4]; @@ -311,7 +311,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9]; char g = cap[10]; char h = cap[11]; - mir_snprintf(client, _countof(client), CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12])); + mir_snprintf(client, CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12])); } if (memcmp(cap, "icqp", 4) == 0) { char a = cap[4]; @@ -322,7 +322,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9]; char g = cap[10]; char h = cap[11]; - mir_snprintf(client, _countof(client), CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12])); + mir_snprintf(client, CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12])); } else if (memcmp(cap, "Kopete ICQ", 10) == 0) { mir_strcpy(client, CLIENT_KOPETE); @@ -1469,7 +1469,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default: char msg[64]; - mir_snprintf(msg, _countof(msg), "Error removing buddy from list. Error code %#x", code); + mir_snprintf(msg, "Error removing buddy from list. Error code %#x", code); ShowPopup(msg, ERROR_POPUP); break; } @@ -1503,7 +1503,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default: char msg[64]; - mir_snprintf(msg, _countof(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code); + mir_snprintf(msg, Translate("Unknown error when adding buddy to list. Error code %#x"), code); ShowPopup(msg, ERROR_POPUP); break; } @@ -1521,7 +1521,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default: char msg[64]; - mir_snprintf(msg, _countof(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code); + mir_snprintf(msg, Translate("Unknown error when attempting to modify a group. Error code %#x"), code); ShowPopup(msg, ERROR_POPUP); break; } @@ -1661,7 +1661,7 @@ void CAimProto::snac_mail_response(SNAC &snac)//family 0x0018 if (new_mail && num_msgs) { TCHAR msg[1024]; - int len = mir_sntprintf(msg, _countof(msg), _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs, + int len = mir_sntprintf(msg, _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs, TranslateT("You've got mail! Checked at")); SYSTEMTIME stLocal; diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 27fe595f9a..a4e6b7050f 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -467,7 +467,7 @@ INT_PTR CAimProto::SetAvatar(WPARAM, LPARAM lParam) int fileId = _topen(tFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE); if (fileId < 0) { char errmsg[512]; - mir_snprintf(errmsg, _countof(errmsg), "Cannot store avatar. File '%s' could not be created/overwritten", tFileName); + mir_snprintf(errmsg, "Cannot store avatar. File '%s' could not be created/overwritten", tFileName); ShowPopup(errmsg, ERROR_POPUP); return 1; } diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 200c6f90cf..374f517d9c 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -63,7 +63,7 @@ void InitIcons(void) HICON LoadIconEx(const char *name, bool big) { char szSettingName[100]; - mir_snprintf(szSettingName, _countof(szSettingName), "AIM_%s", name); + mir_snprintf(szSettingName, "AIM_%s", name); return IcoLib_GetIcon(szSettingName, big); } @@ -79,7 +79,7 @@ HANDLE GetIconHandle(const char *name) void ReleaseIconEx(const char *name, bool big) { char szSettingName[100]; - mir_snprintf(szSettingName, _countof(szSettingName ), "%s_%s", "AIM", name); + mir_snprintf(szSettingName, "%s_%s", "AIM", name); IcoLib_Release(szSettingName, big); } diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 0a774fbf5b..0c785deb79 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -474,42 +474,42 @@ void BdList::remove_by_id(unsigned short id) unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i); + mir_snprintf(item, AIM_KEY_BI"%d", i); return getWord(hContact, item, 0); } void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_BI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i); + mir_snprintf(item, AIM_KEY_BI"%d", i); setWord(hContact, item, id); } int CAimProto::deleteBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i); + mir_snprintf(item, AIM_KEY_BI"%d", i); return delSetting(hContact, item); } unsigned short CAimProto::getGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i); + mir_snprintf(item, AIM_KEY_GI"%d", i); return getWord(hContact, item, 0); } void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_GI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i); + mir_snprintf(item, AIM_KEY_GI"%d", i); setWord(hContact, item, id); } int CAimProto::deleteGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI) + 10]; - mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i); + mir_snprintf(item, AIM_KEY_GI"%d", i); return delSetting(hContact, item); } @@ -530,7 +530,7 @@ int CAimProto::open_contact_file(const char*, const TCHAR* file, const char*, TC int fid = _topen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD); if (fid < 0) { TCHAR errmsg[512]; - mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL)); + mir_sntprintf(errmsg, TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL)); ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP); } return fid; -- cgit v1.2.3