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