diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
commit | c370af60855db957c5b200914bf0bde743845528 (patch) | |
tree | 0bd2ef127097c9e937c2650e8b202c3f09453323 /src/mir_core | |
parent | 7f082bd5d4865c30b313661b7a02f048b4b137be (diff) |
mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/langpack.cpp | 8 | ||||
-rw-r--r-- | src/mir_core/src/miranda.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/winutil.cpp | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index e28e07d21e..75bd198fe4 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -219,7 +219,7 @@ static void LoadLangPackFile(FILE *fp, char *line) TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
- mir_sntprintf(tszFileName, _countof(tszFileName), _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
+ mir_sntprintf(tszFileName, _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
@@ -380,7 +380,7 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) // ensure that a lang's name is a full file name
TCHAR tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s"), g_tszRoot, ptszLangPack);
+ mir_sntprintf(tszFullPath, _T("%s\\%s"), g_tszRoot, ptszLangPack);
else
_tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
@@ -653,7 +653,7 @@ void GetDefaultLang() // try to load langpack that matches UserDefaultUILanguage
if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
- mir_sntprintf(tszPath, _countof(tszPath), _T("langpack_%s.txt"), _tcslwr(tszLangName));
+ mir_sntprintf(tszPath, _T("langpack_%s.txt"), _tcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
db_set_ts(NULL, "Langpack", "Current", tszPath);
return;
@@ -661,7 +661,7 @@ void GetDefaultLang() }
// finally try to load first file
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\langpack_*.txt"), g_tszRoot);
+ mir_sntprintf(tszPath, _T("%s\\langpack_*.txt"), g_tszRoot);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(tszPath, &fd);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index ac022681dd..208a8731e4 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,9 +57,9 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
VARST profilename(_T("%miranda_profilename%"));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
+ mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
}
- else mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
+ else mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &pi);
diff --git a/src/mir_core/src/winutil.cpp b/src/mir_core/src/winutil.cpp index e0aeb7c803..42d3c331d8 100644 --- a/src/mir_core/src/winutil.cpp +++ b/src/mir_core/src/winutil.cpp @@ -31,16 +31,16 @@ MIR_CORE_DLL(int) Utils_SaveWindowPosition(HWND hwnd, MCONTACT hContact, const c GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.top);
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
return 0;
}
@@ -54,12 +54,12 @@ EXTERN_C MIR_CORE_DLL(int) Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hCont GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
return 1;
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
int y = (int)db_get_dw(hContact, szModule, szSettingName, -1);
if (flags & RWPF_NOSIZE)
@@ -68,10 +68,10 @@ EXTERN_C MIR_CORE_DLL(int) Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hCont wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
wp.rcNormalPosition.right = wp.rcNormalPosition.left+db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
wp.rcNormalPosition.bottom = wp.rcNormalPosition.top+db_get_dw(hContact, szModule, szSettingName, -1);
}
wp.flags = 0;
|