From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SplashScreen/src/main.cpp | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'plugins/SplashScreen/src/main.cpp') diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 74eeb0ff7c..0a88380ac3 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -31,11 +31,11 @@ BOOL bmodulesloaded = false; // modules are loaded BOOL png2dibavail = true; // can we use png2dib service? // path to miranda's dir, config file path, splash path, sound path -TCHAR szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80]; -TCHAR *szMirDir; +wchar_t szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80]; +wchar_t *szMirDir; char szVersion[MAX_PATH]; #ifdef _DEBUG -TCHAR szLogFile[MAX_PATH]; +wchar_t szLogFile[MAX_PATH]; #endif SPLASHOPTS options; HWND hwndSplash; @@ -69,12 +69,12 @@ void SplashMain() CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion); #ifdef _DEBUG - mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _T(__PLUGIN_NAME)); + mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME)); initLog(); - TCHAR *mirandaVerString = mir_a2t(szVersion); + wchar_t *mirandaVerString = mir_a2t(szVersion); logMessage(L"Miranda version", mirandaVerString); mir_free(mirandaVerString); - logMessage(L"Dll Name", _T(__FILENAME)); + logMessage(L"Dll Name", _A2W(__FILENAME)); logMessage(L"Advaimg path", szhAdvaimgPath); #endif @@ -94,15 +94,14 @@ void SplashMain() mir_tstrcpy(inBuf, dbv.ptszVal); db_free(&dbv); } - else - mir_tstrcpy(inBuf, L"splash\\splash.png"); + else mir_tstrcpy(inBuf, L"splash\\splash.png"); - TCHAR szExpandedSplashFile[MAX_PATH]; + wchar_t szExpandedSplashFile[MAX_PATH]; ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, _countof(szExpandedSplashFile)); mir_tstrcpy(inBuf, szExpandedSplashFile); - TCHAR *pos3 = 0; - pos3 = _tcsrchr(inBuf, _T(':')); + wchar_t *pos3 = 0; + pos3 = wcsrchr(inBuf, ':'); if (pos3 == NULL) mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf); else @@ -112,15 +111,14 @@ void SplashMain() mir_tstrcpy(inBuf, dbv.ptszVal); db_free(&dbv); } - else - mir_tstrcpy(inBuf, L"sounds\\startup.wav"); + else mir_tstrcpy(inBuf, L"sounds\\startup.wav"); - TCHAR szExpandedSoundFile[MAX_PATH]; + wchar_t szExpandedSoundFile[MAX_PATH]; ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, _countof(szExpandedSoundFile)); mir_tstrcpy(inBuf, szExpandedSoundFile); - TCHAR *pos2; - pos2 = _tcschr(inBuf, _T(':')); + wchar_t *pos2; + pos2 = wcschr(inBuf, ':'); if (pos2 == NULL) mir_sntprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf); else @@ -130,19 +128,19 @@ void SplashMain() logMessage(L"SoundFilePath", szSoundFile); #endif - TCHAR szOldPath[MAX_PATH] = { 0 }; + wchar_t szOldPath[MAX_PATH] = { 0 }; if (options.random) // randomly select a splash file { int filescount = 0; - TCHAR szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 }; - TCHAR *p = 0; - TCHAR files[255][50]; //TODO: make memory allocation dynamic + wchar_t szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 }; + wchar_t *p = 0; + wchar_t files[255][50]; //TODO: make memory allocation dynamic mir_tstrcpy(szSplashDir, szSplashFile); mir_tstrcpy(szOldPath, szSplashFile); // find the last \ and null it out, this leaves no trailing slash - p = _tcsrchr(szSplashDir, _T('\\')); + p = wcsrchr(szSplashDir, '\\'); if (p) *p = 0; // create the search filter mir_sntprintf(szSearch, L"%s\\*.*", szSplashDir); @@ -158,7 +156,7 @@ void SplashMain() #endif //files = new char[mir_strlen(ffd.cFileName)]; //files[filescount] = new char[mir_strlen(ffd.cFileName)]; - TCHAR ext[5]; + wchar_t ext[5]; wmemcpy(ext, ffd.cFileName + (mir_tstrlen(ffd.cFileName) - 4), 5); #ifdef _DEBUG @@ -197,7 +195,7 @@ void SplashMain() int PlugDisableHook(WPARAM wParam, LPARAM lParam) { #ifdef _DEBUG - TCHAR buf[128]; + wchar_t buf[128]; #endif DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; if (options.inheritGS) { @@ -207,7 +205,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) cws->value.bVal ? _DebugPopup(NULL, L"Sounds enabled.", L"") : _DebugPopup(NULL, L"Sounds disabled.", L""); logMessage(L"Module", _A2T(cws->szModule)); logMessage(L"Setting", _A2T(cws->szSetting)); - logMessage(L"Value", _itot(cws->value.bVal, buf, 10)); + logMessage(L"Value", _itow(cws->value.bVal, buf, 10)); #endif } if (!strcmp(cws->szModule, "PluginDisable") && !strcmp(cws->szSetting, _T2A(szDllName))) { @@ -217,7 +215,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) logMessage(L"PlugDisableHook", L"Triggered"); logMessage(L"Module", _A2T(cws->szModule)); logMessage(L"Setting", _A2T(cws->szSetting)); - logMessage(L"Value", _itot(cws->value.bVal, buf, 10)); + logMessage(L"Value", _itow(cws->value.bVal, buf, 10)); #endif } } @@ -271,7 +269,7 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void) { - UnregisterClass(_T(SPLASH_CLASS), hInst); + UnregisterClass(SPLASH_CLASS, hInst); // Freeing loaded libraries if (hAdvaimg) -- cgit v1.2.3