Add casts to lua_Number to allow working with floating point runtimes
This commit is contained in:
parent
22d46ce57c
commit
2d9a997e04
File diff suppressed because it is too large
Load Diff
@ -27,15 +27,15 @@ int os_getversion(lua_State* L)
|
||||
lua_newtable(L);
|
||||
|
||||
lua_pushstring(L, "majorversion");
|
||||
lua_pushnumber(L, info.majorversion);
|
||||
lua_pushnumber(L, (lua_Number)info.majorversion);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_pushstring(L, "minorversion");
|
||||
lua_pushnumber(L, info.minorversion);
|
||||
lua_pushnumber(L, (lua_Number)info.minorversion);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_pushstring(L, "revision");
|
||||
lua_pushnumber(L, info.revision);
|
||||
lua_pushnumber(L, (lua_Number)info.revision);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_pushstring(L, "description");
|
||||
|
@ -39,7 +39,7 @@ int os_stat(lua_State* L)
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_pushstring(L, "size");
|
||||
lua_pushnumber(L, s.st_size);
|
||||
lua_pushnumber(L, (lua_Number)s.st_size);
|
||||
lua_settable(L, -3);
|
||||
|
||||
return 1;
|
||||
|
@ -11,7 +11,7 @@
|
||||
int string_hash(lua_State* L)
|
||||
{
|
||||
const char* str = luaL_checkstring(L, 1);
|
||||
lua_pushnumber(L, do_hash(str, 0));
|
||||
lua_pushnumber(L, (lua_Number)do_hash(str, 0));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user