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/Xfire/src/Xfire_base.cpp | 6 ++-- protocols/Xfire/src/Xfire_game.cpp | 4 +-- protocols/Xfire/src/Xfire_icon_mng.cpp | 2 +- protocols/Xfire/src/Xfire_voicechat.cpp | 2 +- protocols/Xfire/src/addgamedialog.cpp | 16 ++++----- protocols/Xfire/src/buddylist.cpp | 2 +- protocols/Xfire/src/iniupdater.cpp | 16 ++++----- protocols/Xfire/src/main.cpp | 61 ++++++++++++++++---------------- protocols/Xfire/src/options.cpp | 16 ++++----- protocols/Xfire/src/processbuddyinfo.cpp | 6 ++-- protocols/Xfire/src/searching4games.cpp | 16 ++++----- protocols/Xfire/src/userdetails.cpp | 6 ++-- protocols/Xfire/src/variables.cpp | 4 +-- 13 files changed, 78 insertions(+), 79 deletions(-) (limited to 'protocols/Xfire/src') diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index b5f9d12201..e7dc71b9bc 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -466,7 +466,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char return FALSE; //kein pfad bug?!?! if (subid == 0) { - mir_snprintf(idstring, _countof(idstring), "%d", gameid); + mir_snprintf(idstring, "%d", gameid); if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path)) return TRUE; @@ -474,7 +474,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char subid++; } - mir_snprintf(idstring, _countof(idstring), "%d_%d", gameid, subid); + mir_snprintf(idstring, "%d_%d", gameid, subid); if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path)) return TRUE; @@ -511,7 +511,7 @@ BOOL Xfire_base::getGamename(unsigned int gameid, char* out, int outsize) //customnamen laden, wenn vorhanden DBVARIANT dbv; char dbstr[XFIRE_MAXSIZEOFGAMENAME]; - mir_snprintf(dbstr, _countof(dbstr), "customgamename_%d", gameid); + mir_snprintf(dbstr, "customgamename_%d", gameid); if (!db_get(NULL, protocolname, dbstr, &dbv)) { strncpy_s(out, outsize, dbv.pszVal, _TRUNCATE); db_free(&dbv); diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 186a3c91ec..7e641883b0 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -56,7 +56,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*) //port begrenzen port = port % 65535; //port in string wandeln - mir_snprintf(portstr, _countof(portstr), "%d", port); + mir_snprintf(portstr, "%d", port); str_replace(mynetworkparams, "%UA_GAME_HOST_NAME%", ip); str_replace(mynetworkparams, "%UA_GAME_HOST_PORT%", portstr); @@ -403,7 +403,7 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid) CMenuItem mi; mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Start game"), 500084000); - mir_snprintf(m_temp, _countof(m_temp), servicefunction, m_id); + mir_snprintf(m_temp, servicefunction, m_id); //wenn die servicefunktion schon exisitert vernichten, hehe if (ServiceExists(m_temp)) DestroyServiceFunction(m_temp); diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp index b51639d8fd..1a76b82167 100644 --- a/protocols/Xfire/src/Xfire_icon_mng.cpp +++ b/protocols/Xfire/src/Xfire_icon_mng.cpp @@ -140,7 +140,7 @@ Xfire_icon_cache Xfire_icon_mng::LoadGameIcon(unsigned int gameid) if (hIconDll) { char resourcename[255]; //kurznamen des spiels uppercasen und .ICO anhängen - mir_snprintf(resourcename, _countof(resourcename), "XF_%s.ICO", shortname); + mir_snprintf(resourcename, "XF_%s.ICO", shortname); Xfire_base::strtoupper(resourcename); //versuche die resource zufinden diff --git a/protocols/Xfire/src/Xfire_voicechat.cpp b/protocols/Xfire/src/Xfire_voicechat.cpp index 732fa359ca..4417278b20 100644 --- a/protocols/Xfire/src/Xfire_voicechat.cpp +++ b/protocols/Xfire/src/Xfire_voicechat.cpp @@ -155,7 +155,7 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) return; } //ip speichern - mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port); + mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port); db_set_s(NULL, protocolname, "VServerIP", temp); //namen jeh nach id schreiben switch (packet->gameid) { diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 016c170a5c..7d789f3851 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -138,11 +138,11 @@ static void FillGameList(LPVOID hwndDlg) if (z2 != zahlbuffer2) { listentry.gameid = MAKELONG(gameid, atoi(zahlbuffer2)); - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid, atoi(zahlbuffer2)); + mir_snprintf(gameidtemp, "%d_%d", gameid, atoi(zahlbuffer2)); } else { listentry.gameid = gameid; - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid); + mir_snprintf(gameidtemp, "%d", gameid); } @@ -254,7 +254,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) //kein backslash dann normal ret als exenamen verwenden if ((INT_PTR)exename == 1) exename = exe; //filterstring aufbauen - mir_snprintf(szFilter, _countof(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files")); + mir_snprintf(szFilter, "%s|%s|%s|*.*|", exename, exename, Translate("All Files")); //umbruch in 0 wandeln unsigned int sizeFilter = mir_strlen(szFilter); for (unsigned int i = 0; i < sizeFilter; i++) @@ -325,13 +325,13 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) int gameid2 = HIWORD(gameids); if (gameid2 != 0) - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2); + mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2); else - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1); + mir_snprintf(gameidtemp, "%d", gameid1); //spielnamen holen if (xfire_GetPrivateProfileString(gameidtemp, "LongName", "", ret, 512, inipath)) { - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1); + mir_snprintf(gameidtemp, "%d", gameid1); //einige felder vorbelegen SetDlgItemTextA(hPage, IDC_ADD_NAME, ret); @@ -367,9 +367,9 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) char ret[512]; if (gameid2 != 0) - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2); + mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2); else - mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1); + mir_snprintf(gameidtemp, "%d", gameid1); //neuen gameeintrag anlegen Xfire_game* newgame = new Xfire_game(); diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp index 2d267f831a..b9fec9aaeb 100644 --- a/protocols/Xfire/src/buddylist.cpp +++ b/protocols/Xfire/src/buddylist.cpp @@ -149,7 +149,7 @@ namespace xfirelib /* ## buddies im miranda verarbietn */ char temp[255]; char * dummy; - mir_snprintf(temp, _countof(temp), "Clan_%d", entry->m_clanid); + mir_snprintf(temp, "Clan_%d", entry->m_clanid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp index ed3a43534e..29812cc5ac 100644 --- a/protocols/Xfire/src/iniupdater.cpp +++ b/protocols/Xfire/src/iniupdater.cpp @@ -51,11 +51,11 @@ void UpdateMyXFireIni(LPVOID) //ini pfad rausbekommen char file[1024], file2[1024], file3[1024]; - mir_snprintf(file, _countof(file), "%sxfire_games.new", inipath); - mir_snprintf(file2, _countof(file2), "%sxfire_games.ini", inipath); - mir_snprintf(file3, _countof(file3), "%sxfire_games.old", inipath); + mir_snprintf(file, "%sxfire_games.new", inipath); + mir_snprintf(file2, "%sxfire_games.ini", inipath); + mir_snprintf(file3, "%sxfire_games.old", inipath); - mir_snprintf(request, _countof(request), "%s%d", INI_URLREQUEST, getfilesize(file2)); + mir_snprintf(request, "%s%d", INI_URLREQUEST, getfilesize(file2)); if (CheckWWWContent(request)) { if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || DialogBox(hinstance, MAKEINTRESOURCE(IDD_UPDATE), NULL, DlgUpdateDialogProc) == IDOK) { @@ -84,11 +84,11 @@ void UpdateMyIcons(LPVOID) //ini pfad rausbekommen char file[1024], file2[1024], file3[1024]; - mir_snprintf(file, _countof(file), "%sicons.new", inipath); - mir_snprintf(file2, _countof(file2), "%sicons.dll", inipath); - mir_snprintf(file3, _countof(file3), "%sicons.old", inipath); + mir_snprintf(file, "%sicons.new", inipath); + mir_snprintf(file2, "%sicons.dll", inipath); + mir_snprintf(file3, "%sicons.old", inipath); - mir_snprintf(request, _countof(request), "%s%d", ICO_URLREQUEST, getfilesize(file2)); + mir_snprintf(request, "%s%d", ICO_URLREQUEST, getfilesize(file2)); if (CheckWWWContent(request)) { if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || MessageBox(NULL, TranslateT("There is a new Icons.dll online, do you want to update now?"), TranslateT(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) { diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 6701140303..8e84db6709 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -419,7 +419,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) ClanInvitationPacket *claninv = (ClanInvitationPacket*)content; for (int i = 0; i < claninv->numberOfInv; i++) { char msg[XFIRE_MAX_STATIC_STRING_LEN]; - mir_snprintf(msg, _countof(msg), Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(), + mir_snprintf(msg, Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(), claninv->invitefrom[i].c_str(), claninv->clanname[i].c_str(), claninv->invitemsg[i].c_str(), "\n"); @@ -479,7 +479,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) char temp[255]; char * dummy; ClanBuddyListNamesPacket *clan = (ClanBuddyListNamesPacket*)content; - mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid); + mir_snprintf(temp, "Clan_%d", clan->clanid); DBVARIANT dbv; if (!db_get(NULL,protocolname,temp,&dbv)) @@ -623,10 +623,10 @@ void XFireClient::receivedPacket(XFirePacket *packet) XFireClanPacket *clan = (XFireClanPacket*)content; for (int i = 0; i < clan->count; i++) { - mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid[i]); + mir_snprintf(temp, "Clan_%d", clan->clanid[i]); db_set_s(NULL, protocolname, temp, (char*)clan->name[i].c_str()); - mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clan->clanid[i]); + mir_snprintf(temp, "ClanUrl_%d", clan->clanid[i]); db_set_s(NULL, protocolname, temp, (char*)clan->url[i].c_str()); if (!db_get_b(NULL, protocolname, "noclangroups", 0)) { @@ -815,7 +815,7 @@ INT_PTR UrlCall(WPARAM, LPARAM lparam) if (mir_strlen(g) > 25) //zugroße abschneiden *(g + 25) = 0; - mir_snprintf(temp, _countof(temp), Translate("Do you really want to add %s to your friend list?"), g); + mir_snprintf(temp, Translate("Do you really want to add %s to your friend list?"), g); //Nutzer vorher fragen, ob er wirklich user xyz adden möchte if (MessageBoxA(NULL, temp, Translate(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) { if (myClient != NULL) { @@ -991,7 +991,7 @@ extern "C" __declspec(dllexport) int Load(void) //statusmessages setzen mir_strcpy(statusmessage[0], ""); - mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); + mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard")); HookEvent(ME_OPT_INITIALISE, OptInit); HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded); @@ -1412,7 +1412,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM) { //setze bei aktivem nocustomaway die alte awaystatusmsg zurück, bugfix if (db_get_b(NULL, protocolname, "nocustomaway", 0)) - mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); + mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard")); myClient->Status(statusmessage[1]); } @@ -1783,7 +1783,7 @@ static INT_PTR GetIPPort(WPARAM hContact, LPARAM) return 0; char temp[XFIRE_MAX_STATIC_STRING_LEN]; - mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1)); + mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1)); db_free(&dbv); if (OpenClipboard(NULL)) { @@ -1811,7 +1811,7 @@ static INT_PTR GetVIPPort(WPARAM hContact, LPARAM) return 0; char temp[XFIRE_MAX_STATIC_STRING_LEN]; - mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1)); + mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1)); db_free(&dbv); if (OpenClipboard(NULL)) { @@ -1850,7 +1850,7 @@ static INT_PTR GotoXFireClanSite(WPARAM hContact, LPARAM) char temp[64] = ""; int clanid = db_get_dw(hContact, protocolname, "Clan", -1); - mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clanid); + mir_snprintf(temp, "ClanUrl_%d", clanid); if (db_get_s(NULL, protocolname, temp, &dbv)) return 0; @@ -2125,7 +2125,7 @@ void gamedetectiont(void*) if (GetServerIPPort(pid, myClient->m_client->m_localaddr, myClient->m_client->m_llocaladdr, &packet->ip[3], &packet->ip[2], &packet->ip[1], &packet->ip[0], &packet->port)) { if (packet->ip[3] != 0) { - mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port); + mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port); db_set_s(NULL, protocolname, "ServerIP", temp); XFireLog("Got IPPort: %s", temp); } @@ -2368,7 +2368,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) { if ((unsigned char)gameob->m_ip[3] != 0) { // wenn ip, dann speichern - mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]); + mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]); db_set_s(hContact, protocolname, "VServerIP", temp); db_set_w(hContact, protocolname, "VPort", gameob->m_port); } @@ -2404,7 +2404,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc //popup, wenn jemand was spielt if (db_get_b(NULL, protocolname, "gamepopup", 0) == 1) { char szMsg[256] = ""; - mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s."), + mir_snprintf(szMsg, Translate("%s is playing %s."), //ist ein nick gesetzt? (entry->m_nick.length() == 0 ? //nein dann username @@ -2415,7 +2415,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) { if ((unsigned char)gameob->m_ip[3] != 0) { - mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s on server %d.%d.%d.%d:%d."), + mir_snprintf(szMsg, Translate("%s is playing %s on server %d.%d.%d.%d:%d."), //ist ein nick gesetzt? (entry->m_nick.length() == 0 ? //nein dann username @@ -2460,7 +2460,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) { if ((unsigned char)gameob->m_ip[3] != 0) { //ip und port in kontakt speichern - mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]); + mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]); db_set_s(hContact, protocolname, "ServerIP", temp); db_set_w(hContact, protocolname, "Port", gameob->m_port); @@ -2572,10 +2572,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else { char temp[256]; DBVARIANT dbv; - mir_snprintf(temp, _countof(temp), "%d", val - 1); + mir_snprintf(temp, "%d", val - 1); db_get_s(NULL, "CListGroups", temp, &dbv); if (dbv.pszVal != NULL) { - mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group); + mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group); db_set_s(entry->m_hcontact, "CList", "Group", temp); db_free(&dbv); } @@ -2592,10 +2592,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else { char temp[256]; DBVARIANT dbv; - mir_snprintf(temp, _countof(temp), "%d", val - 1); + mir_snprintf(temp, "%d", val - 1); db_get_s(NULL, "CListGroups", temp, &dbv); if (dbv.pszVal != NULL) { - mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group); + mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group); db_set_s(entry->m_hcontact, "CList", "Group", temp); db_free(&dbv); } @@ -2693,9 +2693,9 @@ void CreateGroup(char*grpn, char*field) strcpy_s(grp, _countof(grp), grpn);//((char*)clan->name[i].c_str()); else { char temp[255]; - mir_snprintf(temp, _countof(temp), "%d", val - 1); + mir_snprintf(temp, "%d", val - 1); if (!db_get_s(NULL, "CListGroups", temp, &dbv)) { - mir_snprintf(grp, _countof(grp), "%s\\%s", &dbv.pszVal[1], grpn); + mir_snprintf(grp, "%s\\%s", &dbv.pszVal[1], grpn); db_free(&dbv); } else { //gruppe existiert nciht mehr, auf root alles legen @@ -2709,7 +2709,7 @@ void CreateGroup(char*grpn, char*field) char temp[10]; int i = 0; for (i = 0;; i++) { - mir_snprintf(temp, _countof(temp), "%d", i); + mir_snprintf(temp, "%d", i); if (db_get_s(NULL, "CListGroups", temp, &dbv)) { i--; break; @@ -2723,7 +2723,7 @@ void CreateGroup(char*grpn, char*field) strcpy_s(group, 255, "D"); strcat_s(group, 255, grp); group[0] = 1 | GROUPF_EXPANDED; - mir_snprintf(temp, _countof(temp), "%d", i + 1); + mir_snprintf(temp, "%d", i + 1); db_set_s(NULL, "CListGroups", temp, group); CallServiceSync(MS_CLUI_GROUPADDED, i + 1, 0); } @@ -2736,17 +2736,16 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) if (wParam == ID_STATUS_ONLINE) mir_strcpy(statusmessage[0], ""); else if (wParam != ID_STATUS_OFFLINE) - mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); + mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard")); } else { if (wParam == ID_STATUS_ONLINE) mir_strcpy(statusmessage[0], (char*)lParam); else if (wParam != ID_STATUS_OFFLINE) { - if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0) { - mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", (char*)lParam); - //mir_strcpy(statusmessage[1],( char* )lParam); - } - else mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); + if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0) + mir_snprintf(statusmessage[1], "(AFK) %s", (char*)lParam); + else + mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard")); } } @@ -2832,7 +2831,7 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM) char temp[256]; DBVARIANT dbv; if (!db_get_s(hContact, protocolname, "Username", &dbv)) { - mir_snprintf(temp, _countof(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal); + mir_snprintf(temp, Translate("Do you really want to delete your friend %s?"), dbv.pszVal); if (MessageBoxA(NULL, temp, Translate("Confirm Delete"), MB_YESNO | MB_ICONQUESTION) == IDYES) { if (myClient != NULL) { if (myClient->m_client->m_connected) { @@ -2923,7 +2922,7 @@ int doneQuery(WPARAM wParam, LPARAM lParam) db_set_s(bud->m_hcontact, protocolname, "ServerName", gameinfo->name); db_set_s(bud->m_hcontact, protocolname, "GameType", gameinfo->gametype); db_set_s(bud->m_hcontact, protocolname, "Map", gameinfo->map); - mir_snprintf(temp, _countof(temp), "(%d/%d)", gameinfo->players, gameinfo->maxplayers); + mir_snprintf(temp, "(%d/%d)", gameinfo->players, gameinfo->maxplayers); db_set_s(bud->m_hcontact, protocolname, "Players", temp); db_set_b(bud->m_hcontact, protocolname, "Passworded", gameinfo->password); diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp index efde5c0404..a1ff71418f 100644 --- a/protocols/Xfire/src/options.cpp +++ b/protocols/Xfire/src/options.cpp @@ -177,7 +177,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } char temp[255] = ""; - mir_snprintf(temp, _countof(temp), "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); + mir_snprintf(temp, "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); SetDlgItemTextA(hwndDlg, IDC_PVER, temp); EnableWindow(GetDlgItem(hwndDlg, IDC_LASTGAME), FALSE); @@ -363,10 +363,10 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("")); SendDlgItemMessage(hwndDlg, IDC_FOFGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("")); - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); while (!db_get_s(NULL, "CListGroups", temp, &dbv)) { gruppen_id++; - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); if (dbv.pszVal != NULL) { SendDlgItemMessageA(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]); @@ -729,7 +729,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char temp[XFIRE_MAXSIZEOFGAMENAME]; for (int i = 0; i < found; i++) { //id auslesen - mir_snprintf(temp, _countof(temp), "gameid_%d", i); + mir_snprintf(temp, "gameid_%d", i); int gameid = db_get_w(NULL, protocolname, temp, 0); //spielnamen auslesen xgamelist.getGamename(gameid, temp, XFIRE_MAXSIZEOFGAMENAME); @@ -859,17 +859,17 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR //gameskip wert setzen char temp[64] = ""; - mir_snprintf(temp, _countof(temp), "gameskip_%d", gameid); + mir_snprintf(temp, "gameskip_%d", gameid); CheckDlgButton(hwndDlg, IDC_DONTDETECT, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "gamenostatus_%d", gameid); + mir_snprintf(temp, "gamenostatus_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOSTATUSMSG, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "notinstartmenu_%d", gameid); + mir_snprintf(temp, "notinstartmenu_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOTINSTARTMENU, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); //extra parameter auslesen, aber nur, wenn das spiel auch sowas unterstützt if (xgtemp && xgtemp->haveExtraGameArgs()) { EnableDlgItem(hwndDlg, IDC_EXTRAPARAMS, TRUE); - mir_snprintf(temp, _countof(temp), "gameextraparams_%d", gameid); + mir_snprintf(temp, "gameextraparams_%d", gameid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) { SetDlgItemTextA(hwndDlg, IDC_EXTRAPARAMS, dbv.pszVal); diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp index 0a48997f31..6fd8961477 100644 --- a/protocols/Xfire/src/processbuddyinfo.cpp +++ b/protocols/Xfire/src/processbuddyinfo.cpp @@ -45,7 +45,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".gif"); type = PA_FORMAT_GIF; - mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid); + mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid); dl = GetWWWContent("media.xfire.com", temp, filename, FALSE); break; @@ -54,7 +54,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".jpg"); type = PA_FORMAT_JPEG; - mir_snprintf(temp, _countof(temp), "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid); + mir_snprintf(temp, "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid); dl = GetWWWContent("screenshot.xfire.com", temp, filename, FALSE); break; @@ -62,7 +62,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c type = PA_FORMAT_GIF; mir_strcat(filename, "xfire.gif"); - mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid); + mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid); dl = GetWWWContent("media.xfire.com", temp, filename, TRUE); break; diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index c9b5192da4..1acf1fcf36 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -231,9 +231,9 @@ void Scan4Games(LPVOID) while (notfound < 200) { //2 gameids? if (split) - mir_snprintf(temp, _countof(temp), "%i_%i", i, i2); + mir_snprintf(temp, "%i_%i", i, i2); else - mir_snprintf(temp, _countof(temp), "%i", i); + mir_snprintf(temp, "%i", i); //MessageBox(0,temp,temp,0); @@ -411,7 +411,7 @@ void Scan4Games(LPVOID) if (multiexe) { multiexe = FALSE; for (int j = 1; j < 9; j++) { - mir_snprintf(ret, _countof(ret), "DetectExe[%d]", j); + mir_snprintf(ret, "DetectExe[%d]", j); if (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) { char *p = strrchr(path, '\\'); if (p != 0) { @@ -488,7 +488,7 @@ void Scan4Games(LPVOID) newgame->setString(ret2, &newgame->m_launchparams); //soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt - mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]"); + mir_snprintf(ret, "CommandLineMustNotContain[0]"); int k = 0; while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) { @@ -498,7 +498,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain); k++; - mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k); + mir_snprintf(ret, "CommandLineMustNotContain[%d]", k); } newgame->setNameandIcon(); @@ -583,7 +583,7 @@ void Scan4Games(LPVOID) newgame->m_setstatusmsg = atoi(ret2); //soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt - mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]"); + mir_snprintf(ret, "CommandLineMustNotContain[0]"); int k = 0; while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) { @@ -593,7 +593,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain); k++; - mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k); + mir_snprintf(ret, "CommandLineMustNotContain[%d]", k); } newgame->setNameandIcon(); @@ -653,7 +653,7 @@ void Scan4Games(LPVOID) int p = mir_strlen(gamelist) - 2; if (p > -1) gamelist[p] = 0; //letztes koma killen - mir_snprintf(ret, _countof(ret), Translate("Games found:%s%s"), "\r\n\r\n", gamelist); + mir_snprintf(ret, Translate("Games found:%s%s"), "\r\n\r\n", gamelist); MSGBOX(ret); } diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index aa4de637c3..9adabebebc 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -45,7 +45,7 @@ void LoadProfilStatus(void *arg) //dl char url[255]; - mir_snprintf(url, _countof(url), "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname); + mir_snprintf(url, "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname); char* buf = NULL; unsigned int size = 0; @@ -66,7 +66,7 @@ void SetItemTxt(HWND hwndDlg, int feldid, char*feld, MCONTACT hcontact, int type if (!db_get(hcontact, protocolname, feld, &dbv)) { if (type == 1) { char temp[255]; - mir_snprintf(temp, _countof(temp), "%i", dbv.wVal); + mir_snprintf(temp, "%i", dbv.wVal); SetDlgItemTextA(hwndDlg, feldid, temp); } else { @@ -91,7 +91,7 @@ static int GetIPPortUDetails(MCONTACT hContact, char* feld1, char* feld2) return 0; char temp[255]; - mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1)); + mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1)); db_free(&dbv); if (OpenClipboard(NULL)) { diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index e3b7eabedc..879bb9e6b6 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -102,7 +102,7 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) char temp[24]; DBVARIANT dbv3; if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3)) { - mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0)); + mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0)); db_free(&dbv3); return mir_strdup(temp); } @@ -125,7 +125,7 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) char temp[24]; DBVARIANT dbv3; if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3)) { - mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0)); + mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0)); db_free(&dbv3); return mir_strdup(temp); } -- cgit v1.2.3