diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -213,8 +213,7 @@ static int luaB_collectgarbage (lua_State *L) { | |||
213 | return 1; | 213 | return 1; |
214 | } | 214 | } |
215 | case LUA_GCSTEP: { | 215 | case LUA_GCSTEP: { |
216 | int step = (int)luaL_optinteger(L, 2, 0); | 216 | int res = lua_gc(L, o); |
217 | int res = lua_gc(L, o, step); | ||
218 | checkvalres(res); | 217 | checkvalres(res); |
219 | lua_pushboolean(L, res); | 218 | lua_pushboolean(L, res); |
220 | return 1; | 219 | return 1; |
@@ -226,26 +225,10 @@ static int luaB_collectgarbage (lua_State *L) { | |||
226 | return 1; | 225 | return 1; |
227 | } | 226 | } |
228 | case LUA_GCGEN: { | 227 | case LUA_GCGEN: { |
229 | #if defined(LUA_COMPAT_GCPARAMS) | 228 | return pushmode(L, lua_gc(L, o)); |
230 | int minormul = (int)luaL_optinteger(L, 2, -1); | ||
231 | int majorminor = (int)luaL_optinteger(L, 3, -1); | ||
232 | #else | ||
233 | int minormul = 0; | ||
234 | int majorminor = 0; | ||
235 | #endif | ||
236 | return pushmode(L, lua_gc(L, o, minormul, majorminor)); | ||
237 | } | 229 | } |
238 | case LUA_GCINC: { | 230 | case LUA_GCINC: { |
239 | #if defined(LUA_COMPAT_GCPARAMS) | 231 | return pushmode(L, lua_gc(L, o)); |
240 | int pause = (int)luaL_optinteger(L, 2, -1); | ||
241 | int stepmul = (int)luaL_optinteger(L, 3, -1); | ||
242 | int stepsize = (int)luaL_optinteger(L, 4, -1); | ||
243 | #else | ||
244 | int pause = 0; | ||
245 | int stepmul = 0; | ||
246 | int stepsize = 0; | ||
247 | #endif | ||
248 | return pushmode(L, lua_gc(L, o, pause, stepmul, stepsize)); | ||
249 | } | 232 | } |
250 | case LUA_GCSETPARAM: { | 233 | case LUA_GCSETPARAM: { |
251 | static const char *const params[] = { | 234 | static const char *const params[] = { |