mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CLuaInstance: Fix compiler warnings
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
struct table_key {
|
struct table_key {
|
||||||
const char *name;
|
const char *name;
|
||||||
long code;
|
uint32_t code;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lua_envexport {
|
struct lua_envexport {
|
||||||
@@ -224,20 +224,20 @@ static void set_lua_variables(lua_State *L)
|
|||||||
{ "TOP_RIGHT", CORNER_TOP_RIGHT },
|
{ "TOP_RIGHT", CORNER_TOP_RIGHT },
|
||||||
{ "BOTTOM_LEFT", CORNER_BOTTOM_LEFT },
|
{ "BOTTOM_LEFT", CORNER_BOTTOM_LEFT },
|
||||||
{ "BOTTOM_RIGHT", CORNER_BOTTOM_RIGHT },
|
{ "BOTTOM_RIGHT", CORNER_BOTTOM_RIGHT },
|
||||||
{ "RADIUS_LARGE", RADIUS_LARGE }, /* those depend on g_settings.rounded_corners */
|
{ "RADIUS_LARGE", (uint32_t) RADIUS_LARGE }, /* those depend on g_settings.rounded_corners */
|
||||||
{ "RADIUS_MID", RADIUS_MID },
|
{ "RADIUS_MID", (uint32_t) RADIUS_MID },
|
||||||
{ "RADIUS_SMALL", RADIUS_SMALL },
|
{ "RADIUS_SMALL", (uint32_t) RADIUS_SMALL },
|
||||||
{ "RADIUS_MIN", RADIUS_MIN },
|
{ "RADIUS_MIN", (uint32_t) RADIUS_MIN },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* screen offsets, exported as e.g. SCREEN['END_Y'] */
|
/* screen offsets, exported as e.g. SCREEN['END_Y'] */
|
||||||
table_key screenopts[] =
|
table_key screenopts[] =
|
||||||
{
|
{
|
||||||
{ "OFF_X", g_settings.screen_StartX },
|
{ "OFF_X", (uint32_t) g_settings.screen_StartX },
|
||||||
{ "OFF_Y", g_settings.screen_StartY },
|
{ "OFF_Y", (uint32_t) g_settings.screen_StartY },
|
||||||
{ "END_X", g_settings.screen_EndX },
|
{ "END_X", (uint32_t) g_settings.screen_EndX },
|
||||||
{ "END_Y", g_settings.screen_EndY },
|
{ "END_Y", (uint32_t) g_settings.screen_EndY },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
table_key menureturn[] =
|
table_key menureturn[] =
|
||||||
@@ -696,7 +696,7 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc
|
|||||||
lua_pushstring(L, luaId.c_str());
|
lua_pushstring(L, luaId.c_str());
|
||||||
lua_pushstring(L, optionValue);
|
lua_pushstring(L, optionValue);
|
||||||
lua_pcall(L, 2 /* two args */, 1 /* one result */, 0);
|
lua_pcall(L, 2 /* two args */, 1 /* one result */, 0);
|
||||||
double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0;
|
int res = lua_isnumber(L, -1) ? (int)lua_tonumber(L, -1) : 0;
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 2);
|
||||||
return ((res == menu_return::RETURN_REPAINT) || (res == menu_return::RETURN_EXIT_REPAINT));
|
return ((res == menu_return::RETURN_REPAINT) || (res == menu_return::RETURN_EXIT_REPAINT));
|
||||||
}
|
}
|
||||||
@@ -1275,7 +1275,7 @@ int CLuaInstance::MessageboxExec(lua_State *L)
|
|||||||
|
|
||||||
tmp = "cancel";
|
tmp = "cancel";
|
||||||
for (int i = 0; mbr[i].name; i++)
|
for (int i = 0; mbr[i].name; i++)
|
||||||
if (res == mbr[i].code) {
|
if ((uint32_t)res == mbr[i].code) {
|
||||||
tmp = mbr[i].name;
|
tmp = mbr[i].name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user