diff options
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/src/Modules/m_database.cpp | 8 | ||||
-rw-r--r-- | plugins/MirLua/src/utils.cpp | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/plugins/MirLua/src/Modules/m_database.cpp b/plugins/MirLua/src/Modules/m_database.cpp index 3b82fbc9da..21b87c0274 100644 --- a/plugins/MirLua/src/Modules/m_database.cpp +++ b/plugins/MirLua/src/Modules/m_database.cpp @@ -19,17 +19,15 @@ void luaM_pushdbvt(lua_State *L, const DBVARIANT &value) lua_pushstring(L, value.pszVal); break; case DBVT_WCHAR: - lua_pushstring(L, ptrA(mir_utf8encodeW(value.pwszVal))); + lua_pushstring(L, T2Utf(value.pwszVal)); break; case DBVT_BLOB: - { lua_createtable(L, value.cpbVal, 0); for (int i = 0; i < value.cpbVal; i++) { lua_pushinteger(L, value.pbVal[i]); lua_rawseti(L, -2, i + 1); } - } - break; + break; default: lua_pushnil(L); } @@ -545,8 +543,8 @@ static int db_WriteSetting(lua_State *L) dbv.pbVal[i] = lua_tointeger(L, -1); lua_pop(L, 1); } - } break; + } default: lua_pushboolean(L, false); return 1; diff --git a/plugins/MirLua/src/utils.cpp b/plugins/MirLua/src/utils.cpp index c0c74a76fa..cc75303af7 100644 --- a/plugins/MirLua/src/utils.cpp +++ b/plugins/MirLua/src/utils.cpp @@ -75,15 +75,13 @@ int luaM_getenv(lua_State *L) lua_Debug ar; if (lua_getstack(L, 1, &ar) == 0 || lua_getinfo(L, "f", &ar) == 0 || - lua_iscfunction(L, -1)) - { + lua_iscfunction(L, -1)) { lua_pop(L, 1); return 0; } const char *env = lua_getupvalue(L, -1, 1); - if (!env || strcmp(env, "_ENV") != 0) - { + if (!env || strcmp(env, "_ENV") != 0) { lua_pop(L, 1); return 0; } |