summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-07-12 12:57:37 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-07-12 12:57:37 +0000
commit9677b394a0977382ed4a406de039ef370cfd29a2 (patch)
treef5585e9ca4e6a755308680100e46f3aa5f6ffce4 /plugins/MirLua/src/mlua_utils.cpp
parenta36fb8e8cdc86ef569c4e75eebabbf341f801ffb (diff)
MirLua:
- lua_Utf8DecodeA SHOULD return pointer - added OnContactSettingChanged to m_database - extended lua print logging git-svn-id: http://svn.miranda-ng.org/main/trunk@14541 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_utils.cpp')
-rw-r--r--plugins/MirLua/src/mlua_utils.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp
index 3a58867171..7fa59212c5 100644
--- a/plugins/MirLua/src/mlua_utils.cpp
+++ b/plugins/MirLua/src/mlua_utils.cpp
@@ -5,7 +5,25 @@ int luaM_print(lua_State *L)
CMStringA data;
int nargs = lua_gettop(L);
for (int i = 1; i <= nargs; ++i)
- data.AppendFormat("%s ", lua_tostring(L, i));
+ {
+ switch (lua_type(L, i))
+ {
+ case LUA_TNIL:
+ data.AppendFormat("%s ", "nil");
+ break;
+ case LUA_TBOOLEAN:
+ case LUA_TNUMBER:
+ case LUA_TSTRING:
+ data.AppendFormat("%s ", lua_tostring(L, i));
+ break;
+ case LUA_TTABLE:
+ data.AppendFormat("%s ", "table");
+ break;
+ default:
+ data.AppendFormat("0x%p ", lua_topointer(L, i));
+ break;
+ }
+ }
data.Delete(data.GetLength() - 3, 3);
CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)data.GetBuffer());