From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_clist.cpp | 4 ++-- plugins/MirLua/src/m_core.cpp | 6 +++--- plugins/MirLua/src/m_database.cpp | 4 ++-- plugins/MirLua/src/m_genmenu.cpp | 6 +++--- plugins/MirLua/src/m_hotkeys.cpp | 4 ++-- plugins/MirLua/src/m_icolib.cpp | 6 +++--- plugins/MirLua/src/m_message.cpp | 6 +++--- plugins/MirLua/src/m_options.cpp | 6 +++--- plugins/MirLua/src/m_sounds.cpp | 8 ++++---- plugins/MirLua/src/mlua.cpp | 4 ++-- plugins/MirLua/src/mlua_options.cpp | 2 +- plugins/MirLua/src/mlua_script.cpp | 10 +++++----- plugins/MirLua/src/mlua_script_loader.cpp | 4 ++-- 13 files changed, 35 insertions(+), 35 deletions(-) (limited to 'plugins/MirLua/src') diff --git a/plugins/MirLua/src/m_clist.cpp b/plugins/MirLua/src/m_clist.cpp index 70ac7ebfe3..59a5415b32 100644 --- a/plugins/MirLua/src/m_clist.cpp +++ b/plugins/MirLua/src/m_clist.cpp @@ -6,7 +6,7 @@ static int clist_AddMainMenuRoot(lua_State *L) int position = lua_tointeger(L, 2); HANDLE hIcon = (HANDLE)lua_touserdata(L, 3); - HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrT(Utf8DecodeT(name)), position, hIcon); + HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrW(Utf8DecodeT(name)), position, hIcon); lua_pushlightuserdata(L, res); return 1; @@ -29,7 +29,7 @@ static int clist_AddContactMenuRoot(lua_State *L) int position = lua_tointeger(L, 2); HANDLE hIcon = (HANDLE)lua_touserdata(L, 3); - HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrT(Utf8DecodeT(name)), position, hIcon); + HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrW(Utf8DecodeT(name)), position, hIcon); lua_pushlightuserdata(L, res); return 1; diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 27d4cc7714..07f3c9329e 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -278,7 +278,7 @@ static int core_Translate(lua_State *L) { char *what = (char*)luaL_checkstring(L, 1); - ptrT value(mir_utf8decodeT(what)); + ptrW value(mir_utf8decodeW(what)); lua_pushstring(L, T2Utf(TranslateW_LP(value, hLangpack))); return 1; @@ -288,7 +288,7 @@ static int core_Parse(lua_State *L) { char *what = (char*)luaL_checkstring(L, 1); - ptrT value(mir_utf8decodeT(what)); + ptrW value(mir_utf8decodeW(what)); lua_pushstring(L, T2Utf(VARST(value))); return 1; @@ -299,7 +299,7 @@ static int core_GetFullPath(lua_State *L) wchar_t path[MAX_PATH]; GetModuleFileName(NULL, path, MAX_PATH); - lua_pushstring(L, ptrA(mir_utf8encodeT(path))); + lua_pushstring(L, ptrA(mir_utf8encodeW(path))); return 1; } diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index fab5f86d57..5f5ea774d0 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -103,9 +103,9 @@ static int db_GetContactInfo(lua_State *L) } } - ptrT value(Contact_GetInfo(type, hContact)); + ptrW value(Contact_GetInfo(type, hContact)); if (value) - lua_pushstring(L, ptrA(mir_utf8encodeT(value))); + lua_pushstring(L, ptrA(mir_utf8encodeW(value))); else { lua_pushnil(L); diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 78ed5343d6..e5b33d58a7 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -18,7 +18,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) lua_pop(L, 1); lua_getfield(L, -1, "Name"); - mi.name.w = mir_utf8decodeT(luaL_checkstring(L, -1)); + mi.name.w = mir_utf8decodeW(luaL_checkstring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Position"); @@ -47,7 +47,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) int position = lua_tointeger(L, 3); HANDLE hIcon = (HANDLE)lua_touserdata(L, 4); - HGENMENU res = Menu_CreateRoot(hMenuObject, ptrT(Utf8DecodeT(name)), position, hIcon); + HGENMENU res = Menu_CreateRoot(hMenuObject, ptrW(Utf8DecodeT(name)), position, hIcon); lua_pushlightuserdata(L, res); return 1; @@ -78,7 +78,7 @@ static int genmenu_ModifyMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TLIGHTUSERDATA); HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1); - ptrT name(mir_utf8decodeT(lua_tostring(L, 2))); + ptrW name(mir_utf8decodeW(lua_tostring(L, 2))); HANDLE hIcolibItem = luaL_opt(L, lua_touserdata, 3, INVALID_HANDLE_VALUE); int flags = luaL_optinteger(L, 4, -1); diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp index 4023904fe4..c99ef4290b 100644 --- a/plugins/MirLua/src/m_hotkeys.cpp +++ b/plugins/MirLua/src/m_hotkeys.cpp @@ -16,11 +16,11 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk) lua_pop(L, 1); lua_getfield(L, -1, "Description"); - hk.ptszDescription = mir_utf8decodeT(lua_tostring(L, -1)); + hk.ptszDescription = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Section"); - hk.ptszSection = mir_utf8decodeT(luaL_optstring(L, -1, MODULE)); + hk.ptszSection = mir_utf8decodeW(luaL_optstring(L, -1, MODULE)); lua_pop(L, 1); lua_getfield(L, -1, "Hotkey"); diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 8827cc749c..018931ffb7 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -3,9 +3,9 @@ static int icolib_AddIcon(lua_State *L) { const char *name = luaL_checkstring(L, 1); - ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE))); - ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4))); + ptrW description(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE))); + ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4))); if (filePath == NULL) { diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index b907807929..0a56c791e3 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -3,7 +3,7 @@ static int message_Paste(lua_State *L) { MCONTACT hContact = luaL_checkinteger(L, 1); - ptrT text(mir_utf8decodeT(luaL_checkstring(L, 2))); + ptrW text(mir_utf8decodeW(luaL_checkstring(L, 2))); MessageWindowInputData mwid = { sizeof(MessageWindowInputData) }; mwid.hContact = hContact; @@ -34,12 +34,12 @@ static int message_Send(lua_State *L) const char *szProto = GetContactProto(hContact); if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE) { - ptrT tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID")); + ptrW tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID")); GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE }; GCEVENT gce = { sizeof(gce), &gcd }; gce.bIsMe = TRUE; gce.dwFlags = GCEF_ADDTOLOG; - gce.ptszText = mir_utf8decodeT(message); + gce.ptszText = mir_utf8decodeW(message); gce.time = time(NULL); res = CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce); diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp index d67106d247..6bb25cbe26 100644 --- a/plugins/MirLua/src/m_options.cpp +++ b/plugins/MirLua/src/m_options.cpp @@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) odp.flags |= ODPF_TCHAR; lua_getfield(L, -1, "Group"); - odp.pwszGroup = mir_utf8decodeT(lua_tostring(L, -1)); + odp.pwszGroup = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Title"); - odp.pwszTitle = mir_utf8decodeT(luaL_checkstring(L, -1)); + odp.pwszTitle = mir_utf8decodeW(luaL_checkstring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Tab"); - odp.pwszTab = mir_utf8decodeT(lua_tostring(L, -1)); + odp.pwszTab = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); int onInitDialogRef = LUA_NOREF; diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp index cd31adfe76..0291515ee7 100644 --- a/plugins/MirLua/src/m_sounds.cpp +++ b/plugins/MirLua/src/m_sounds.cpp @@ -3,9 +3,9 @@ static int sounds_AddSound(lua_State *L) { ptrA name(mir_utf8decodeA(luaL_checkstring(L, 1))); - ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE))); - ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4))); + ptrW description(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE))); + ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4))); SKINSOUNDDESCEX ssd = { sizeof(SKINSOUNDDESCEX) }; ssd.pszName = name; @@ -34,7 +34,7 @@ static int sounds_PlaySound(lua_State *L) static int sounds_PlayFile(lua_State *L) { - ptrT filePath(mir_utf8decodeT(luaL_checkstring(L, 1))); + ptrW filePath(mir_utf8decodeW(luaL_checkstring(L, 1))); INT_PTR res = SkinPlaySoundFile(filePath); lua_pushboolean(L, res == 0); diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 5386f364d1..b6c62101a6 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -28,11 +28,11 @@ void CMLua::SetPaths() lua_getglobal(L, "package"); FoldersGetCustomPathT(g_hCLibsFolder, path, _countof(path), VARST(MIRLUA_PATHT)); - lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeT(path))); + lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeW(path))); lua_setfield(L, -2, "cpath"); FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_PATHT)); - lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeT(path))); + lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeW(path))); lua_setfield(L, -2, "path"); lua_pop(L, 1); diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index cc902165d6..524cd427bb 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -62,7 +62,7 @@ void CMLuaOptions::OnInitDialog() wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100]; FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT)); PathToRelativeT(scriptDir, relativeScriptDir, NULL); - mir_sntprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir); + mir_snwprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir); m_scripts.AddColumn(0, L"Script", 380); m_scripts.AddColumn(1, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL)); diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index b84c3d978e..f4cfef8c7c 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -5,17 +5,17 @@ CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path) : L(L), status(None), unloadRef(LUA_NOREF) { - mir_tstrcpy(filePath, path); + mir_wstrcpy(filePath, path); fileName = wcsrchr(filePath, '\\') + 1; wchar_t *dot = wcsrchr(fileName, '.'); - size_t length = mir_tstrlen(fileName) - mir_tstrlen(dot) + 1; + size_t length = mir_wstrlen(fileName) - mir_wstrlen(dot) + 1; - ptrT name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1))); - mir_tstrncpy(name, fileName, length); + ptrW name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1))); + mir_wstrncpy(name, fileName, length); - moduleName = mir_utf8encodeT(name); + moduleName = mir_utf8encodeW(name); MUUID muidLast = MIID_LAST; id = GetPluginLangId(muidLast, 0); diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp index a8efa32320..3a3d88fbc7 100644 --- a/plugins/MirLua/src/mlua_script_loader.cpp +++ b/plugins/MirLua/src/mlua_script_loader.cpp @@ -7,7 +7,7 @@ CMLuaScriptLoader::CMLuaScriptLoader(lua_State *L) : L(L) void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file) { wchar_t fullPath[MAX_PATH], path[MAX_PATH]; - mir_sntprintf(fullPath, L"%s\\%s", scriptDir, file); + mir_snwprintf(fullPath, L"%s\\%s", scriptDir, file); PathToRelativeT(fullPath, path); CMLuaScript *script = new CMLuaScript(L, path); @@ -31,7 +31,7 @@ void CMLuaScriptLoader::LoadScripts() Log(L"Loading scripts from %s", scriptDir); wchar_t searchMask[MAX_PATH]; - mir_sntprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua"); + mir_snwprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua"); WIN32_FIND_DATA fd; HANDLE hFind = FindFirstFile(searchMask, &fd); -- cgit v1.2.3