Lua 5.3 has a built in 64-bit integer type */
| 353 | |
| 354 | /* Lua 5.3 has a built in 64-bit integer type */ |
| 355 | void mp_encode_lua_integer(lua_State *L, mp_buf *buf) { |
| 356 | #if (LUA_VERSION_NUM < 503) && BITS_32 |
| 357 | lua_Number i = lua_tonumber(L,-1); |
| 358 | #else |
| 359 | lua_Integer i = lua_tointeger(L,-1); |
| 360 | #endif |
| 361 | mp_encode_int(L, buf, (int64_t)i); |
| 362 | } |
| 363 | |
| 364 | /* Lua 5.2 and lower only has 64-bit doubles, so we need to |
| 365 | * detect if the double may be representable as an int |
no test coverage detected