From 6774782e558b4a6495e054a767bb27e7350ca582 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 10 Jun 2015 16:05:56 +0200 Subject: [PATCH] [Lua5.3] Changed lua_tonumber to lua_tointeger where necessary --- src/bindings/lua/lua_host.c | 4 ++-- src/bindings/lua/simgrid_lua.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 */ } -- 2.20.1