Skip to content

Commit

Permalink
lua_Integer maybe a 64bit integer
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Aug 10, 2013
1 parent a9b80a0 commit a897d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lualib-src/lua-seri.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ wb_table_hash(lua_State *L, struct write_block * wb, int index, int depth, int a
while (lua_next(L, index) != 0) {
if (lua_type(L,-2) == LUA_TNUMBER) {
lua_Number k = lua_tonumber(L,-2);
lua_Integer x = lua_tointeger(L,-2);
int32_t x = (int32_t)lua_tointeger(L,-2);
if (k == (lua_Number)x && x>0 && x<=array_size) {
lua_pop(L,1);
continue;
Expand Down Expand Up @@ -335,7 +335,7 @@ _pack_one(lua_State *L, struct write_block *b, int index, int depth) {
wb_nil(b);
break;
case LUA_TNUMBER: {
lua_Integer x = lua_tointeger(L,index);
int32_t x = (int32_t)lua_tointeger(L,index);
lua_Number n = lua_tonumber(L,index);
if ((lua_Number)x==n) {
wb_integer(b, x, TYPE_NUMBER);
Expand Down

0 comments on commit a897d87

Please sign in to comment.