diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-01 12:58:04 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-01 12:58:04 +0000 |
commit | 014e23323d6dc79605da8ebad1c357176ede9122 (patch) | |
tree | 783042c8aba1d71645028720bac8f8f70eca3b54 /plugins/MirLua/src/mlua_metatable.h | |
parent | e1b171840899382e773c89b21e0510e9eddd95b0 (diff) |
MirLua: Code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_metatable.h')
-rw-r--r-- | plugins/MirLua/src/mlua_metatable.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index 372f8684a3..ec5ee58451 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -111,7 +111,7 @@ private: lua_pushstring(L, ptrA(mir_utf8encode(field->GetValue<char*>(obj))));
break;
case LUA_TSTRINGW:
- lua_pushstring(L, ptrA(mir_utf8encodeW(field->GetValue<wchar_t*>(obj))));
+ lua_pushstring(L, T2Utf(field->GetValue<wchar_t*>(obj)));
break;
case LUA_TLIGHTUSERDATA:
lua_pushlightuserdata(L, field->GetValue<void*>(obj));
@@ -150,7 +150,7 @@ public: template<typename R>
MT& Field(R T::*M, const char *name, int type, size_t size = sizeof(R))
{
- size_t offset = reinterpret_cast<size_t>(&(((T*)0)->*M));
+ size_t offset = offsetof(T, *M);
if (type != LUA_TNONE)
fields[name] = new MTField<T>(offset, size, type);
return *this;
|