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 --- src/mir_app/src/DefaultExtraIcons.cpp | 2 +- src/mir_app/src/FontOptions.cpp | 2 +- src/mir_app/src/chat_log.cpp | 4 +- src/mir_app/src/chat_opts.cpp | 2 +- src/mir_app/src/chat_tools.cpp | 15 ++-- src/mir_app/src/clc.cpp | 8 +- src/mir_app/src/clcutils.cpp | 2 +- src/mir_app/src/clistmod.cpp | 2 +- src/mir_app/src/clui.cpp | 4 +- src/mir_app/src/cluiservices.cpp | 2 +- src/mir_app/src/database.cpp | 12 +-- src/mir_app/src/dbini.cpp | 2 +- src/mir_app/src/dbutils.cpp | 6 +- src/mir_app/src/groups.cpp | 8 +- src/mir_app/src/hotkeys.cpp | 4 +- src/mir_app/src/icolib.cpp | 2 +- src/mir_app/src/lpopts.cpp | 4 +- src/mir_app/src/menu_clist.cpp | 6 +- src/mir_app/src/menu_options.cpp | 10 +-- src/mir_app/src/menu_utils.cpp | 8 +- src/mir_app/src/meta_menu.cpp | 2 +- src/mir_app/src/meta_services.cpp | 4 +- src/mir_app/src/meta_utils.cpp | 6 +- src/mir_app/src/netlibhttp.cpp | 6 +- src/mir_app/src/netliblog.cpp | 12 +-- src/mir_app/src/netlibopts.cpp | 2 +- src/mir_app/src/netlibsock.cpp | 2 +- src/mir_app/src/netlibupnp.cpp | 17 +--- src/mir_app/src/newplugins.cpp | 14 ++-- src/mir_app/src/options.cpp | 2 +- src/mir_app/src/path.cpp | 16 ++-- src/mir_app/src/pluginopts.cpp | 2 +- src/mir_app/src/profilemanager.cpp | 18 ++--- src/mir_app/src/proto_opts.cpp | 8 +- src/mir_app/src/skin2opts.cpp | 6 +- src/mir_app/src/skinicons.cpp | 142 +++++++++++++++++----------------- src/mir_app/src/sounds.cpp | 4 +- src/mir_app/src/xmlParser.cpp | 2 +- 38 files changed, 179 insertions(+), 191 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index 2f7080f8cb..ece76bf24c 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -112,7 +112,7 @@ struct Info static void EmailOnClick(Info*, const char *text) { char cmd[1024]; - mir_snprintf(cmd, _countof(cmd), "mailto:%s", text); + mir_snprintf(cmd, "mailto:%s", text); ShellExecuteA(NULL, "open", cmd, NULL, NULL, SW_SHOW); } diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 33bb684cd1..7c5b0d7666 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -1075,7 +1075,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_BTN_EXPORT: { TCHAR fname_buff[MAX_PATH], filter[MAX_PATH]; - mir_sntprintf(filter, _countof(filter), _T("%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c"), TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0); + mir_sntprintf(filter, _T("%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c"), TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index f238fd4217..41eab518cb 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -364,12 +364,12 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) static char szStyle[256]; if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) { int iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1); - mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY); + mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY); Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle); } else { int iii = lin->bIsHighlighted ? 16 : EventToIndex(lin); - mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY); + mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY); Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle); } } diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index a2d6810b51..b631984f2d 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -144,7 +144,7 @@ void RegisterFonts(void) strncpy_s(fontid.dbSettingsGroup, CHATFONT_MODULE, _TRUNCATE); _tcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE); - mir_snprintf(fontid.prefix, _countof(fontid.prefix), "Font%d", index); + mir_snprintf(fontid.prefix, "Font%d", index); fontid.order = index; switch (i) { diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 4ece7906d7..1de143f961 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -184,10 +184,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa pd.lchIcon = LoadIconEx("window", FALSE); PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName); - mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"), - (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, - cli.pfnGetContactDisplayName(hContact, 0)); - + mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0)); mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText)); pd.iSeconds = g_Settings->iPopupTimeout; @@ -563,9 +560,9 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) // formatting strings don't need to be translatable - changing them via language pack would // only screw up the log format. if (p) - mir_sntprintf(szLine, _countof(szLine), _T("%s %c %s\r\n"), szTime, p, szBuffer); + mir_sntprintf(szLine, _T("%s %c %s\r\n"), szTime, p, szBuffer); else - mir_sntprintf(szLine, _countof(szLine), _T("%s %s\r\n"), szTime, szBuffer); + mir_sntprintf(szLine, _T("%s %s\r\n"), szTime, szBuffer); if (szLine[0]) { _fputts(szLine, hFile); @@ -590,11 +587,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) _tsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt); TCHAR tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20]; - mir_sntprintf(tszNewPath, _countof(tszNewPath), _T("%s%sarchived\\"), tszDrive, tszDir); + mir_sntprintf(tszNewPath, _T("%s%sarchived\\"), tszDrive, tszDir); CreateDirectoryTreeT(tszNewPath); TCHAR tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20]; - mir_sntprintf(tszNewName, _countof(tszNewName), _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt); + mir_sntprintf(tszNewName, _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt); fclose(hFile); hFile = 0; if (!PathFileExists(tszNewName)) @@ -742,7 +739,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) TCHAR tszTemp[MAX_PATH], *ptszVarPath; if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') { - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log")); + mir_sntprintf(tszTemp, _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log")); ptszVarPath = tszTemp; } else ptszVarPath = g_Settings->pszLogDir; diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index d08d7736b0..4f8e9f3fd7 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -1135,7 +1135,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId); else if (contacto->type == CLCIT_GROUP) { //dropee is a group TCHAR szNewName[120]; - mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), cli.pfnGetGroupName(contactn->groupId, NULL), contacto->szText); + mir_sntprintf(szNewName, _T("%s\\%s"), cli.pfnGetGroupName(contactn->groupId, NULL), contacto->szText); cli.pfnRenameGroup(contacto->groupId, szNewName); } } @@ -1268,8 +1268,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contact->type == CLCIT_CONTACT) if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), contact->hContact)) break; - - if (contact->type == CLCIT_GROUP) { + + if (contact->type == CLCIT_GROUP) { switch (LOWORD(wParam)) { case POPUP_NEWSUBGROUP: if (contact->type != CLCIT_GROUP) @@ -1290,7 +1290,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break; } - Menu_ProcessCommandById(wParam, (LPARAM)hwnd); + Menu_ProcessCommandById(wParam, (LPARAM)hwnd); } break; diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index 203720f278..97fafe101d 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -410,7 +410,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) if (contact->type == CLCIT_GROUP) { if (contact->group->parent && contact->group->parent->parent) { TCHAR szFullName[256]; - mir_sntprintf(szFullName, _countof(szFullName), _T("%s\\%s"), + mir_sntprintf(szFullName, _T("%s\\%s"), cli.pfnGetGroupName(contact->group->parent->groupId, NULL), text); cli.pfnRenameGroup(contact->groupId, szFullName); } diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index e6a6897fed..db63eae84c 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -100,7 +100,7 @@ TCHAR* fnGetStatusModeDescription(int mode, int flags) default: if (IsStatusConnecting(mode)) { const TCHAR* connFmt = LPGENT("Connecting (attempt %d)"); - mir_sntprintf(szMode, _countof(szMode), (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1); + mir_sntprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1); return szMode; } return NULL; diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 90c3d2fe8c..6294142941 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -126,7 +126,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP TCHAR szFormat[256], szFinal[256]; GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, _countof(szFormat)); - mir_sntprintf(szFinal, _countof(szFinal), szFormat, cli.pfnGetContactDisplayName(lParam, 0)); + mir_sntprintf(szFinal, szFormat, cli.pfnGetContactDisplayName(lParam, 0)); SetDlgItemText(hWnd, IDC_TOPLINE, szFinal); } SetFocus( GetDlgItem(hWnd, IDNO)); @@ -993,7 +993,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM PROTOACCOUNT *pa; TCHAR tszName[64]; if ((pa = Proto_GetAccount(szProto)) != NULL) - mir_sntprintf(tszName, _countof(tszName), _T("%s "), pa->tszAccountName); + mir_sntprintf(tszName, _T("%s "), pa->tszAccountName); else tszName[0] = 0; diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 455c7b0614..f3679bcc75 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -167,7 +167,7 @@ void fnCluiProtocolStatusChanged(int, const char*) TCHAR tszName[64]; PROTOACCOUNT *pa = Proto_GetAccount(cli.menuProtos[i].szProto); if (pa) - mir_sntprintf(tszName, _countof(tszName), _T("%s "), pa->tszAccountName); + mir_sntprintf(tszName, _T("%s "), pa->tszAccountName); else tszName[0] = 0; diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 6066d0c059..e7df257bde 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -186,7 +186,7 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) if (isRootDir) _tcsncpy_s(pfd, VARST(_T("%miranda_path%\\*.dat")), _TRUNCATE); else - mir_sntprintf(pfd, _countof(pfd), _T("%s\\*.dat"), profiledir); + mir_sntprintf(pfd, _T("%s\\*.dat"), profiledir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(pfd, &ffd); @@ -196,10 +196,10 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) TCHAR path[MAX_PATH], path2[MAX_PATH]; TCHAR* profile = mir_tstrdup(ffd.cFileName); c = _tcsrchr(profile, '.'); if (c) *c = 0; - mir_sntprintf(path, _countof(path), _T("%s\\%s"), pfd, ffd.cFileName); - mir_sntprintf(path2, _countof(path2), _T("%s\\%s"), profiledir, profile); + mir_sntprintf(path, _T("%s\\%s"), pfd, ffd.cFileName); + mir_sntprintf(path2, _T("%s\\%s"), profiledir, profile); CreateDirectoryTreeT(path2); - mir_sntprintf(path2, _countof(path2), _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName); + mir_sntprintf(path2, _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName); if (_taccess(path2, 0) == 0) { TCHAR buf[512]; mir_sntprintf(buf, @@ -241,7 +241,7 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n if (bShowProfileManager || !reqfd) { TCHAR searchspec[MAX_PATH]; - mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), profiledir); + mir_sntprintf(searchspec, _T("%s\\*.*"), profiledir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(searchspec, &ffd); @@ -252,7 +252,7 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n continue; TCHAR newProfile[MAX_PATH]; - mir_sntprintf(newProfile, _countof(newProfile), _T("%s\\%s\\%s.dat"), profiledir, ffd.cFileName, ffd.cFileName); + mir_sntprintf(newProfile, _T("%s\\%s\\%s.dat"), profiledir, ffd.cFileName, ffd.cFileName); if (_taccess(newProfile, 0) != 0) continue; diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b876f89c16..b3661aeb76 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -447,7 +447,7 @@ static void DoAutoExec(void) do { bool secFN = mir_tstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0; - mir_sntprintf(szIniPath, _countof(szIniPath), _T("%s%s"), szFindPath, fd.cFileName); + mir_sntprintf(szIniPath, _T("%s%s"), szFindPath, fd.cFileName); if (!mir_tstrcmpi(szUse, _T("prompt")) && !secFN) { int result = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath); if (result == IDC_NOTOALL) break; diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index c8a9e9dbea..ffce62d4f3 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -61,12 +61,12 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam) if (!p->textService) { char szServiceName[100]; - mir_snprintf(szServiceName, _countof(szServiceName), "%s/GetEventText%d", p->module, p->eventType); + mir_snprintf(szServiceName, "%s/GetEventText%d", p->module, p->eventType); p->textService = mir_strdup(szServiceName); } if (!p->iconService) { char szServiceName[100]; - mir_snprintf(szServiceName, _countof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType); + mir_snprintf(szServiceName, "%s/GetEventIcon%d", p->module, p->eventType); p->iconService = mir_strdup(szServiceName); } eventTypes.insert(p); @@ -216,7 +216,7 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) icon = IcoLib_GetIconByHandle(et->eventIcon); if (!icon) { char szName[100]; - mir_snprintf(szName, _countof(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType); + mir_snprintf(szName, "eventicon_%s%d", dbei->szModule, dbei->eventType); icon = IcoLib_GetIcon(szName); } diff --git a/src/mir_app/src/groups.cpp b/src/mir_app/src/groups.cpp index 1788da5629..65eb0c8643 100644 --- a/src/mir_app/src/groups.cpp +++ b/src/mir_app/src/groups.cpp @@ -81,7 +81,7 @@ static INT_PTR CreateGroupInternal(INT_PTR iParent, const TCHAR *ptszName) if (db_get_ts(NULL, "CListGroups", str, &dbv)) return 0; - mir_sntprintf(newBaseName, _countof(newBaseName), _T("%s\\%s"), dbv.ptszVal + 1, grpName); + mir_sntprintf(newBaseName, _T("%s\\%s"), dbv.ptszVal + 1, grpName); mir_free(dbv.pszVal); } else mir_tstrncpy(newBaseName, grpName, _countof(newBaseName)); @@ -189,7 +189,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) db_free(&dbv); if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT)) { TCHAR szQuestion[256 + 100]; - mir_sntprintf(szQuestion, _countof(szQuestion), TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), name); + mir_sntprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), name); if (MessageBox(cli.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO) return 1; } @@ -243,7 +243,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) break; if (!_tcsncmp(dbv.ptszVal + 1, name, len) && dbv.pszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) { if (szNewParent[0]) - mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2); + mir_sntprintf(szNewName, _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2); else mir_tstrncpy(szNewName, dbv.ptszVal + len + 2, _countof(szNewName)); cli.pfnRenameGroup(i + 1, szNewName); @@ -302,7 +302,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) if (db_get_ts(NULL, "CListGroups", idstr, &dbv)) break; if (!_tcsncmp(dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) { - mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), szName, dbv.ptszVal + len + 2); + mir_sntprintf(szNewName, _T("%s\\%s"), szName, dbv.ptszVal + len + 2); RenameGroupWithMove(i, szNewName, 0); //luckily, child groups will never need reordering } db_free(&dbv); diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index b13663b191..72482cdb94 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -154,7 +154,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) if (item->rootHotkey = hotkeys.find(item)) { if (item->rootHotkey->allowSubHotkeys) { char nameBuf[MAXMODULELABELLENGTH]; - mir_snprintf(nameBuf, _countof(nameBuf), "%s$%d", item->rootHotkey->pszName, item->rootHotkey->nSubHotkeys); + mir_snprintf(nameBuf, "%s$%d", item->rootHotkey->pszName, item->rootHotkey->nSubHotkeys); item->pszName = mir_strdup(nameBuf); item->Enabled = TRUE; @@ -221,7 +221,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam) char *pszName = (char *)lParam; char pszNamePrefix[MAXMODULELABELLENGTH]; size_t cbNamePrefix; - mir_snprintf(pszNamePrefix, _countof(pszNamePrefix), "%s$", pszName); + mir_snprintf(pszNamePrefix, "%s$", pszName); cbNamePrefix = mir_strlen(pszNamePrefix); for (i = 0; i < hotkeys.getCount(); i++) { diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index ff63098fc4..67f5453622 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -353,7 +353,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR* path, int cxIcon, int cyI IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon) { TCHAR tszName[100]; - mir_sntprintf(tszName, _countof(tszName), _T("*StaticIcon_%d"), iStaticCount++); + mir_sntprintf(tszName, _T("*StaticIcon_%d"), iStaticCount++); IconSourceItem* newItem = (IconSourceItem*)mir_calloc(sizeof(IconSourceItem)); newItem->file = IconSourceFile_Get(tszName, false); diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 96f3f78553..919d7ffa9e 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,7 +43,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */ if (szLanguageName[0] && szContryName[0]) { - mir_sntprintf(szLocaleName, _countof(szLocaleName), _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName)); + mir_sntprintf(szLocaleName, _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName)); if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) { TCHAR *pszIncompat; pszIncompat = TranslateT("(incompatible)"); @@ -77,7 +77,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */ TCHAR tszName[512]; - mir_sntprintf(tszName, _countof(tszName), _T("%s [%s]"), + mir_sntprintf(tszName, _T("%s [%s]"), TranslateTS(pack->tszLanguage), pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName); UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING; diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 55f8863d75..3b09379179 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -822,7 +822,7 @@ void RebuildMenuOrder(void) mi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0); if (Proto_IsAccountLocked(pa) && cli.bDisplayLocked) { - mir_sntprintf(tbuf, _countof(tbuf), TranslateT("%s (locked)"), pa->tszAccountName); + mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName); mi.name.t = tbuf; } else mi.name.t = pa->tszAccountName; @@ -846,7 +846,7 @@ void RebuildMenuOrder(void) mi.flags |= CMIF_CHECKED; if ((mi.flags & CMIF_CHECKED) && cli.bDisplayLocked) { - mir_sntprintf(tbuf, _countof(tbuf), TranslateT("%s (locked)"), pa->tszAccountName); + mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName); mi.name.t = tbuf; } else mi.name.t = pa->tszAccountName; @@ -1150,7 +1150,7 @@ void InitCustomMenus(void) hkd.dwFlags = HKD_TCHAR; for (int i = 0; i < _countof(statusHotkeys); i++) { char szName[30]; - mir_snprintf(szName, _countof(szName), "StatusHotKey_%d", i); + mir_snprintf(szName, "StatusHotKey_%d", i); hkd.pszName = szName; hkd.lParam = statusModeList[i]; hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0); diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 4621f5c9df..2b7fafaa97 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -83,13 +83,13 @@ class CGenMenuOptionsPage : public CDlgBase char menuItemName[256], DBString[300]; GetMenuItemName(iod->pimi, menuItemName, sizeof(menuItemName)); - mir_snprintf(DBString, _countof(DBString), "%s_visible", menuItemName); + mir_snprintf(DBString, "%s_visible", menuItemName); db_set_b(NULL, szModule, DBString, tvi.iImage != 0); - mir_snprintf(DBString, _countof(DBString), "%s_pos", menuItemName); + mir_snprintf(DBString, "%s_pos", menuItemName); db_set_dw(NULL, szModule, DBString, runtimepos); - mir_snprintf(DBString, _countof(DBString), "%s_name", menuItemName); + mir_snprintf(DBString, "%s_name", menuItemName); if (iod->name != NULL && iod->defname != NULL && mir_tstrcmp(iod->name, iod->defname) != 0) db_set_ts(NULL, szModule, DBString, iod->name); else @@ -120,7 +120,7 @@ class CGenMenuOptionsPage : public CDlgBase return; char szModule[256]; - mir_snprintf(szModule, _countof(szModule), "%s_Items", pmo->pszName); + mir_snprintf(szModule, "%s_Items", pmo->pszName); CallService(MS_DB_MODULE_DELETE, NULL, (LPARAM)szModule); SaveTreeInternal(m_menuItems.GetRoot(), szModule); } @@ -244,7 +244,7 @@ class CGenMenuOptionsPage : public CDlgBase return false; char szModule[256]; - mir_snprintf(szModule, _countof(szModule), "%s_Items", pmo->pszName); + mir_snprintf(szModule, "%s_Items", pmo->pszName); bRebuild = true; m_menuItems.SendMsg(WM_SETREDRAW, FALSE, 0); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 583acb9cb4..d1851d2976 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -950,7 +950,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU if (GetKeyState(VK_CONTROL) & 0x8000) { TCHAR str[256]; - mir_sntprintf(str, _countof(str), _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); + mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); mii.dwTypeData = str; } #endif @@ -964,7 +964,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU if (GetKeyState(VK_CONTROL) & 0x8000) { TCHAR str[256]; - mir_sntprintf(str, _countof(str), _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); + mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); mii.dwTypeData = str; } #endif @@ -1046,10 +1046,10 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0); TCHAR sectionName[256]; - mir_sntprintf(sectionName, _countof(sectionName), LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName)); + mir_sntprintf(sectionName, LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName)); char iconame[256]; - mir_snprintf(iconame, _countof(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr); + mir_snprintf(iconame, "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr); // remove '&' if (descr) { diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 605dde9a21..661b7a986c 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -291,7 +291,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) // show hide nudge menu item char serviceFunc[256]; - mir_snprintf(serviceFunc, _countof(serviceFunc), "%s%s", GetContactProto(Meta_GetMostOnline(cc)), PS_SEND_NUDGE); + mir_snprintf(serviceFunc, "%s%s", GetContactProto(Meta_GetMostOnline(cc)), PS_SEND_NUDGE); CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, ServiceExists(serviceFunc)); return 0; } diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 82c2fa90d7..d66a1334ca 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -570,7 +570,7 @@ static int Meta_MessageWindowEvent(WPARAM, LPARAM lParam) static INT_PTR Meta_SrmmCurrentSub(WPARAM hMeta, LPARAM) { - MetaSrmmData tmp = { (UINT_PTR)hMeta }; + MetaSrmmData tmp = { (MCONTACT)hMeta }; if (MetaSrmmData *p = arMetaWindows.find(&tmp)) return p->m_hSub; @@ -853,7 +853,7 @@ void Meta_InitServices() // hidden contact menu items...ho hum for (int i = 0; i < MAX_CONTACTS; i++) { char szServiceName[100]; - mir_snprintf(szServiceName, _countof(szServiceName), "MetaContacts/MenuFunc%d", i); + mir_snprintf(szServiceName, "MetaContacts/MenuFunc%d", i); CreateServiceFunctionParam(szServiceName, MenuFunc, i); } diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 3be2190071..838faace9b 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -489,8 +489,8 @@ int Meta_SetAllNicks() static void SwapValues(MCONTACT hContact, LPCSTR szSetting, int n1, int n2) { char buf1[100], buf2[100]; - mir_snprintf(buf1, _countof(buf1), "%s%d", szSetting, n1); - mir_snprintf(buf2, _countof(buf2), "%s%d", szSetting, n2); + mir_snprintf(buf1, "%s%d", szSetting, n1); + mir_snprintf(buf2, "%s%d", szSetting, n2); DBVARIANT dbv1, dbv2; int ok1 = !db_get(hContact, META_PROTO, buf1, &dbv1); @@ -526,7 +526,7 @@ int Meta_SwapContacts(DBCachedContact *cc, int n1, int n2) void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest) { char idStr[50]; - mir_snprintf(idStr, _countof(idStr), "Login%d", i); + mir_snprintf(idStr, "Login%d", i); DBVARIANT dbv; if(db_get(hMeta, META_PROTO, idStr, &dbv)) diff --git a/src/mir_app/src/netlibhttp.cpp b/src/mir_app/src/netlibhttp.cpp index 5c520f5ec5..88f657022f 100644 --- a/src/mir_app/src/netlibhttp.cpp +++ b/src/mir_app/src/netlibhttp.cpp @@ -269,7 +269,7 @@ struct HttpSecurityContext if (szHost && _stricmp(szProvider, "Basic")) { unsigned long ip = inet_addr(szHost); PHOSTENT host = (ip == INADDR_NONE) ? gethostbyname(szHost) : gethostbyaddr((char*)&ip, 4, AF_INET); - mir_snprintf(szSpnStr, _countof(szSpnStr), "HTTP/%s", host && host->h_name ? host->h_name : szHost); + mir_snprintf(szSpnStr, "HTTP/%s", host && host->h_name ? host->h_name : szHost); _strlwr(szSpnStr + 5); NetlibLogf(nlu, "Host SPN: %s", szSpnStr); } @@ -897,9 +897,9 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) char *pspace = strchr(szMirandaVer, ' '); if (pspace) { *pspace++='\0'; - mir_snprintf(szUserAgent, _countof(szUserAgent), "Miranda/%s (%s)", szMirandaVer, pspace); + mir_snprintf(szUserAgent, "Miranda/%s (%s)", szMirandaVer, pspace); } - else mir_snprintf(szUserAgent, _countof(szUserAgent), "Miranda/%s", szMirandaVer); + else mir_snprintf(szUserAgent, "Miranda/%s", szMirandaVer); } if (!doneAcceptEncoding) { nlhrSend.headers[nlhrSend.headersCount].szName = "Accept-Encoding"; diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 7c9ae6e08d..7d4f9b454b 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -160,7 +160,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, _countof(str)); { TCHAR filter[200]; - mir_sntprintf(filter, _countof(filter), _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0); + mir_sntprintf(filter, _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; @@ -307,14 +307,14 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) case TIMEFORMAT_MILLISECONDS: QueryPerformanceCounter(&liTimeNow); liTimeNow.QuadPart -= mirandaStartTime; - mir_snprintf(szTime, _countof(szTime), "%I64u.%03I64u ", liTimeNow.QuadPart / perfCounterFreq, + mir_snprintf(szTime, "%I64u.%03I64u ", liTimeNow.QuadPart / perfCounterFreq, 1000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq); break; case TIMEFORMAT_MICROSECONDS: QueryPerformanceCounter(&liTimeNow); liTimeNow.QuadPart -= mirandaStartTime; - mir_snprintf(szTime, _countof(szTime), "%I64u.%06I64u ", liTimeNow.QuadPart / perfCounterFreq, + mir_snprintf(szTime, "%I64u.%06I64u ", liTimeNow.QuadPart / perfCounterFreq, 1000000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq); break; @@ -325,9 +325,9 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) char *szUser = (logOptions.showUser) ? (nlu == NULL ? NULL : nlu->user.szSettingsModule) : NULL; if (szUser) - mir_snprintf(szHead, _countof(szHead), "[%s%04X] [%s] ", szTime, GetCurrentThreadId(), szUser); + mir_snprintf(szHead, "[%s%04X] [%s] ", szTime, GetCurrentThreadId(), szUser); else - mir_snprintf(szHead, _countof(szHead), "[%s%04X] ", szTime, GetCurrentThreadId()); + mir_snprintf(szHead, "[%s%04X] ", szTime, GetCurrentThreadId()); if (logOptions.toOutputDebugString) { if (szHead[0]) @@ -401,7 +401,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla WaitForSingleObject(hConnectionHeaderMutex, INFINITE); NetlibUser *nlu = nlc ? nlc->nlu : NULL; - int titleLineLen = mir_snprintf(szTitleLine, _countof(szTitleLine), "(%p:%u) Data %s%s\r\n", + int titleLineLen = mir_snprintf(szTitleLine, "(%p:%u) Data %s%s\r\n", nlc, nlc ? nlc->s : 0, sent ? "sent" : "received", flags & MSG_DUMPPROXY ? " (proxy)" : ""); ReleaseMutex(hConnectionHeaderMutex); diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 90e6a5a555..af53750b65 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, TCHAR str[80]; { int selectedProxyType = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0); - mir_sntprintf(str, _countof(str), TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]); + mir_sntprintf(str, TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]); SetDlgItemText(hwndDlg, IDC_STOFTENPORT, str); if (IsDlgButtonChecked(hwndDlg, IDC_USEPROXY) != BST_UNCHECKED) { int enableAuth = 0, enableUser = 0, enablePass = 0, enableServer = 1; diff --git a/src/mir_app/src/netlibsock.cpp b/src/mir_app/src/netlibsock.cpp index 6ef069a290..c130bcf754 100644 --- a/src/mir_app/src/netlibsock.cpp +++ b/src/mir_app/src/netlibsock.cpp @@ -217,7 +217,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) if (addr->si_family == AF_INET) { char *szIp = inet_ntoa(addr->Ipv4.sin_addr); if (addr->Ipv4.sin_port != 0) { - mir_snprintf(saddr, _countof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port)); + mir_snprintf(saddr, "%s:%d", szIp, htons(addr->Ipv4.sin_port)); return mir_strdup(saddr); } return mir_strdup(szIp); diff --git a/src/mir_app/src/netlibupnp.cpp b/src/mir_app/src/netlibupnp.cpp index 578f641c67..ef0c713b2b 100644 --- a/src/mir_app/src/netlibupnp.cpp +++ b/src/mir_app/src/netlibupnp.cpp @@ -261,25 +261,16 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction char szData1[1024]; szReq = mir_strdup(szResult); - sz = mir_snprintf(szData1, _countof(szData1), - soap_action, szActionName, szDev, szReq, szActionName); - - sz = mir_snprintf(szData, 4096, - szPostHdr, szPath, szHost, sPort, - sz, szDev, szActionName, szData1); + sz = mir_snprintf(szData1, soap_action, szActionName, szDev, szReq, szActionName); + sz = mir_snprintf(szData, 4096, szPostHdr, szPath, szHost, sPort, sz, szDev, szActionName, szData1); } break; case ControlQuery: { char szData1[1024]; - - sz = mir_snprintf(szData1, _countof(szData1), - soap_query, szActionName); - - sz = mir_snprintf(szData, 4096, - szPostHdr, szPath, szHost, sPort, - sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1); + sz = mir_snprintf(szData1, soap_query, szActionName); + sz = mir_snprintf(szData, 4096, szPostHdr, szPath, szHost, sPort, sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1); } break; } diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 7858dfe27d..496e1184ae 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -380,7 +380,7 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam) // create the search filter TCHAR search[MAX_PATH]; - mir_sntprintf(search, _countof(search), _T("%s\\Plugins\\*.dll"), exe); + mir_sntprintf(search, _T("%s\\Plugins\\*.dll"), exe); // FFFN will return filenames for things like dot dll+ or dot dllx WIN32_FIND_DATA ffd; @@ -404,7 +404,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) pluginList.insert(p); TCHAR tszFullPath[MAX_PATH]; - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s"), path, dir, tszFileName); + mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), path, dir, tszFileName); // map dll into the memory and check its exports bool bIsPlugin = false; @@ -497,7 +497,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) if (!(p->pclass & PCLASS_BASICAPI)) { BASIC_PLUGIN_INFO bpi; - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s"), exe, (p->pclass & PCLASS_CORE) ? _T("Core") : _T("Plugins"), p->pluginname); + mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), exe, (p->pclass & PCLASS_CORE) ? _T("Core") : _T("Plugins"), p->pluginname); if (!checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) { p->pclass |= PCLASS_FAILED; return false; @@ -556,7 +556,7 @@ bool LoadCorePlugin(MuuidReplacement &mr) GetModuleFileName(NULL, exe, _countof(exe)); TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0; - mir_sntprintf(tszPlugName, _countof(tszPlugName), _T("%s.dll"), mr.stdplugname); + mir_sntprintf(tszPlugName, _T("%s.dll"), mr.stdplugname); pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe); if (pPlug->pclass & PCLASS_FAILED) { LBL_Error: @@ -614,14 +614,14 @@ static pluginEntry* getCListModule(TCHAR *exe) if (!isPluginOnWhiteList(p->pluginname)) continue; - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\Plugins\\%s"), exe, p->pluginname); + mir_sntprintf(tszFullPath, _T("%s\\Plugins\\%s"), exe, p->pluginname); if (loadClistModule(tszFullPath, p)) return p; } MuuidReplacement& stdClist = pluginDefault[10]; if (LoadCorePlugin(stdClist)) { - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\Core\\%s.dll"), exe, stdClist.stdplugname); + mir_sntprintf(tszFullPath, _T("%s\\Core\\%s.dll"), exe, stdClist.stdplugname); if (loadClistModule(tszFullPath, stdClist.pImpl)) return stdClist.pImpl; } @@ -775,7 +775,7 @@ int LoadNewPluginsModule(void) // if freeimage is present, load it to provide the basic core functions if (plugin_freeimg != NULL) { BASIC_PLUGIN_INFO bpi; - mir_sntprintf(fullPath, _countof(fullPath), _T("%s\\Plugins\\%s"), exe, plugin_freeimg->pluginname); + mir_sntprintf(fullPath, _T("%s\\Plugins\\%s"), exe, plugin_freeimg->pluginname); if (checkAPI(fullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) { plugin_freeimg->bpi = bpi; plugin_freeimg->pclass |= PCLASS_OK | PCLASS_BASICAPI; diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index ceac065583..90409385b3 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1151,7 +1151,7 @@ void OpenAccountOptions(PROTOACCOUNT *pa) return; TCHAR tszTitle[100]; - mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("%s options"), pa->tszAccountName); + mir_sntprintf(tszTitle, TranslateT("%s options"), pa->tszAccountName); OPENOPTIONSDIALOG ood = { sizeof(ood) }; ood.pszGroup = LPGEN("Network"); diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 73189cc361..4cf88ade76 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -144,13 +144,13 @@ static __forceinline char* GetPathVarX(const char*, int code) if (hAvatarFolder != NULL) _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); break; case 2: - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); break; case 3: - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName); break; } return makeFileName(szFullPath); @@ -228,13 +228,13 @@ static __forceinline TCHAR* GetPathVarX(const TCHAR*, int code) if (hAvatarFolder != NULL) _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); break; case 2: - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); break; case 3: - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName); break; } return mir_tstrdup(szFullPath); @@ -387,7 +387,7 @@ MIR_APP_DLL(wchar_t*) Utils_ReplaceVarsW(const wchar_t *wszData, MCONTACT hConta static int OnFoldersChanged(WPARAM, LPARAM) { - mir_sntprintf(tszAvatarRoot, _countof(tszAvatarRoot), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot)) @@ -397,7 +397,7 @@ static int OnFoldersChanged(WPARAM, LPARAM) void InitPathVar() { - mir_sntprintf(tszAvatarRoot, _countof(tszAvatarRoot), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); if (hAvatarFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatars root folder"), tszAvatarRoot)) { TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot)) diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 55fe0885c3..0c4eb9916a 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -455,7 +455,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (hdr->hdr.code == PSN_APPLY) { bool needRestart = false; TCHAR bufRestart[1024]; - int bufLen = mir_sntprintf(bufRestart, _countof(bufRestart), _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:")); + int bufLen = mir_sntprintf(bufRestart, _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:")); HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST); for (int iRow = 0; iRow != -1;) { diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index bda73395a4..caa4215997 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -46,7 +46,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA { // find in Miranda NG profile subfolders TCHAR searchspec[MAX_PATH]; - mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), szProfileDir); + mir_sntprintf(searchspec, _T("%s\\*.*"), szProfileDir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(searchspec, &ffd); @@ -59,7 +59,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA TCHAR buf[MAX_PATH], profile[MAX_PATH]; mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); if (_taccess(buf, 0) == 0) { - mir_sntprintf(profile, _countof(profile), _T("%s.dat"), ffd.cFileName); + mir_sntprintf(profile, _T("%s.dat"), ffd.cFileName); if (!callback(buf, profile, lParam)) break; } @@ -264,11 +264,11 @@ class CChooseProfileDlg : public CDlgBase struct _stat statbuf; if (_tstat(tszFullPath, &statbuf) == 0) { if (statbuf.st_size > 1000000) { - mir_sntprintf(sizeBuf, _countof(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1048576.0); + mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1048576.0); mir_tstrcpy(sizeBuf + 5, _T(" MB")); } else { - mir_sntprintf(sizeBuf, _countof(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1024.0); + mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1024.0); mir_tstrcpy(sizeBuf + 5, _T(" KB")); } bFileLocked = !fileExist(tszFullPath); @@ -319,7 +319,7 @@ class CChooseProfileDlg : public CDlgBase if (!m_profileList.GetItem(&item)) return; - mir_sntprintf(fullName, _countof(fullName), _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); + mir_sntprintf(fullName, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); CallService(MS_DB_CHECKPROFILE, (WPARAM)fullName, item.iImage == 2); } @@ -338,11 +338,11 @@ class CChooseProfileDlg : public CDlgBase if (!m_profileList.GetItem(&item)) return; - mir_sntprintf(profilef, _countof(profilef), TranslateT("Are you sure you want to remove profile \"%s\"?"), profile); + mir_sntprintf(profilef, TranslateT("Are you sure you want to remove profile \"%s\"?"), profile); if (IDYES != MessageBox(NULL, profilef, _T("Miranda NG"), MB_YESNO | MB_TASKMODAL | MB_ICONWARNING)) return; - mir_sntprintf(profilef, _countof(profilef), _T("%s\\%s%c"), m_pd->ptszProfileDir, profile, 0); + mir_sntprintf(profilef, _T("%s\\%s%c"), m_pd->ptszProfileDir, profile, 0); SHFILEOPSTRUCT sf = { 0 }; sf.wFunc = FO_DELETE; @@ -383,7 +383,7 @@ class CChooseProfileDlg : public CDlgBase // profile is placed in "profile_name" subfolder TCHAR tmpPath[MAX_PATH]; - mir_sntprintf(tmpPath, _countof(tmpPath), _T("%s\\%s.dat"), m_pd->ptszProfileDir, profile); + mir_sntprintf(tmpPath, _T("%s\\%s.dat"), m_pd->ptszProfileDir, profile); if (_taccess(tmpPath, 2)) mir_sntprintf(m_pd->ptszProfile, MAX_PATH, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); else @@ -520,7 +520,7 @@ public: TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH]; struct _stat statbuf; m_profileList.GetItemText(pTip->iItem, 0, profilename, _countof(profilename)); - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profilename, profilename); + mir_sntprintf(tszFullPath, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profilename, profilename); _tstat(tszFullPath, &statbuf); mir_sntprintf(pTip->pszText, pTip->cchTextMax, _T("%s\n%s: %s\n%s: %s"), tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); } diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 151a3c2ff8..2ac28e13af 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -143,13 +143,13 @@ static bool OnCreateAccount(HWND hwndDlg) if (param->action == PRAC_UPGRADED) { BOOL oldProto = pa->bOldProto; TCHAR szPlugin[MAX_PATH]; - mir_sntprintf(szPlugin, _countof(szPlugin), _T("%s.dll"), _A2T(pa->szProtoName)); + mir_sntprintf(szPlugin, _T("%s.dll"), _A2T(pa->szProtoName)); int idx = accounts.getIndex(pa); UnloadAccount(pa, false, false); accounts.remove(idx); if (oldProto && UnloadPlugin(szPlugin, _countof(szPlugin))) { TCHAR szNewName[MAX_PATH]; - mir_sntprintf(szNewName, _countof(szNewName), _T("%s~"), szPlugin); + mir_sntprintf(szNewName, _T("%s~"), szPlugin); MoveFile(szPlugin, szNewName); } param->action = PRAC_ADDED; @@ -202,9 +202,9 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam TCHAR str[200]; if (param->action == PRAC_CHANGED) { // update EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOTYPECOMBO), FALSE); - mir_sntprintf(str, _countof(str), _T("%s: %s"), TranslateT("Editing account"), param->pa->tszAccountName); + mir_sntprintf(str, _T("%s: %s"), TranslateT("Editing account"), param->pa->tszAccountName); } - else mir_sntprintf(str, _countof(str), _T("%s: %s"), TranslateT("Upgrading account"), param->pa->tszAccountName); + else mir_sntprintf(str, _T("%s: %s"), TranslateT("Upgrading account"), param->pa->tszAccountName); SetWindowText(hwndDlg, str); SetDlgItemText(hwndDlg, IDC_ACCNAME, param->pa->tszAccountName); diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index defdcb097b..c05d98d258 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -118,7 +118,7 @@ static void __fastcall MySetCursor(TCHAR* nCursor) static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive) { TCHAR path[MAX_PATH]; - mir_sntprintf(path, _countof(path), _T("%s,"), filename); + mir_sntprintf(path, _T("%s,"), filename); size_t suffIndx = mir_tstrlen(path); mir_cslock lck(csIconList); @@ -418,7 +418,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.iItem = 0; int count = (int)_ExtractIconEx(filename, -1, 16, 16, NULL, LR_DEFAULTCOLOR); for (int i = 0; i < count; lvi.iItem++, i++) { - mir_sntprintf(caption, _countof(caption), _T("%d"), i + 1); + mir_sntprintf(caption, _T("%d"), i + 1); lvi.pszText = caption; HICON hIcon = NULL; @@ -520,7 +520,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.mask = LVIF_PARAM; lvi.iItem = dragItem; lvi.iSubItem = 0; ListView_GetItem(hPreview, &lvi); - mir_sntprintf(path, _countof(path), _T("%s,%d"), filename, (int)lvi.lParam); + mir_sntprintf(path, _T("%s,%d"), filename, (int)lvi.lParam); SendMessage(hwndParent, DM_CHANGEICON, dropHiLite, (LPARAM)path); ListView_SetItemState(GetDlgItem(hwndParent, IDC_PREVIEW), dropHiLite, 0, LVIS_DROPHILITED); } diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 698f7d4b72..73dae4a49b 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -29,70 +29,70 @@ struct StandardIconDescription int id; LPCSTR description; int resource_id; - int pf2; + UINT pf2; LPCSTR section; HANDLE hIcolib; }; static struct StandardIconDescription mainIcons[] = { - { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA }, // 0 - { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG }, // 1 - { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL }, // 2 - { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE }, // 3 - { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE }, // 4 - { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN }, // 5 - { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT }, // 6 - { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD }, // 7 - { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT }, // 8 - { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS }, // 9 - { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY }, // 10 - { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW }, // 11 - { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER }, // 12 - { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS }, // 13 - { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL }, // 14 - { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE }, // 15 - { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME }, // 16 - { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS }, // 17 - { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL }, // 18 - { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK }, // 19 - { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK }, // 20 - { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP }, // 21 - { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE }, // 22 - { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING }, // 23 - { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT }, // 24 - { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB }, // 25 - { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB }, // 26 - { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE }, // 27 - { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI }, // 28 - { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED }, // 29 - { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED }, // 30 - { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO }, // 31 - { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW }, // 32 - { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS }, // 33 - { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR }, // 34 - { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE }, // 35 - { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT }, // 36 - { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU }, // 37 - { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE }, // 38 - { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT }, // 39 - { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT }, // 40 - { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP }, // 41 - { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON }, // 42 - { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF }, // 43 - { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY }, // 44 - { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY }, // 45 - { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME }, // 46 - { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP }, // 47 - { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD }, // 48 - { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST }, // 49 - { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT }, // 50 - { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE }, // 51 - { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL }, // 52 - { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR }, // 53 - { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING }, // 54 - { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO }, // 55 - + { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA, 0, 0 }, // 0 + { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG, 0, 0 }, // 1 + { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL, 0, 0 }, // 2 + { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE, 0, 0 }, // 3 + { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE, 0, 0 }, // 4 + { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN, 0, 0 }, // 5 + { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT, 0, 0 }, // 6 + { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD, 0, 0 }, // 7 + { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT, 0, 0 }, // 8 + { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS, 0, 0 }, // 9 + { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY, 0, 0 }, // 10 + { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW, 0, 0 }, // 11 + { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER, 0, 0 }, // 12 + { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS, 0, 0 }, // 13 + { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL, 0, 0 }, // 14 + { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE, 0, 0 }, // 15 + { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME, 0, 0 }, // 16 + { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS, 0, 0 }, // 17 + { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL, 0, 0 }, // 18 + { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK, 0, 0 }, // 19 + { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK, 0, 0 }, // 20 + { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP, 0, 0 }, // 21 + { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE, 0, 0 }, // 22 + { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING, 0, 0 }, // 23 + { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT, 0, 0 }, // 24 + { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB, 0, 0 }, // 25 + { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB, 0, 0 }, // 26 + { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE, 0, 0 }, // 27 + { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI, 0, 0 }, // 28 + { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED, 0, 0 }, // 29 + { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED, 0, 0 }, // 30 + { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO, 0, 0 }, // 31 + { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW, 0, 0 }, // 32 + { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS, 0, 0 }, // 33 + { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR, 0, 0 }, // 34 + { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE, 0, 0 }, // 35 + { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT, 0, 0 }, // 36 + { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU, 0, 0 }, // 37 + { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE, 0, 0 }, // 38 + { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT, 0, 0 }, // 39 + { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT, 0, 0 }, // 40 + { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP, 0, 0 }, // 41 + { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON, 0, 0 }, // 42 + { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF, 0, 0 }, // 43 + { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY, 0, 0 }, // 44 + { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY, 0, 0 }, // 45 + { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME, 0, 0 }, // 46 + { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP, 0, 0 }, // 47 + { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD, 0, 0 }, // 48 + { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST, 0, 0 }, // 49 + { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT, 0, 0 }, // 50 + { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE, 0, 0 }, // 51 + { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL, 0, 0 }, // 52 + { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR, 0, 0 }, // 53 + { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING, 0, 0 }, // 54 + { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO, 0, 0 }, // 55 + { SKINICON_OTHER_VISIBLE_ALL, LPGEN("Always visible"), -IDI_ALWAYSVIS, 0, LPGEN("Contact list") }, { SKINICON_OTHER_INVISIBLE_ALL, LPGEN("Always invisible"), -IDI_NEVERVIS, 0, LPGEN("Contact list") }, { SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, LPGEN("Status icons") }, @@ -230,7 +230,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) caps2 = 0; if (IsStatusConnecting(status)) { - mir_snprintf(iconName, _countof(iconName), "%s%d", mainIconsFmt, 7); + mir_snprintf(iconName, "%s%d", mainIconsFmt, 7); return IcoLib_GetIcon(iconName, big); } @@ -249,7 +249,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // Otherwise return the global icon. This affects the global status menu mainly. if (accounts.getCount() == 1) { // format: core_status_%proto%statusindex - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx); HICON hIcon = IcoLib_GetIcon(iconName, big); if (hIcon) @@ -257,12 +257,12 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) } // format: core_status_%s%d - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx); return IcoLib_GetIcon(iconName, big); } // format: core_status_%s%d - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx); HICON hIcon = IcoLib_GetIcon(iconName, big); if (hIcon == NULL && (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2))) { PROTOACCOUNT *pa = Proto_GetAccount(szProto); @@ -272,7 +272,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // Queried protocol isn't in list, adding TCHAR tszSection[MAX_PATH]; - mir_sntprintf(tszSection, _countof(tszSection), _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName); + mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName); SKINICONDESC sid = { 0 }; sid.section.t = tszSection; @@ -281,11 +281,11 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) str = _tcsrchr(szPath, '\\'); if (str != NULL) *str = 0; - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName); + mir_sntprintf(szFullPath, _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName); if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES) sid.defaultFile.t = szFullPath; else { - mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\Plugins\\%S.dll"), szPath, szProto); + mir_sntprintf(szFullPath, _T("%s\\Plugins\\%S.dll"), szPath, szProto); if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1)) > 0) { DestroyIcon(hIcon); sid.defaultFile.t = szFullPath; @@ -309,7 +309,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) for (int i = lowidx; i < highidx; i++) if (caps2 == 0 || (caps2 & statusIcons[i].pf2)) { // format: core_%s%d - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, i); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, i); sid.pszName = iconName; sid.description.t = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0); sid.iDefaultIndex = statusIcons[i].resource_id; @@ -318,14 +318,14 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) } // format: core_status_%s%d - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx); hIcon = IcoLib_GetIcon(iconName, big); if (hIcon) return hIcon; } if (hIcon == NULL) { - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx); hIcon = IcoLib_GetIcon(iconName, big); } @@ -347,7 +347,7 @@ MIR_APP_DLL(char*) Skin_GetIconName(int idx) for (int i = 0; i < _countof(mainIcons); i++) { if (idx == mainIcons[i].id) { - mir_snprintf(szIconName, _countof(szIconName), "%s%d", mainIconsFmt, i); + mir_snprintf(szIconName, "%s%d", mainIconsFmt, i); return szIconName; } } @@ -383,7 +383,7 @@ int LoadSkinIcons(void) // Add main icons to list for (int i = 0; i < _countof(mainIcons); i++) { - mir_snprintf(iconName, _countof(iconName), "%s%d", mainIconsFmt, i); + mir_snprintf(iconName, "%s%d", mainIconsFmt, i); sid.section.a = mainIcons[i].section == NULL ? LPGEN("Main icons") : (char*)mainIcons[i].section; sid.description.a = (char*)mainIcons[i].description; sid.iDefaultIndex = mainIcons[i].resource_id; @@ -396,7 +396,7 @@ int LoadSkinIcons(void) // Asterisk is used, to avoid conflict with proto-plugins // 'coz users can't rename it to name with '*' for (int i = 0; i < _countof(statusIcons); i++) { - mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i); + mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i); sid.pszName = iconName; sid.description.a = (char*)statusIcons[i].description; sid.iDefaultIndex = statusIcons[i].resource_id; diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index c4623211bb..cd90608e55 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -307,9 +307,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn; memset(&ofn, 0, sizeof(ofn)); if (GetModuleHandle(_T("bass_interface.dll"))) - mir_sntprintf(filter, _countof(filter), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0); + mir_sntprintf(filter, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0); else - mir_sntprintf(filter, _countof(filter), _T("%s (*.wav)%c*.wav%c%s (*)%c*%c"), TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0); + mir_sntprintf(filter, _T("%s (*.wav)%c*.wav%c%s (*)%c*%c"), TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0); ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = GetParent(hwndDlg); ofn.hInstance = NULL; diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp index 8911efec03..9e79495845 100644 --- a/src/mir_app/src/xmlParser.cpp +++ b/src/mir_app/src/xmlParser.cpp @@ -402,7 +402,7 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) // create message char message[2000], *s1 = (char*)"", *s3 = (char*)""; XMLCSTR s2 = _CXML(""); if (pResults.error == eXMLErrorFirstTagNotFound) { s1 = (char*)"First Tag should be '"; s2 = tag; s3 = (char*)"'.\n"; } - mir_snprintf(message, _countof(message), + mir_snprintf(message, #ifdef _XMLWIDECHAR "XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s" #else -- cgit v1.2.3