diff options
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/bitmaps.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/db.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/hyperlink.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/langpack.cpp | 18 | ||||
-rw-r--r-- | src/mir_core/src/logger.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/miranda.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/openurl.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/path.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/timezones.cpp | 16 | ||||
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 14 | ||||
-rw-r--r-- | src/mir_core/src/winver.cpp | 6 |
11 files changed, 39 insertions, 41 deletions
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index c7aab86736..5a06bb50ff 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -42,7 +42,7 @@ MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen) if (dest == NULL)
return;
- mir_sntprintf(dest, destLen,
+ mir_snwprintf(dest, destLen,
L"%s (*.bmp;*.jpg;*.gif;*.png)%c*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG%c"
L"%s (*.bmp;*.rle)%c*.BMP;*.RLE%c"
L"%s (*.jpg;*.jpeg)%c*.JPG;*.JPEG%c"
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 84cf413aeb..0e028bb398 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -351,7 +351,7 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase *_db) currDb = _db;
// try to get the langpack's name from a profile
- ptrT langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
if (langpack && langpack[0] != '\0')
LoadLangPack(langpack);
else
diff --git a/src/mir_core/src/hyperlink.cpp b/src/mir_core/src/hyperlink.cpp index 8c9390f4c7..dbebe701b9 100644 --- a/src/mir_core/src/hyperlink.cpp +++ b/src/mir_core/src/hyperlink.cpp @@ -172,7 +172,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA if (dat->hEnableFont != NULL) hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) { /* select failed? */
SIZE textSize;
- if (GetTextExtentPoint32(hdc, (wchar_t*)lParam, (int)mir_tstrlen((wchar_t*)lParam), &textSize)) {
+ if (GetTextExtentPoint32(hdc, (wchar_t*)lParam, (int)mir_wstrlen((wchar_t*)lParam), &textSize)) {
if (GetClientRect(hwnd, &rc)) {
dat->rcText.top = 0;
dat->rcText.bottom = dat->rcText.top + textSize.cy;
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 757345cefe..9c29fc24da 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) wchar_t *p = wcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
- mir_sntprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9));
+ mir_snwprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
@@ -374,18 +374,18 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack)
{
- if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, L""))
+ if (ptszLangPack == NULL || !mir_wstrcmpi(ptszLangPack, L""))
return 1;
// ensure that a lang's name is a full file name
wchar_t tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
- mir_sntprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
+ mir_snwprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
// this lang is already loaded? nothing to do then
- if (!mir_tstrcmp(tszFullPath, langPack.tszFullPath))
+ if (!mir_wstrcmp(tszFullPath, langPack.tszFullPath))
return 0;
// ok... loading a new langpack. remove the old one if needed
@@ -563,9 +563,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam) wchar_t szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
- if (!mir_tstrcmpi(szClass, L"static") || !mir_tstrcmpi(szClass, L"hyperlink") || !mir_tstrcmpi(szClass, L"button") || !mir_tstrcmpi(szClass, L"MButtonClass") || !mir_tstrcmpi(szClass, L"MHeaderbarCtrl"))
+ if (!mir_wstrcmpi(szClass, L"static") || !mir_wstrcmpi(szClass, L"hyperlink") || !mir_wstrcmpi(szClass, L"button") || !mir_wstrcmpi(szClass, L"MButtonClass") || !mir_wstrcmpi(szClass, L"MHeaderbarCtrl"))
TranslateWindow(uuid, hwnd);
- else if (!mir_tstrcmpi(szClass, L"edit")) {
+ else if (!mir_wstrcmpi(szClass, L"edit")) {
if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_READONLY)
TranslateWindow(uuid, hwnd);
}
@@ -641,7 +641,7 @@ void GetDefaultLang() PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
- if (!mir_tstrcmpi(tszLangName, L"default")) {
+ if (!mir_wstrcmpi(tszLangName, L"default")) {
db_set_ts(NULL, "Langpack", "Current", L"default");
return;
}
@@ -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, L"langpack_%s.txt", wcslwr(tszLangName));
+ mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(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, L"%s\\langpack_*.txt", g_tszRoot);
+ mir_snwprintf(tszPath, L"%s\\langpack_*.txt", g_tszRoot);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(tszPath, &fd);
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index 3711d26fa6..a2e526a6a2 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -30,8 +30,8 @@ struct Logger {
Logger(const char* pszName, const wchar_t *ptszDescr, const wchar_t *ptszFilename, unsigned options) :
m_name(mir_strdup(pszName)),
- m_descr(mir_tstrdup(ptszDescr)),
- m_fileName(mir_tstrdup(ptszFilename)),
+ m_descr(mir_wstrdup(ptszDescr)),
+ m_fileName(mir_wstrdup(ptszFilename)),
m_options(options),
m_signature(SECRET_SIGNATURE),
m_out(NULL),
@@ -47,7 +47,7 @@ struct Logger int m_signature;
ptrA m_name;
- ptrT m_fileName, m_descr;
+ ptrW m_fileName, m_descr;
FILE *m_out;
__int64 m_lastwrite;
unsigned m_options;
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index 055244596f..c2b4208b54 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -58,9 +58,9 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam) if (wParam) {
VARST profilename(L"%miranda_profilename%");
- mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
+ mir_snwprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
}
- else mir_sntprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
+ else mir_snwprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index d75baaa2a3..93aab27ec2 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -32,7 +32,7 @@ struct TOpenUrlInfo newWindow(_bNew)
{}
- ptrT szUrl;
+ ptrW szUrl;
int newWindow;
};
@@ -56,7 +56,7 @@ static void OpenURLThread(void *arg) }
// check user defined browser for opening urls
- ptrT tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
+ ptrW tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
if (tszBrowser)
ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
else
@@ -68,7 +68,7 @@ static void OpenURLThread(void *arg) MIR_CORE_DLL(void) Utils_OpenUrl(const char *pszUrl, bool bOpenInNewWindow)
{
if (pszUrl)
- mir_forkthread(OpenURLThread, new TOpenUrlInfo(mir_a2t(pszUrl), bOpenInNewWindow));
+ mir_forkthread(OpenURLThread, new TOpenUrlInfo(mir_a2u(pszUrl), bOpenInNewWindow));
}
MIR_CORE_DLL(void) Utils_OpenUrlW(const wchar_t *pszUrl, bool bOpenInNewWindow)
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp index 64d00da713..56aa054c85 100644 --- a/src/mir_core/src/path.cpp +++ b/src/mir_core/src/path.cpp @@ -156,7 +156,7 @@ MIR_CORE_DLL(int) PathToAbsoluteW(const WCHAR *pSrc, WCHAR *pOut, const WCHAR *b WCHAR buf[MAX_PATH];
if (pSrc[0] < ' ')
- return mir_sntprintf(pOut, MAX_PATH, L"%s", pSrc);
+ return mir_snwprintf(pOut, MAX_PATH, L"%s", pSrc);
if (PathIsAbsoluteW(pSrc))
return GetFullPathName(pSrc, MAX_PATH, pOut, NULL);
@@ -167,7 +167,7 @@ MIR_CORE_DLL(int) PathToAbsoluteW(const WCHAR *pSrc, WCHAR *pOut, const WCHAR *b if (pSrc[0] == '\\')
pSrc++;
- mir_sntprintf(buf, MAX_PATH, L"%s%s", base, pSrc);
+ mir_snwprintf(buf, MAX_PATH, L"%s%s", base, pSrc);
return GetFullPathName(buf, MAX_PATH, pOut, NULL);
}
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index c832bd2d42..e8f0e05356 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -176,7 +176,7 @@ MIR_CORE_DLL(LPCTSTR) TimeZone_GetDescription(LPCTSTR TZname) for (int i = 0; i < g_timezonesBias.getCount(); i++) {
MIM_TIMEZONE *tz = g_timezonesBias[i];
- if (!mir_tstrcmp(tz->tszName, TZname))
+ if (!mir_wstrcmp(tz->tszName, TZname))
return tz->szDisplay;
}
return L"";
@@ -218,7 +218,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByName(LPCTSTR tszName, DWORD dwFlags) if (tszName == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
- if (mir_tstrcmp(myInfo.myTZ.tszName, tszName) == 0)
+ if (mir_wstrcmp(myInfo.myTZ.tszName, tszName) == 0)
return (dwFlags & TZF_DIFONLY) ? NULL : &myInfo.myTZ;
MIM_TIMEZONE tzsearch;
@@ -381,9 +381,9 @@ static const ListMessages* GetListMessages(HWND hWnd, DWORD dwFlags) if (!(dwFlags & (TZF_PLF_CB | TZF_PLF_LB))) {
wchar_t tszClassName[128];
GetClassName(hWnd, tszClassName, _countof(tszClassName));
- if (!mir_tstrcmpi(tszClassName, L"COMBOBOX"))
+ if (!mir_wstrcmpi(tszClassName, L"COMBOBOX"))
dwFlags |= TZF_PLF_CB;
- else if (!mir_tstrcmpi(tszClassName, L"LISTBOX"))
+ else if (!mir_wstrcmpi(tszClassName, L"LISTBOX"))
dwFlags |= TZF_PLF_LB;
}
if (dwFlags & TZF_PLF_CB)
@@ -405,7 +405,7 @@ MIR_CORE_DLL(int) TimeZone_SelectListItem(MCONTACT hContact, LPCSTR szModule, HW if (szModule == NULL) szModule = "UserInfo";
int iSelection = 0;
- ptrT tszName(db_get_tsa(hContact, szModule, "TzName"));
+ ptrW tszName(db_get_tsa(hContact, szModule, "TzName"));
if (tszName != NULL) {
unsigned hash = mir_hashstrT(tszName);
for (int i = 0; i < g_timezonesBias.getCount(); i++) {
@@ -506,9 +506,7 @@ void RecalculateTime(void) DYNAMIC_TIME_ZONE_INFORMATION dtzi;
if (pfnGetDynamicTimeZoneInformation && pfnGetDynamicTimeZoneInformation(&dtzi) != TIME_ZONE_ID_INVALID) {
- wchar_t *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
- wcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
- mir_free(myTzKey);
+ wcsncpy_s(myInfo.myTZ.tszName, dtzi.TimeZoneKeyName, _TRUNCATE);
found = true;
}
@@ -563,7 +561,7 @@ void InitTimeZones(void) tz->tzi.DaylightDate = tzi.DaylightDate;
tz->tzi.DaylightBias = tzi.DaylightBias;
- mir_tstrcpy(tz->tszName, tszName);
+ mir_wstrcpy(tz->tszName, tszName);
tz->hash = mir_hashstrT(tszName);
tz->offset = INT_MIN;
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 03065d06d2..8de4a148e7 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -382,7 +382,7 @@ wchar_t* CCtrlCombo::GetItemText(int index, wchar_t *buf, int size) {
wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
- mir_tstrncpy(buf, result, size);
+ mir_wstrncpy(buf, result, size);
return buf;
}
@@ -468,7 +468,7 @@ wchar_t* CCtrlListBox::GetItemText(int index, wchar_t *buf, int size) {
wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
- mir_tstrncpy(buf, result, size);
+ mir_wstrncpy(buf, result, size);
return buf;
}
@@ -966,7 +966,7 @@ void CCtrlListView::AddGroup(int iGroupId, wchar_t *name) lvg.cbSize = sizeof(lvg);
lvg.mask = LVGF_HEADER | LVGF_GROUPID;
lvg.pszHeader = name;
- lvg.cchHeader = (int)mir_tstrlen(lvg.pszHeader);
+ lvg.cchHeader = (int)mir_wstrlen(lvg.pszHeader);
lvg.iGroupId = iGroupId;
InsertGroup(-1, &lvg);
}
@@ -1680,7 +1680,7 @@ HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const wchar_t *name) while (tvi.hItem) {
GetItem(&tvi);
- if (!mir_tstrcmp(tvi.pszText, name))
+ if (!mir_wstrcmp(tvi.pszText, name))
return tvi.hItem;
tvi.hItem = GetNextSibling(tvi.hItem);
@@ -2139,7 +2139,7 @@ void CCtrlPages::AddPage(wchar_t *ptszName, HICON hIcon, CDlgBase *pDlg) TPageInfo *info = new TPageInfo;
info->m_pDlg = pDlg;
info->m_hIcon = hIcon;
- info->m_ptszHeader = mir_tstrdup(ptszName);
+ info->m_ptszHeader = mir_wstrdup(ptszName);
m_pages.insert(info);
}
@@ -2372,7 +2372,7 @@ void CCtrlBase::SetTextA(const char *text) void CCtrlBase::SetInt(int value)
{
wchar_t buf[32] = { 0 };
- mir_sntprintf(buf, L"%d", value);
+ mir_snwprintf(buf, L"%d", value);
SetWindowText(m_hwnd, buf);
}
@@ -2469,7 +2469,7 @@ CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, wchar_t {
m_szModule = mir_strdup(szModule);
m_szSetting = mir_strdup(szSetting);
- m_szDefault = mir_tstrdup(szValue);
+ m_szDefault = mir_wstrdup(szValue);
dbv.type = DBVT_DELETED;
}
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index cfbe338b81..8c7d73e98a 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -95,7 +95,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void) wchar_t tszName[100];
DWORD cbName;
- BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, L"default") != 0);
+ BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_wstrcmpi(tszName, L"default") != 0);
CloseDesktop(hDesk);
return bLocked;
}
@@ -395,7 +395,7 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize) // Include service pack (if any) and build number.
- if (mir_tstrlen(osvi.szCSDVersion) > 0) {
+ if (mir_wstrlen(osvi.szCSDVersion) > 0) {
ret.Append(L" ");
ret.Append(osvi.szCSDVersion);
}
@@ -408,6 +408,6 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize) ret.AppendFormat(L" (Wine %s)", _A2T(wine_get_version()));
}
- mir_tstrncpy(buf, ret, bufSize);
+ mir_wstrncpy(buf, ret, bufSize);
return TRUE;
}
|