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/Modules/WinAPI/src/winapi.cpp | 50 +++++++++++----------- .../MirLua/Modules/m_msg_buttonsbar/src/main.cpp | 4 +- plugins/MirLua/Modules/m_popup/src/main.cpp | 8 ++-- plugins/MirLua/Modules/m_variables/src/main.cpp | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) (limited to 'plugins/MirLua/Modules') diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp index 8bb7ec0d8b..40c80555bf 100644 --- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp +++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp @@ -23,9 +23,9 @@ static int lua_MessageBox(lua_State *L) static int lua_ShellExecute(lua_State *L) { - ptrT command(mir_utf8decodeT(lua_tostring(L, 1))); - ptrT file(mir_utf8decodeT(lua_tostring(L, 2))); - ptrT args(mir_utf8decodeT(lua_tostring(L, 3))); + ptrW command(mir_utf8decodeW(lua_tostring(L, 1))); + ptrW file(mir_utf8decodeW(lua_tostring(L, 2))); + ptrW args(mir_utf8decodeW(lua_tostring(L, 3))); int flags = lua_tointeger(L, 4); ::ShellExecute(NULL, command, file, args, NULL, flags); @@ -62,8 +62,8 @@ static int lua_FindIterator(lua_State *L) } } - if (!mir_tstrcmpi(ffd.cFileName, L".") || - !mir_tstrcmpi(ffd.cFileName, L"..") || + if (!mir_wstrcmpi(ffd.cFileName, L".") || + !mir_wstrcmpi(ffd.cFileName, L"..") || (ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) { lua_pushlightuserdata(L, hFind); @@ -98,7 +98,7 @@ static int lua_FindIterator(lua_State *L) static int lua_Find(lua_State *L) { - wchar_t *path = mir_utf8decodeT(luaL_checkstring(L, 1)); + wchar_t *path = mir_utf8decodeW(luaL_checkstring(L, 1)); lua_pushlightuserdata(L, NULL); lua_pushlightuserdata(L, path); @@ -121,9 +121,9 @@ static int lua_GetKeyState(lua_State *L) static int lua_GetIniValue(lua_State *L) { - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1))); - ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1))); + ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3))); if (lua_isinteger(L, 4)) { @@ -135,7 +135,7 @@ static int lua_GetIniValue(lua_State *L) return 1; } - ptrT default(mir_utf8decodeT(lua_tostring(L, 4))); + ptrW default(mir_utf8decodeW(lua_tostring(L, 4))); wchar_t value[MAX_PATH] = { 0 }; if (!::GetPrivateProfileString(section, key, default, value, _countof(value), path)) @@ -143,7 +143,7 @@ static int lua_GetIniValue(lua_State *L) lua_pushvalue(L, 4); } - ptrA res(mir_utf8encodeT(value)); + ptrA res(mir_utf8encodeW(value)); lua_pushstring(L, res); return 1; @@ -151,10 +151,10 @@ static int lua_GetIniValue(lua_State *L) static int lua_SetIniValue(lua_State *L) { - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1))); - ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3))); - ptrT value(mir_utf8decodeT(lua_tostring(L, 4))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1))); + ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3))); + ptrW value(mir_utf8decodeW(lua_tostring(L, 4))); bool res = ::WritePrivateProfileString(section, key, value, path) != 0; lua_pushboolean(L, res); @@ -164,9 +164,9 @@ static int lua_SetIniValue(lua_State *L) static int lua_DeleteIniValue(lua_State *L) { - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 1))); - ptrT section(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT key(mir_utf8decodeT(luaL_checkstring(L, 3))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 1))); + ptrW section(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW key(mir_utf8decodeW(luaL_checkstring(L, 3))); bool res = ::WritePrivateProfileString(section, key, NULL, path) != 0; lua_pushboolean(L, res); @@ -179,8 +179,8 @@ static int lua_DeleteIniValue(lua_State *L) static int lua_GetRegValue(lua_State *L) { HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1); - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3))); HKEY hKey = 0; LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_READ, &hKey); @@ -240,8 +240,8 @@ static int lua_GetRegValue(lua_State *L) static int lua_SetRegValue(lua_State *L) { HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1); - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3))); HKEY hKey = 0; LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_WRITE, &hKey); @@ -275,7 +275,7 @@ static int lua_SetRegValue(lua_State *L) case LUA_TSTRING: type = REG_SZ; length = mir_strlen(lua_tostring(L, 4)) * sizeof(wchar_t); - value = (BYTE*)mir_utf8decodeT(lua_tostring(L, 4)); + value = (BYTE*)mir_utf8decodeW(lua_tostring(L, 4)); break; default: @@ -296,8 +296,8 @@ static int lua_SetRegValue(lua_State *L) static int lua_DeleteRegValue(lua_State *L) { HKEY hRootKey = (HKEY)luaL_checkinteger(L, 1); - ptrT path(mir_utf8decodeT(luaL_checkstring(L, 2))); - ptrT valueName(mir_utf8decodeT(luaL_checkstring(L, 3))); + ptrW path(mir_utf8decodeW(luaL_checkstring(L, 2))); + ptrW valueName(mir_utf8decodeW(luaL_checkstring(L, 3))); HKEY hKey = 0; LSTATUS res = ::RegOpenKeyEx(hRootKey, path, NULL, KEY_WRITE, &hKey); diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp index de2fbdc021..f8f7ce7b7f 100644 --- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp +++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp @@ -22,7 +22,7 @@ static BBButton* MakeBBButton(lua_State *L) bbb->bbbFlags &= ~BBBF_ANSITOOLTIP; lua_getfield(L, -1, "Tooltip"); - bbb->ptszTooltip = mir_utf8decodeT(lua_tostring(L, -1)); + bbb->ptszTooltip = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Icon"); @@ -140,7 +140,7 @@ extern "C" LUAMOD_API int luaopen_m_msg_buttonsbar(lua_State *L) lua_register(L, MT_CUSTOMBUTTONCLICKDATA, bcd_new); luaL_newmetatable(L, MT_CUSTOMBUTTONCLICKDATA); - lua_pushcfunction(L, bcd__index); + lua_pushcfunction(L, bcd__index); lua_setfield(L, -2, "__index"); lua_pop(L, 1); diff --git a/plugins/MirLua/Modules/m_popup/src/main.cpp b/plugins/MirLua/Modules/m_popup/src/main.cpp index 288f03c1ca..c169ba72e6 100644 --- a/plugins/MirLua/Modules/m_popup/src/main.cpp +++ b/plugins/MirLua/Modules/m_popup/src/main.cpp @@ -5,11 +5,11 @@ static POPUPDATAT* MakePopupData(lua_State *L) POPUPDATAT *ppd = (POPUPDATAT*)mir_calloc(sizeof(POPUPDATAT)); lua_getfield(L, -1, "ContactName"); - mir_tstrcpy(ppd->lptzContactName, ptrT(mir_utf8decodeT(lua_tostring(L, -1)))); + mir_wstrcpy(ppd->lptzContactName, ptrW(mir_utf8decodeW(lua_tostring(L, -1)))); lua_pop(L, 1); lua_getfield(L, -1, "Text"); - mir_tstrcpy(ppd->lptzText, ptrT(mir_utf8decodeT(luaL_checkstring(L, -1)))); + mir_wstrcpy(ppd->lptzText, ptrW(mir_utf8decodeW(luaL_checkstring(L, -1)))); lua_pop(L, 1); lua_getfield(L, -1, "hContact"); @@ -60,11 +60,11 @@ static POPUPDATA2* MakePopupData2(lua_State *L) ppd->flags |= PU2_TCHAR; lua_getfield(L, -1, "Title"); - ppd->lptzTitle = mir_utf8decodeT(lua_tostring(L, -1)); + ppd->lptzTitle = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Text"); - ppd->lptzText = mir_utf8decodeT(luaL_checkstring(L, -1)); + ppd->lptzText = mir_utf8decodeW(luaL_checkstring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "hContact"); diff --git a/plugins/MirLua/Modules/m_variables/src/main.cpp b/plugins/MirLua/Modules/m_variables/src/main.cpp index 308325e202..a9c5204f96 100644 --- a/plugins/MirLua/Modules/m_variables/src/main.cpp +++ b/plugins/MirLua/Modules/m_variables/src/main.cpp @@ -8,7 +8,7 @@ static int lua_Parse(lua_State *L) return 1; } - ptrT format(mir_utf8decodeT(luaL_checkstring(L, 1))); + ptrW format(mir_utf8decodeW(luaL_checkstring(L, 1))); MCONTACT hContact = lua_tointeger(L, 2); wchar_t *res = variables_parse_ex(format, NULL, hContact, NULL, 0); -- cgit v1.2.3