| 344 | |
| 345 | |
| 346 | LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum) { |
| 347 | TValue n; |
| 348 | const TValue *o = index2addr(L, idx); |
| 349 | if (tonumber(o, &n)) { |
| 350 | lua_Integer res; |
| 351 | lua_Number num = nvalue(o); |
| 352 | lua_number2integer(res, num); |
| 353 | if (isnum) *isnum = 1; |
| 354 | return res; |
| 355 | } |
| 356 | else { |
| 357 | if (isnum) *isnum = 0; |
| 358 | return 0; |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | |
| 363 | LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) { |
no test coverage detected