Add casts to lua_Number to allow working with floating point runtimes

This commit is contained in:
Jason Perkins 2014-08-10 15:53:25 -04:00
parent 22d46ce57c
commit 2d9a997e04
4 changed files with 665 additions and 657 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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");

View File

@ -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;

View File

@ -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;
}