Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[LUA] Fixed compile time warnings
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 21 Jan 2016 00:11:12 +0000 (01:11 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 21 Jan 2016 00:11:33 +0000 (01:11 +0100)
src/bindings/lua/simgrid_lua.c
src/surf/surfxml_parseplatf.c

index b27a2067c02cbdf450ef5b57f4f894bdccc29806..e3ed161ac15b6a3878f8ca28b72959b4d9f264bf 100644 (file)
@@ -89,9 +89,6 @@ static int dump(lua_State* L) {
 
         lua_pushvalue(L, -2); /* table key val key */
 
-        const char *key = lua_tostring(L, -1); /* table key val key */
-        const char *val = lua_tostring(L, -2); /* table key val key */
-
         XBT_DEBUG("%s", sglua_keyvalue_tostring(L, -1, -2));
       }
 
index 9d5964e30a32f2d33fd85ad07b3b723172970ac8..1bfcdf44c716035cf953fa7dcd89670510cf88b5 100644 (file)
@@ -98,17 +98,7 @@ void parse_platform_file(const char *file)
    * written in lua). If not, we will use the (old?) XML parser
    */
   if (is_lua) {
-    // NOTE: After executing the lua_pcall() below,
-    // sglua_get_maestro() will not be NULL, since the
-    // SimGrid module was loaded!
-    // C. Heinrich 01/2016: Not sure if this is still required after I
-    // ripped out most of that bloody Lua simulation stuff. We may
-    // want to check and maybe we can clean that up.
-    lua_State* L;
-
-    if (L == NULL) {
-        L = luaL_newstate();
-    }
+    lua_State* L = luaL_newstate();
     luaL_openlibs(L);
 
     luaL_loadfile(L, file); // This loads the file without executing it.