diff options
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.38 1998/12/15 15:21:09 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.40 1998/12/27 20:22:36 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -133,7 +133,7 @@ static void luaB_print (void) { | |||
133 | 133 | ||
134 | 134 | ||
135 | static void luaB_tonumber (void) { | 135 | static void luaB_tonumber (void) { |
136 | int base = luaL_opt_number(2, 10); | 136 | int base = luaL_opt_int(2, 10); |
137 | if (base == 10) { /* standard conversion */ | 137 | if (base == 10) { /* standard conversion */ |
138 | lua_Object o = lua_getparam(1); | 138 | lua_Object o = lua_getparam(1); |
139 | if (lua_isnumber(o)) | 139 | if (lua_isnumber(o)) |
@@ -186,7 +186,7 @@ static void luaB_luatag (void) { | |||
186 | static void luaB_settag (void) { | 186 | static void luaB_settag (void) { |
187 | lua_Object o = luaL_tablearg(1); | 187 | lua_Object o = luaL_tablearg(1); |
188 | lua_pushobject(o); | 188 | lua_pushobject(o); |
189 | lua_settag(luaL_check_number(2)); | 189 | lua_settag(luaL_check_int(2)); |
190 | lua_pushobject(o); /* returns first argument */ | 190 | lua_pushobject(o); /* returns first argument */ |
191 | } | 191 | } |
192 | 192 | ||
@@ -195,8 +195,8 @@ static void luaB_newtag (void) { | |||
195 | } | 195 | } |
196 | 196 | ||
197 | static void luaB_copytagmethods (void) { | 197 | static void luaB_copytagmethods (void) { |
198 | lua_pushnumber(lua_copytagmethods(luaL_check_number(1), | 198 | lua_pushnumber(lua_copytagmethods(luaL_check_int(1), |
199 | luaL_check_number(2))); | 199 | luaL_check_int(2))); |
200 | } | 200 | } |
201 | 201 | ||
202 | static void luaB_rawgettable (void) { | 202 | static void luaB_rawgettable (void) { |
@@ -215,13 +215,11 @@ static void luaB_rawsettable (void) { | |||
215 | static void luaB_settagmethod (void) { | 215 | static void luaB_settagmethod (void) { |
216 | lua_Object nf = luaL_nonnullarg(3); | 216 | lua_Object nf = luaL_nonnullarg(3); |
217 | lua_pushobject(nf); | 217 | lua_pushobject(nf); |
218 | lua_pushobject(lua_settagmethod((int)luaL_check_number(1), | 218 | lua_pushobject(lua_settagmethod(luaL_check_int(1), luaL_check_string(2))); |
219 | luaL_check_string(2))); | ||
220 | } | 219 | } |
221 | 220 | ||
222 | static void luaB_gettagmethod (void) { | 221 | static void luaB_gettagmethod (void) { |
223 | lua_pushobject(lua_gettagmethod((int)luaL_check_number(1), | 222 | lua_pushobject(lua_gettagmethod(luaL_check_int(1), luaL_check_string(2))); |
224 | luaL_check_string(2))); | ||
225 | } | 223 | } |
226 | 224 | ||
227 | static void luaB_seterrormethod (void) { | 225 | static void luaB_seterrormethod (void) { |
@@ -231,7 +229,7 @@ static void luaB_seterrormethod (void) { | |||
231 | } | 229 | } |
232 | 230 | ||
233 | static void luaB_collectgarbage (void) { | 231 | static void luaB_collectgarbage (void) { |
234 | lua_pushnumber(lua_collectgarbage(luaL_opt_number(1, 0))); | 232 | lua_pushnumber(lua_collectgarbage(luaL_opt_int(1, 0))); |
235 | } | 233 | } |
236 | 234 | ||
237 | 235 | ||