From e54cab5cc5b1c4c36d067fa265a75944570c0ebb Mon Sep 17 00:00:00 2001 From: FourierTransformer Date: Mon, 29 Jul 2024 22:32:59 -0500 Subject: [PATCH] added the brackets to fix --- src/luasimdjson.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/luasimdjson.cpp b/src/luasimdjson.cpp index 30666f9..f75be18 100644 --- a/src/luasimdjson.cpp +++ b/src/luasimdjson.cpp @@ -77,19 +77,21 @@ void convert_ondemand_element_to_table(lua_State *L, ondemand::value element) { break; case fallback::number_type::unsigned_integer: - // a uint64 can be greater than an int64, so we must check how large and pass as a number - // if larger but LUA_MAXINTEGER (which is only defined in 5.3+) - #if defined(LUA_MAXINTEGER) - uint64_t actual_value = element.get_uint64(); - if (actual_value > LUA_MAXINTEGER) { - lua_pushnumber(L, actual_value); - } else { - lua_pushinteger(L, actual_value); + { + // a uint64 can be greater than an int64, so we must check how large and pass as a number + // if larger but LUA_MAXINTEGER (which is only defined in 5.3+) + #if defined(LUA_MAXINTEGER) + uint64_t actual_value = element.get_uint64(); + if (actual_value > LUA_MAXINTEGER) { + lua_pushnumber(L, actual_value); + } else { + lua_pushinteger(L, actual_value); + } + #else + lua_pushnumber(L, element.get_double()); + #endif + break; } - #else - lua_pushnumber(L, element.get_double()); - #endif - break; case fallback::number_type::big_integer: lua_pushnumber(L, element.get_double());