From e5ec547eb36090bb884378a23743a60e4f9f8bb7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 24 Sep 1996 18:46:44 -0300 Subject: "call" returns separate results, instead of a table. --- inout.c | 17 ++++------------- opcode.c | 30 ++++++++++++------------------ opcode.h | 3 +-- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/inout.c b/inout.c index e0df3359..978e3579 100644 --- a/inout.c +++ b/inout.c @@ -5,7 +5,7 @@ ** Also provides some predefined lua functions. */ -char *rcs_inout="$Id: inout.c,v 2.40 1996/09/11 21:53:02 roberto Exp roberto $"; +char *rcs_inout="$Id: inout.c,v 2.41 1996/09/24 17:30:28 roberto Exp roberto $"; #include #include @@ -281,15 +281,13 @@ void luaI_call (void) temp = lua_getsubscript(); narg = lua_isnumber(temp) ? lua_getnumber(temp) : MAXPARAMS+1; /* read arg[1...n] */ - for (i=0; i=MAXPARAMS) lua_error("argument list too long in function `call'"); lua_pushobject(arg); lua_pushnumber(i+1); params[i] = lua_getsubscript(); - if (narg == MAXPARAMS+1 && lua_isnil(params[i])) - { + if (narg == MAXPARAMS+1 && lua_isnil(params[i])) { narg = i; break; } @@ -298,14 +296,7 @@ void luaI_call (void) for (i=0; i #include @@ -897,41 +897,35 @@ static void comparison (lua_Type tag_less, lua_Type tag_equal, } -void luaI_packarg (Object *firstelem, Object *arg) +static void adjust_varargs (StkId first_extra_arg) { - int nvararg = (firstelem != NULL) ? top-firstelem : 0; + Object arg; + Object *firstelem = stack+first_extra_arg; + int nvararg = top-firstelem; int i; if (nvararg < 0) nvararg = 0; - avalue(arg) = lua_createarray(nvararg+1); /* +1 for field 'n' */ - tag(arg) = LUA_T_ARRAY; - for (i=0; i