| 364 | |
| 365 | |
| 366 | LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) { |
| 367 | TValue n; |
| 368 | const TValue *o = index2addr(L, idx); |
| 369 | if (tonumber(o, &n)) { |
| 370 | lua_Unsigned res; |
| 371 | lua_Number num = nvalue(o); |
| 372 | lua_number2unsigned(res, num); |
| 373 | if (isnum) *isnum = 1; |
| 374 | return res; |
| 375 | } |
| 376 | else { |
| 377 | if (isnum) *isnum = 0; |
| 378 | return 0; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | |
| 383 | LUA_API int lua_toboolean (lua_State *L, int idx) { |
no test coverage detected