mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
no more `lua_istrue' function
This commit is contained in:
parent
cb50fcf42d
commit
87b0e3d477
4 changed files with 10 additions and 16 deletions
11
lapi.c
11
lapi.c
|
|
@ -185,12 +185,6 @@ LUA_API int lua_isnumber (lua_State *L, int index) {
|
|||
}
|
||||
|
||||
|
||||
LUA_API int lua_istrue (lua_State *L, int index) {
|
||||
TObject *o = luaA_indexAcceptable(L, index);
|
||||
return (o != NULL && !l_isfalse(o));
|
||||
}
|
||||
|
||||
|
||||
LUA_API int lua_isstring (lua_State *L, int index) {
|
||||
int t = lua_type(L, index);
|
||||
return (t == LUA_TSTRING || t == LUA_TNUMBER);
|
||||
|
|
@ -231,10 +225,7 @@ LUA_API lua_Number lua_tonumber (lua_State *L, int index) {
|
|||
|
||||
LUA_API int lua_toboolean (lua_State *L, int index) {
|
||||
const TObject *o = luaA_indexAcceptable(L, index);
|
||||
if (o != NULL && (ttype(o) == LUA_TBOOLEAN))
|
||||
return bvalue(o);
|
||||
else
|
||||
return -1;
|
||||
return (o != NULL) && !l_isfalse(o);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue