mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-08 11:27:28 +08:00
jsonc: use json object new int64
This commit is contained in:
parent
2f1c8833d5
commit
50d5286ab3
@ -311,11 +311,9 @@ static struct json_object * _lua_to_json(lua_State *L, int index)
|
|||||||
|
|
||||||
case LUA_TNUMBER:
|
case LUA_TNUMBER:
|
||||||
nd = lua_tonumber(L, index);
|
nd = lua_tonumber(L, index);
|
||||||
ni = lua_tointeger(L, index);
|
if(nd >= INT64_MIN && nd <= INT64_MAX)
|
||||||
|
return json_object_new_int64(nd);
|
||||||
if (nd == ni)
|
else
|
||||||
return json_object_new_int(nd);
|
|
||||||
|
|
||||||
return json_object_new_double(nd);
|
return json_object_new_double(nd);
|
||||||
|
|
||||||
case LUA_TSTRING:
|
case LUA_TSTRING:
|
||||||
|
Loading…
Reference in New Issue
Block a user