Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Lua5.3] Changed lua_tonumber to lua_tointeger where necessary
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 10 Jun 2015 14:05:56 +0000 (16:05 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 15 Oct 2015 17:17:18 +0000 (19:17 +0200)
src/bindings/lua/lua_host.c
src/bindings/lua/simgrid_lua.c

index b9d01a9..cef6cf8 100644 (file)
@@ -90,7 +90,7 @@ static int l_host_get_name(lua_State * L)
 static int l_host_number(lua_State * L)
 {
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
-  lua_pushnumber(L, xbt_dynar_length(hosts));
+  lua_pushinteger(L, xbt_dynar_length(hosts));
   xbt_dynar_free(&hosts);
   return 1;
 }
@@ -169,7 +169,7 @@ static int l_host_get_property_value(lua_State * L)
  */
 static int l_host_sleep(lua_State *L)
 {
-  int time = luaL_checknumber(L, 1);
+  int time = luaL_checkinteger(L, 1);
   MSG_process_sleep(time);
   return 0;
 }
index 97d9e96..587bca3 100644 (file)
@@ -354,7 +354,7 @@ static int run_lua_code(int argc, char **argv)
   /* retrieve result */
   int res = 1;
   if (lua_isnumber(L, -1)) {
-    res = lua_tonumber(L, -1);
+    res = lua_tointeger(L, -1);
     lua_pop(L, 1);              /* pop returned value */
   }