diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-08 20:39:36 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-08 20:39:36 -0200 |
commit | 87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1 (patch) | |
tree | f887a310dfb777403129a9520af3560fe3b85804 /lapi.c | |
parent | cb50fcf42d9ab2d04f6f28a30a0ca5cc6e58054c (diff) | |
download | lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.gz lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.tar.bz2 lua-87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1.zip |
no more `lua_istrue' function
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -185,12 +185,6 @@ LUA_API int lua_isnumber (lua_State *L, int index) { | |||
185 | } | 185 | } |
186 | 186 | ||
187 | 187 | ||
188 | LUA_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 | |||
194 | LUA_API int lua_isstring (lua_State *L, int index) { | 188 | LUA_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 | ||
232 | LUA_API int lua_toboolean (lua_State *L, int index) { | 226 | LUA_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 | ||