no more `lua_istrue' function

This commit is contained in:
Roberto Ierusalimschy
2002-02-08 20:39:36 -02:00
parent cb50fcf42d
commit 87b0e3d477
4 changed files with 10 additions and 16 deletions

11
lapi.c
View File

@@ -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);
}