diff options
Diffstat (limited to 'Sluift/Lua/LuaUtils.cpp')
| -rw-r--r-- | Sluift/Lua/LuaUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Sluift/Lua/LuaUtils.cpp b/Sluift/Lua/LuaUtils.cpp index dbadaab..9ea5cba 100644 --- a/Sluift/Lua/LuaUtils.cpp +++ b/Sluift/Lua/LuaUtils.cpp @@ -159,41 +159,41 @@ void Swift::Lua::registerHelp(lua_State* L, int index, const std::string& descri lua_pop(L, 1); } void Swift::Lua::registerClassHelp(lua_State* L, const std::string& name, const std::string& description) { lua_rawgeti(L, LUA_REGISTRYINDEX, Sluift::globals.coreLibIndex); lua_getfield(L, -1, "register_class_help"); lua_pushstring(L, name.c_str()); lua_newtable(L); lua_pushstring(L, description.c_str()); lua_rawseti(L, -2, 1); if (lua_pcall(L, 2, 0, 0) != 0) { throw Lua::Exception(lua_tostring(L, -1)); } lua_pop(L, 1); } void Swift::Lua::registerExtraHelp(lua_State* L, int index, const std::string& name) { index = Lua::absoluteOffset(L, index); lua_rawgeti(L, LUA_REGISTRYINDEX, Sluift::globals.coreLibIndex); lua_getfield(L, -1, "extra_help"); lua_getfield(L, -1, name.c_str()); if (!lua_isnil(L, -1)) { lua_getfield(L, -3, "register_help"); lua_pushvalue(L, index); lua_pushvalue(L, -3); if (lua_pcall(L, 2, 0, 0) != 0) { throw Lua::Exception(lua_tostring(L, -1)); } } lua_pop(L, 3); } void Swift::Lua::pushStringArray(lua_State* L, const std::vector<std::string>& strings) { - lua_createtable(L, strings.size(), 0); + lua_createtable(L, boost::numeric_cast<int>(strings.size()), 0); for (size_t i = 0; i < strings.size(); ++i) { lua_pushstring(L, strings[i].c_str()); lua_rawseti(L, -2, boost::numeric_cast<int>(i+1)); } } |
Swift