diff options
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 | ||