From: Christian Heinrich Date: Wed, 10 Jun 2015 14:05:56 +0000 (+0200) Subject: [Lua5.3] Changed lua_tonumber to lua_tointeger where necessary X-Git-Tag: v3_13~1644^2~24 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6774782e558b4a6495e054a767bb27e7350ca582?hp=dacd3b823d5c3f477e74114f34673f4834789fda [Lua5.3] Changed lua_tonumber to lua_tointeger where necessary --- diff --git a/src/bindings/lua/lua_host.c b/src/bindings/lua/lua_host.c index b9d01a9a73..cef6cf865c 100644 --- a/src/bindings/lua/lua_host.c +++ b/src/bindings/lua/lua_host.c @@ -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; } diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 97d9e96d2f..587bca3c85 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -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 */ }