MCPcopy Create free account
hub / github.com/danomatika/ofxLua / luaT_adjustvarargs

Function luaT_adjustvarargs

libs/lua/ltm.c:238–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237
238void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci,
239 const Proto *p) {
240 int i;
241 int actual = cast_int(L->top.p - ci->func.p) - 1; /* number of arguments */
242 int nextra = actual - nfixparams; /* number of extra arguments */
243 ci->u.l.nextraargs = nextra;
244 luaD_checkstack(L, p->maxstacksize + 1);
245 /* copy function to the top of the stack */
246 setobjs2s(L, L->top.p++, ci->func.p);
247 /* move fixed parameters to the top of the stack */
248 for (i = 1; i <= nfixparams; i++) {
249 setobjs2s(L, L->top.p++, ci->func.p + i);
250 setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */
251 }
252 ci->func.p += actual + 1;
253 ci->top.p += actual + 1;
254 lua_assert(L->top.p <= ci->top.p && ci->top.p <= L->stack_last.p);
255}
256
257
258void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) {

Callers 1

luaV_executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected