summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
commit8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch)
tree94ef8927e12043ed6dcc15e1e640d68a8add520e /src/mir_core
parent1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff)
hello, Unix.
phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/bitmaps.cpp10
-rw-r--r--src/mir_core/src/cmdline.cpp8
-rw-r--r--src/mir_core/src/langpack.cpp34
-rw-r--r--src/mir_core/src/logger.cpp10
-rw-r--r--src/mir_core/src/miranda.cpp10
-rw-r--r--src/mir_core/src/openurl.cpp12
-rw-r--r--src/mir_core/src/path.cpp4
-rw-r--r--src/mir_core/src/threads.cpp2
-rw-r--r--src/mir_core/src/timezones.cpp22
-rw-r--r--src/mir_core/src/ui_utils.cpp2
-rw-r--r--src/mir_core/src/winver.cpp124
11 files changed, 119 insertions, 119 deletions
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp
index ee964c482c..c997a61a93 100644
--- a/src/mir_core/src/bitmaps.cpp
+++ b/src/mir_core/src/bitmaps.cpp
@@ -43,10 +43,10 @@ MIR_CORE_DLL(void) Bitmap_GetFilter(TCHAR *dest, size_t destLen)
return;
mir_sntprintf(dest, destLen,
- _T("%s (*.bmp;*.jpg;*.gif;*.png)%c*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG%c")
- _T("%s (*.bmp;*.rle)%c*.BMP;*.RLE%c")
- _T("%s (*.jpg;*.jpeg)%c*.JPG;*.JPEG%c")
- _T("%s (*.gif)%c*.GIF%c")
- _T("%s (*.png)%c*.PNG%c%c"),
+ 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"
+ L"%s (*.gif)%c*.GIF%c"
+ L"%s (*.png)%c*.PNG%c%c",
TranslateT("All Files"), 0, 0, TranslateT("Windows bitmaps"), 0, 0, TranslateT("JPEG bitmaps"), 0, 0, TranslateT("GIF bitmaps"), 0, 0, TranslateT("PNG bitmaps"), 0, 0, 0);
}
diff --git a/src/mir_core/src/cmdline.cpp b/src/mir_core/src/cmdline.cpp
index aa83fc2a2b..4896cdf347 100644
--- a/src/mir_core/src/cmdline.cpp
+++ b/src/mir_core/src/cmdline.cpp
@@ -60,13 +60,13 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
else continue; // skip a text that isn't an option
TCHAR *pOptionName = p+1;
- if ((p = _tcspbrk(pOptionName, _T(" \t=:"))) == NULL) { // no more text in string
- arParams.insert(new CmdLineParam(pOptionName, _T("")));
+ if ((p = _tcspbrk(pOptionName, L" \t=:")) == NULL) { // no more text in string
+ arParams.insert(new CmdLineParam(pOptionName, L""));
break;
}
if (*p == ' ' || *p == '\t') {
- arParams.insert(new CmdLineParam(pOptionName, _T("")));
+ arParams.insert(new CmdLineParam(pOptionName, L""));
p--; // the cycle will wipe this space automatically
continue;
}
@@ -74,7 +74,7 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
// parameter with value
*p = 0;
arParams.insert(new CmdLineParam(pOptionName, ++p));
- if ((p = _tcspbrk(p, _T(" \t"))) == NULL) // no more text in string
+ if ((p = _tcspbrk(p, L" \t")) == NULL) // no more text in string
break;
p--; // the cycle will wipe this space automatically
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp
index 0412510b1e..348719b1a0 100644
--- a/src/mir_core/src/langpack.cpp
+++ b/src/mir_core/src/langpack.cpp
@@ -219,11 +219,11 @@ static void LoadLangPackFile(FILE *fp, char *line)
TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
- mir_sntprintf(tszFileName, _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
+ mir_sntprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
- FILE *fpNew = _tfopen(tszFileName, _T("r"));
+ FILE *fpNew = _tfopen(tszFileName, L"r");
if (fpNew) {
line[0] = 0;
fgets(line, LANGPACK_BUF_SIZE, fpNew);
@@ -374,13 +374,13 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
{
- if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, _T("")))
+ if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, L""))
return 1;
// ensure that a lang's name is a full file name
TCHAR tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
- mir_sntprintf(tszFullPath, _T("%s\\%s"), g_tszRoot, ptszLangPack);
+ mir_sntprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
_tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
@@ -403,7 +403,7 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
_tcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE);
CharLower(langPack.tszFileName);
- FILE *fp = _tfopen(tszFullPath, _T("rt"));
+ FILE *fp = _tfopen(tszFullPath, L"rt");
if (fp == NULL)
return 1;
@@ -435,7 +435,7 @@ MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *ptszLangPack, LANGPACK_INFO *lp
_tcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE);
CharLower(lpInfo->tszFileName);
- FILE *fp = _tfopen(ptszLangPack, _T("rt"));
+ FILE *fp = _tfopen(ptszLangPack, L"rt");
if (fp == NULL)
return 1;
@@ -563,9 +563,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
TCHAR szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
- if (!mir_tstrcmpi(szClass, _T("static")) || !mir_tstrcmpi(szClass, _T("hyperlink")) || !mir_tstrcmpi(szClass, _T("button")) || !mir_tstrcmpi(szClass, _T("MButtonClass")) || !mir_tstrcmpi(szClass, _T("MHeaderbarCtrl")))
+ 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"))
TranslateWindow(uuid, hwnd);
- else if (!mir_tstrcmpi(szClass, _T("edit"))) {
+ else if (!mir_tstrcmpi(szClass, L"edit")) {
if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_READONLY)
TranslateWindow(uuid, hwnd);
}
@@ -632,17 +632,17 @@ MIR_CORE_DLL(void) Langpack_SortDuplicates(void)
void GetDefaultLang()
{
// calculate the langpacks' root
- PathToAbsoluteT(_T("\\Languages"), g_tszRoot);
+ PathToAbsoluteT(L"\\Languages", g_tszRoot);
if (_taccess(g_tszRoot, 0) != 0) // directory Languages exists
- PathToAbsoluteT(_T("."), g_tszRoot);
+ PathToAbsoluteT(L".", g_tszRoot);
// look into mirandaboot.ini
TCHAR tszPath[MAX_PATH], tszLangName[256];
- PathToAbsoluteT(_T("\\mirandaboot.ini"), tszPath);
- GetPrivateProfileString(_T("Language"), _T("DefaultLanguage"), _T(""), tszLangName, _countof(tszLangName), tszPath);
+ PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
+ GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
- if (!mir_tstrcmpi(tszLangName, _T("default"))) {
- db_set_ts(NULL, "Langpack", "Current", _T("default"));
+ if (!mir_tstrcmpi(tszLangName, L"default")) {
+ db_set_ts(NULL, "Langpack", "Current", L"default");
return;
}
if (!LoadLangPack(tszLangName)) {
@@ -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, _T("langpack_%s.txt"), _tcslwr(tszLangName));
+ mir_sntprintf(tszPath, L"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, _T("%s\\langpack_*.txt"), g_tszRoot);
+ mir_sntprintf(tszPath, L"%s\\langpack_*.txt", g_tszRoot);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(tszPath, &fd);
@@ -678,7 +678,7 @@ void GetDefaultLang()
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
- else db_set_ts(NULL, "Langpack", "Current", _T("default"));
+ else db_set_ts(NULL, "Langpack", "Current", L"default");
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp
index 4a229c367b..27b9f58e18 100644
--- a/src/mir_core/src/logger.cpp
+++ b/src/mir_core/src/logger.cpp
@@ -108,7 +108,7 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr,
return &arLoggers[idx];
}
- FILE *fp = _tfopen(ptszFile, _T("ab"));
+ FILE *fp = _tfopen(ptszFile, L"ab");
if (fp == NULL) {
TCHAR tszPath[MAX_PATH];
_tcsncpy_s(tszPath, ptszFile, _TRUNCATE);
@@ -149,7 +149,7 @@ MIR_C_CORE_DLL(int) mir_writeLogA(HANDLE hLogger, const char *format, ...)
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL)
+ if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
return 2;
va_list args;
@@ -171,7 +171,7 @@ MIR_C_CORE_DLL(int) mir_writeLogW(HANDLE hLogger, const WCHAR *format, ...)
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL)
+ if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
return 2;
va_list args;
@@ -195,7 +195,7 @@ MIR_CORE_DLL(int) mir_writeLogVA(HANDLE hLogger, const char *format, va_list arg
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL)
+ if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
return 2;
vfprintf(p->m_out, format, args);
@@ -214,7 +214,7 @@ MIR_CORE_DLL(int) mir_writeLogVW(HANDLE hLogger, const WCHAR *format, va_list ar
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL)
+ if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
return 2;
vfwprintf(p->m_out, format, args);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index f5a2997367..514aaa4306 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -57,10 +57,10 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam)
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
- VARST profilename(_T("%miranda_profilename%"));
- mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
+ VARST profilename(L"%miranda_profilename%");
+ mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
}
- else mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
+ else mir_sntprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
@@ -98,11 +98,11 @@ static void LoadCoreModule(void)
icce.dwICC = ICC_WIN95_CLASSES | ICC_USEREX_CLASSES;
InitCommonControlsEx(&icce);
- hAPCWindow = CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+ hAPCWindow = CreateWindowEx(0, L"ComboLBox", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetClassLongPtr(hAPCWindow, GCL_STYLE, GetClassLongPtr(hAPCWindow, GCL_STYLE) | CS_DROPSHADOW);
DestroyWindow(hAPCWindow);
- hAPCWindow = CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+ hAPCWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetWindowLongPtr(hAPCWindow, GWLP_WNDPROC, (LONG_PTR)APCWndProc);
SetTimer(hAPCWindow, 1, 1000, NULL);
hStackMutex = CreateMutex(NULL, FALSE, NULL);
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp
index dcd2516543..084bba84a7 100644
--- a/src/mir_core/src/openurl.cpp
+++ b/src/mir_core/src/openurl.cpp
@@ -43,24 +43,24 @@ static void OpenURLThread(void *arg)
// wack a protocol on it
CMString tszUrl;
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
- tszUrl.Format(_T("file:///%s"), hUrlInfo->szUrl);
+ tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
else {
int i;
for (i = 0; _istalpha(hUrlInfo->szUrl[i]); i++);
if (hUrlInfo->szUrl[i] == ':')
tszUrl = hUrlInfo->szUrl;
- else if (!_tcsnicmp(hUrlInfo->szUrl, _T("ftp."), 4))
- tszUrl.Format(_T("ftp://%s"), hUrlInfo->szUrl);
+ else if (!_tcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
+ tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl);
else
- tszUrl.Format(_T("http://%s"), hUrlInfo->szUrl);
+ tszUrl.Format(L"http://%s", hUrlInfo->szUrl);
}
// check user defined browser for opening urls
ptrT tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
if (tszBrowser)
- ShellExecute(NULL, _T("open"), tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
+ ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
else
- ShellExecute(NULL, _T("open"), tszUrl, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
+ ShellExecute(NULL, L"open", tszUrl, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
delete hUrlInfo;
}
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp
index 7327f619c8..64d00da713 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, _T("%s"), pSrc);
+ return mir_sntprintf(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, _T("%s%s"), base, pSrc);
+ mir_sntprintf(buf, MAX_PATH, L"%s%s", base, pSrc);
return GetFullPathName(buf, MAX_PATH, pOut, NULL);
}
diff --git a/src/mir_core/src/threads.cpp b/src/mir_core/src/threads.cpp
index cdd7ca4621..91d4c281b7 100644
--- a/src/mir_core/src/threads.cpp
+++ b/src/mir_core/src/threads.cpp
@@ -290,7 +290,7 @@ typedef LONG (WINAPI *pNtQIT)(HANDLE, LONG, PVOID, ULONG, PULONG);
static void* GetCurrentThreadEntryPoint()
{
- pNtQIT NtQueryInformationThread = (pNtQIT)GetProcAddress(GetModuleHandle(_T("ntdll.dll")), "NtQueryInformationThread");
+ pNtQIT NtQueryInformationThread = (pNtQIT)GetProcAddress(GetModuleHandle(L"ntdll.dll"), "NtQueryInformationThread");
if (NtQueryInformationThread == NULL)
return 0;
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp
index 322bdbf747..38281b123f 100644
--- a/src/mir_core/src/timezones.cpp
+++ b/src/mir_core/src/timezones.cpp
@@ -128,7 +128,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size
TCHAR dateTimeStr[64];
if (iso)
- tszTemp.AppendFormat(_T("%d-%02d-%02dT%02d:%02d:%02dZ"), st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond);
+ tszTemp.AppendFormat(L"%d-%02d-%02dT%02d:%02d:%02dZ", st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond);
else if (date) {
GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, _countof(dateTimeStr));
tszTemp.Append(dateTimeStr);
@@ -166,7 +166,7 @@ MIR_CORE_DLL(LPCTSTR) TimeZone_GetName(HANDLE hTZ)
if (tz == NULL)
return myInfo.myTZ.tszName;
else if (tz == UTC_TIME_HANDLE)
- return _T("UTC");
+ return L"UTC";
return tz->tszName;
}
@@ -179,7 +179,7 @@ MIR_CORE_DLL(LPCTSTR) TimeZone_GetDescription(LPCTSTR TZname)
if (!mir_tstrcmp(tz->tszName, TZname))
return tz->szDisplay;
}
- return _T("");
+ return L"";
}
static void CalcTsOffset(MIM_TIMEZONE *tz)
@@ -381,9 +381,9 @@ static const ListMessages* GetListMessages(HWND hWnd, DWORD dwFlags)
if (!(dwFlags & (TZF_PLF_CB | TZF_PLF_LB))) {
TCHAR tszClassName[128];
GetClassName(hWnd, tszClassName, _countof(tszClassName));
- if (!mir_tstrcmpi(tszClassName, _T("COMBOBOX")))
+ if (!mir_tstrcmpi(tszClassName, L"COMBOBOX"))
dwFlags |= TZF_PLF_CB;
- else if (!mir_tstrcmpi(tszClassName, _T("LISTBOX")))
+ else if (!mir_tstrcmpi(tszClassName, L"LISTBOX"))
dwFlags |= TZF_PLF_LB;
}
if (dwFlags & TZF_PLF_CB)
@@ -531,7 +531,7 @@ void InitTimeZones(void)
REG_TZI_FORMAT tzi;
HKEY hKey;
- const TCHAR *tszKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones");
+ const TCHAR *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
/*
* use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with
@@ -539,7 +539,7 @@ void InitTimeZones(void)
* localized systems or systems with a MUI pack installed
*/
if (IsWinVerVistaPlus())
- pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetDynamicTimeZoneInformation");
+ pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(L"kernel32"), "GetDynamicTimeZoneInformation");
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey)) {
DWORD dwIndex = 0;
@@ -552,7 +552,7 @@ void InitTimeZones(void)
dwSize = sizeof(tszName);
DWORD dwLength = sizeof(tzi);
- if (ERROR_SUCCESS != RegQueryValueEx(hSubKey, _T("TZI"), NULL, NULL, (unsigned char *)&tzi, &dwLength))
+ if (ERROR_SUCCESS != RegQueryValueEx(hSubKey, L"TZI", NULL, NULL, (unsigned char *)&tzi, &dwLength))
continue;
MIM_TIMEZONE *tz = new MIM_TIMEZONE;
@@ -567,9 +567,9 @@ void InitTimeZones(void)
tz->hash = mir_hashstrT(tszName);
tz->offset = INT_MIN;
- GetLocalizedString(hSubKey, _T("Display"), tz->szDisplay, _countof(tz->szDisplay));
- GetLocalizedString(hSubKey, _T("Std"), tz->tzi.StandardName, _countof(tz->tzi.StandardName));
- GetLocalizedString(hSubKey, _T("Dlt"), tz->tzi.DaylightName, _countof(tz->tzi.DaylightName));
+ GetLocalizedString(hSubKey, L"Display", tz->szDisplay, _countof(tz->szDisplay));
+ GetLocalizedString(hSubKey, L"Std", tz->tzi.StandardName, _countof(tz->tzi.StandardName));
+ GetLocalizedString(hSubKey, L"Dlt", tz->tzi.DaylightName, _countof(tz->tzi.DaylightName));
g_timezones.insert(tz);
g_timezonesBias.insert(tz);
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index f9dec18581..0860e797f9 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -2372,7 +2372,7 @@ void CCtrlBase::SetTextA(const char *text)
void CCtrlBase::SetInt(int value)
{
TCHAR buf[32] = { 0 };
- mir_sntprintf(buf, _T("%d"), value);
+ mir_sntprintf(buf, L"%d", value);
SetWindowText(m_hwnd, buf);
}
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp
index 5c7e983761..cdda5b55cc 100644
--- a/src/mir_core/src/winver.cpp
+++ b/src/mir_core/src/winver.cpp
@@ -69,9 +69,9 @@ MIR_CORE_DLL(BOOL) IsFullScreen()
// check foregroundwindow
HWND hWnd = GetForegroundWindow();
if (hWnd && hWnd != hWndDesktop && hWnd != hWndShell) {
- TCHAR tszClassName[128] = _T("");
+ TCHAR tszClassName[128] = L"";
GetClassName(hWnd, tszClassName, _countof(tszClassName));
- if (_tcscmp(tszClassName, _T("WorkerW"))) {
+ if (_tcscmp(tszClassName, L"WorkerW")) {
RECT rect, rectw, recti;
GetWindowRect(hWnd, &rectw);
@@ -95,7 +95,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void)
TCHAR tszName[100];
DWORD cbName;
- BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, _T("default")) != 0);
+ BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, L"default") != 0);
CloseDesktop(hDesk);
return bLocked;
}
@@ -220,192 +220,192 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
SYSTEM_INFO sysInfo = { 0 };
GetNativeSystemInfo(&sysInfo);
- CMString ret(_T("Microsoft "));
+ CMString ret(L"Microsoft ");
// Test for the specific product.
if (osvi.dwMajorVersion >= 6) {
if (osvi.dwMajorVersion == 10) {
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Windows 10 "));
+ ret.Append(L"Windows 10 ");
else
- ret.Append(_T("Windows Server 10 "));
+ ret.Append(L"Windows Server 10 ");
}
else switch (osvi.dwMinorVersion) {
case 0:
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Windows Vista "));
+ ret.Append(L"Windows Vista ");
else
- ret.Append(_T("Windows Server 2008 "));
+ ret.Append(L"Windows Server 2008 ");
break;
case 1:
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Windows 7 "));
+ ret.Append(L"Windows 7 ");
else
- ret.Append(_T("Windows Server 2008 R2 "));
+ ret.Append(L"Windows Server 2008 R2 ");
break;
case 2:
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Windows 8 "));
+ ret.Append(L"Windows 8 ");
else
- ret.Append(_T("Windows Server 2012 "));
+ ret.Append(L"Windows Server 2012 ");
break;
case 3:
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Windows 8.1 "));
+ ret.Append(L"Windows 8.1 ");
else
- ret.Append(_T("Windows Server 2012 R2 "));
+ ret.Append(L"Windows Server 2012 R2 ");
break;
}
DWORD dwType = 0;
- HMODULE hKernel = GetModuleHandle(_T("kernel32.dll"));
+ HMODULE hKernel = GetModuleHandle(L"kernel32.dll");
PGPI pGPI = (PGPI)GetProcAddress(hKernel, "GetProductInfo");
if (pGPI != NULL)
pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);
switch (dwType) {
case PRODUCT_ULTIMATE:
- ret.Append(_T("Ultimate Edition"));
+ ret.Append(L"Ultimate Edition");
break;
case PRODUCT_PROFESSIONAL:
- ret.Append(_T("Professional Edition"));
+ ret.Append(L"Professional Edition");
break;
case PRODUCT_PROFESSIONAL_WMC:
- ret.Append(_T("Professional Edition with Media Center"));
+ ret.Append(L"Professional Edition with Media Center");
break;
case PRODUCT_HOME_PREMIUM:
- ret.Append(_T("Home Premium Edition"));
+ ret.Append(L"Home Premium Edition");
break;
case PRODUCT_HOME_BASIC:
- ret.Append(_T("Home Basic Edition"));
+ ret.Append(L"Home Basic Edition");
break;
case PRODUCT_ENTERPRISE:
- ret.Append(_T("Enterprise Edition"));
+ ret.Append(L"Enterprise Edition");
break;
case PRODUCT_BUSINESS:
- ret.Append(_T("Business Edition"));
+ ret.Append(L"Business Edition");
break;
case PRODUCT_STARTER:
- ret.Append(_T("Starter Edition"));
+ ret.Append(L"Starter Edition");
break;
case PRODUCT_CLUSTER_SERVER:
- ret.Append(_T("Cluster Server Edition"));
+ ret.Append(L"Cluster Server Edition");
break;
case PRODUCT_DATACENTER_SERVER:
- ret.Append(_T("Datacenter Edition"));
+ ret.Append(L"Datacenter Edition");
break;
case PRODUCT_DATACENTER_SERVER_CORE:
- ret.Append(_T("Datacenter Edition (core installation)"));
+ ret.Append(L"Datacenter Edition (core installation)");
break;
case PRODUCT_ENTERPRISE_SERVER:
- ret.Append(_T("Enterprise Edition"));
+ ret.Append(L"Enterprise Edition");
break;
case PRODUCT_ENTERPRISE_SERVER_CORE:
- ret.Append(_T("Enterprise Edition (core installation)"));
+ ret.Append(L"Enterprise Edition (core installation)");
break;
case PRODUCT_ENTERPRISE_SERVER_IA64:
- ret.Append(_T("Enterprise Edition for Itanium-based Systems"));
+ ret.Append(L"Enterprise Edition for Itanium-based Systems");
break;
case PRODUCT_SMALLBUSINESS_SERVER:
- ret.Append(_T("Small Business Server"));
+ ret.Append(L"Small Business Server");
break;
case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
- ret.Append(_T("Small Business Server Premium Edition"));
+ ret.Append(L"Small Business Server Premium Edition");
break;
case PRODUCT_STANDARD_SERVER:
- ret.Append(_T("Standard Edition"));
+ ret.Append(L"Standard Edition");
break;
case PRODUCT_STANDARD_SERVER_CORE:
- ret.Append(_T("Standard Edition (core installation)"));
+ ret.Append(L"Standard Edition (core installation)");
break;
case PRODUCT_WEB_SERVER:
- ret.Append(_T("Web Server Edition"));
+ ret.Append(L"Web Server Edition");
break;
}
if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- ret.Append(_T(", 64-bit"));
+ ret.Append(L", 64-bit");
else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
- ret.Append(_T(", 32-bit"));
+ ret.Append(L", 32-bit");
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) {
if (GetSystemMetrics(SM_SERVERR2))
- ret.Append(_T("Windows Server 2003 R2, "));
+ ret.Append(L"Windows Server 2003 R2, ");
else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER)
- ret.Append(_T("Windows Storage Server 2003"));
+ ret.Append(L"Windows Storage Server 2003");
else if (osvi.wSuiteMask == VER_SUITE_WH_SERVER)
- ret.Append(_T("Windows Home Server"));
+ ret.Append(L"Windows Home Server");
else if (osvi.wProductType == VER_NT_WORKSTATION && sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- ret.Append(_T("Windows XP Professional x64 Edition"));
+ ret.Append(L"Windows XP Professional x64 Edition");
else
- ret.Append(_T("Windows Server 2003, "));
+ ret.Append(L"Windows Server 2003, ");
// Test for the server type.
if (osvi.wProductType != VER_NT_WORKSTATION) {
if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) {
if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- ret.Append(_T("Datacenter Edition for Itanium-based Systems"));
+ ret.Append(L"Datacenter Edition for Itanium-based Systems");
else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- ret.Append(_T("Enterprise Edition for Itanium-based Systems"));
+ ret.Append(L"Enterprise Edition for Itanium-based Systems");
}
else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- ret.Append(_T("Datacenter x64 Edition"));
+ ret.Append(L"Datacenter x64 Edition");
else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- ret.Append(_T("Enterprise x64 Edition"));
- else ret.Append(_T("Standard x64 Edition"));
+ ret.Append(L"Enterprise x64 Edition");
+ else ret.Append(L"Standard x64 Edition");
}
else {
if (osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER)
- ret.Append(_T("Compute Cluster Edition"));
+ ret.Append(L"Compute Cluster Edition");
else if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- ret.Append(_T("Datacenter Edition"));
+ ret.Append(L"Datacenter Edition");
else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- ret.Append(_T("Enterprise Edition"));
+ ret.Append(L"Enterprise Edition");
else if (osvi.wSuiteMask & VER_SUITE_BLADE)
- ret.Append(_T("Web Edition"));
- else ret.Append(_T("Standard Edition"));
+ ret.Append(L"Web Edition");
+ else ret.Append(L"Standard Edition");
}
}
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) {
- ret.Append(_T("Windows XP "));
+ ret.Append(L"Windows XP ");
if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
- ret.Append(_T("Home Edition"));
- else ret.Append(_T("Professional"));
+ ret.Append(L"Home Edition");
+ else ret.Append(L"Professional");
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) {
- ret.Append(_T("Windows 2000 "));
+ ret.Append(L"Windows 2000 ");
if (osvi.wProductType == VER_NT_WORKSTATION)
- ret.Append(_T("Professional"));
+ ret.Append(L"Professional");
else {
if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- ret.Append(_T("Datacenter Server"));
+ ret.Append(L"Datacenter Server");
else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- ret.Append(_T("Advanced Server"));
- else ret.Append(_T("Server"));
+ ret.Append(L"Advanced Server");
+ else ret.Append(L"Server");
}
}
// Include service pack (if any) and build number.
if (mir_tstrlen(osvi.szCSDVersion) > 0) {
- ret.Append(_T(" "));
+ ret.Append(L" ");
ret.Append(osvi.szCSDVersion);
}
- ret.AppendFormat(_T(" (build %d)"), osvi.dwBuildNumber);
+ ret.AppendFormat(L" (build %d)", osvi.dwBuildNumber);
HMODULE hNtDll = GetModuleHandleA("ntdll.dll");
if (WGV wine_get_version = (WGV)GetProcAddress(hNtDll, "wine_get_version"))
{
- ret.AppendFormat(_T(" (Wine %s)"), _A2T(wine_get_version()));
+ ret.AppendFormat(L" (Wine %s)", _A2T(wine_get_version()));
}
mir_tstrncpy(buf, ret, bufSize);