From c62a25efbcdfed5268eb4716e64ceefeb91202b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ke=C3=9Fler?= Date: Fri, 25 Sep 2020 03:00:52 +0200 Subject: [PATCH] fixed some undefined behaviour and removed dead code. --- src/plugin/luapi_application.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugin/luapi_application.h b/src/plugin/luapi_application.h index 4ad454cc..bba31c05 100644 --- a/src/plugin/luapi_application.h +++ b/src/plugin/luapi_application.h @@ -127,12 +127,9 @@ static int applib_registerUi(lua_State* L) { accelerator = ""; } - int menuId = -1; int toolbarId = -1; - if (menu) { - menuId = plugin->registerMenu(menu, callback, accelerator); - } + int menuId = plugin->registerMenu(menu, callback, accelerator); // Make sure to remove all vars which are put to the stack before! lua_pop(L, 3); @@ -207,7 +204,7 @@ static int applib_uiAction(lua_State* L) { static int applib_uiActionSelected(lua_State* L) { Plugin* plugin = Plugin::getPluginFromLua(L); - ActionGroup group = group = ActionGroup_fromString(luaL_checkstring(L, 1)); + ActionGroup group = ActionGroup_fromString(luaL_checkstring(L, 1)); ActionType action = ActionType_fromString(luaL_checkstring(L, 2)); Control* ctrl = plugin->getControl();