diff options
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp | 10 | ||||
-rw-r--r-- | plugins/MirLua/Modules/m_msg_buttonsbar/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/mlua_utils.cpp | 12 |
3 files changed, 9 insertions, 15 deletions
diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp index 00ba7a7419..a52338d9ad 100644 --- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp +++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp @@ -131,20 +131,10 @@ static int bcd__index(lua_State *L) return 1;
}
-static int bcd_topointer(lua_State *L)
-{
- CustomButtonClickData *bcd = *(CustomButtonClickData**)luaL_checkudata(L, 1, MT_CUSTOMBUTTONCLICKDATA);
-
- lua_pushlightuserdata(L, bcd);
-
- return 1;
-}
-
static luaL_Reg bcdMeta[] =
{
{ "__call", bcd__call },
{ "__index", bcd__index },
- { "topointer", bcd_topointer },
{ NULL, NULL }
};
diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/stdafx.h b/plugins/MirLua/Modules/m_msg_buttonsbar/src/stdafx.h index 600f0d955a..89ca58c4fd 100644 --- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/stdafx.h +++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/stdafx.h @@ -3,7 +3,7 @@ #include <windows.h>
-#include <m_lua.h>
+#include <lua.hpp>
#include <m_core.h>
#include <m_utils.h>
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index 8b303f0188..8a69605b32 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -162,6 +162,10 @@ int luaM_totable(lua_State *L) {
const char *tname = luaL_checkstring(L, 2);
+ char message[256];
+ mir_snprintf(message, "Use %s(...) instead", tname);
+ ObsoleteMethod(L, message);
+
luaL_getmetatable(L, tname);
lua_getfield(L, -1, "__call");
lua_pushvalue(L, 1);
@@ -179,12 +183,12 @@ int luaM_ptr2number(lua_State *L) void ObsoleteMethod(lua_State *L, const char *message)
{
- lua_Debug info;
- lua_getstack(L, 0, &info);
- lua_getinfo(L, "n", &info);
+ lua_Debug ar;
+ if (lua_getstack(L, 0, &ar) == 0 || lua_getinfo(L, "n", &ar) == 0) + return;
char text[512];
- mir_snprintf(text, "%s is obsolete. %s", info.name, message);
+ mir_snprintf(text, "%s is obsolete. %s", ar.name, message);
Log(text);
if (db_get_b(NULL, MODULE, "PopupOnObsolete", 0))
ShowNotification(MODULE, text, MB_OK | MB_ICONWARNING, NULL);
|