aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-08 20:39:36 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-08 20:39:36 -0200
commit87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1 (patch)
treef887a310dfb777403129a9520af3560fe3b85804 /lapi.c
parentcb50fcf42d9ab2d04f6f28a30a0ca5cc6e58054c (diff)
downloadlua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.gz
lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.bz2
lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.zip
no more `lua_istrue' function
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lapi.c b/lapi.c
index d39afe86..bed22426 100644
--- a/lapi.c
+++ b/lapi.c
@@ -185,12 +185,6 @@ LUA_API int lua_isnumber (lua_State *L, int index) {
185} 185}
186 186
187 187
188LUA_API int lua_istrue (lua_State *L, int index) {
189 TObject *o = luaA_indexAcceptable(L, index);
190 return (o != NULL && !l_isfalse(o));
191}
192
193
194LUA_API int lua_isstring (lua_State *L, int index) { 188LUA_API int lua_isstring (lua_State *L, int index) {
195 int t = lua_type(L, index); 189 int t = lua_type(L, index);
196 return (t == LUA_TSTRING || t == LUA_TNUMBER); 190 return (t == LUA_TSTRING || t == LUA_TNUMBER);
@@ -231,10 +225,7 @@ LUA_API lua_Number lua_tonumber (lua_State *L, int index) {
231 225
232LUA_API int lua_toboolean (lua_State *L, int index) { 226LUA_API int lua_toboolean (lua_State *L, int index) {
233 const TObject *o = luaA_indexAcceptable(L, index); 227 const TObject *o = luaA_indexAcceptable(L, index);
234 if (o != NULL && (ttype(o) == LUA_TBOOLEAN)) 228 return (o != NULL) && !l_isfalse(o);
235 return bvalue(o);
236 else
237 return -1;
238} 229}
239 230
240 231