| 335 | } |
| 336 | |
| 337 | static uint64_t lpb_checkinteger(lua_State *L, int idx) { |
| 338 | int isint; |
| 339 | uint64_t v = lpb_tointegerx(L, idx, &isint); |
| 340 | if (!isint) { |
| 341 | if (lua_type(L, idx) == LUA_TSTRING) |
| 342 | luaL_error(L, "integer format error: '%s'", lua_tostring(L, idx)); |
| 343 | typeerror(L, idx, "number/string"); |
| 344 | } |
| 345 | return v; |
| 346 | } |
| 347 | |
| 348 | static void lpb_pushinteger(lua_State *L, int64_t n, int u, int mode) { |
| 349 | if (mode != LPB_NUMBER && ((u && n < 0) || n < INT_MIN || n > UINT_MAX)) { |
no test coverage detected