mirror of https://github.com/rusefi/lua.git
details (avoid 'case' inside block + avoid using one variable for
two roles)
This commit is contained in:
parent
82129b9266
commit
3cdf1d676b
10
ldo.c
10
ldo.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ldo.c,v 2.140 2015/09/08 15:41:05 roberto Exp roberto $
|
** $Id: ldo.c,v 2.141 2015/10/21 18:40:47 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -321,14 +321,14 @@ static void tryfuncTM (lua_State *L, StkId func) {
|
||||||
int luaD_precall (lua_State *L, StkId func, int nresults) {
|
int luaD_precall (lua_State *L, StkId func, int nresults) {
|
||||||
lua_CFunction f;
|
lua_CFunction f;
|
||||||
CallInfo *ci;
|
CallInfo *ci;
|
||||||
int n; /* number of arguments (Lua) or returns (C) */
|
|
||||||
switch (ttype(func)) {
|
switch (ttype(func)) {
|
||||||
case LUA_TCCL: { /* C closure */
|
case LUA_TCCL: /* C closure */
|
||||||
f = clCvalue(func)->f;
|
f = clCvalue(func)->f;
|
||||||
goto Cfunc;
|
goto Cfunc;
|
||||||
case LUA_TLCF: /* light C function */
|
case LUA_TLCF: /* light C function */
|
||||||
f = fvalue(func);
|
f = fvalue(func);
|
||||||
Cfunc:
|
Cfunc: {
|
||||||
|
int n; /* number of returns */
|
||||||
checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
|
checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
|
||||||
ci = next_ci(L); /* now 'enter' new function */
|
ci = next_ci(L); /* now 'enter' new function */
|
||||||
ci->nresults = nresults;
|
ci->nresults = nresults;
|
||||||
|
@ -348,7 +348,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
|
||||||
case LUA_TLCL: { /* Lua function: prepare its call */
|
case LUA_TLCL: { /* Lua function: prepare its call */
|
||||||
StkId base;
|
StkId base;
|
||||||
Proto *p = clLvalue(func)->p;
|
Proto *p = clLvalue(func)->p;
|
||||||
n = cast_int(L->top - func) - 1; /* number of real arguments */
|
int n = cast_int(L->top - func) - 1; /* number of real arguments */
|
||||||
checkstackp(L, p->maxstacksize, func);
|
checkstackp(L, p->maxstacksize, func);
|
||||||
for (; n < p->numparams; n++)
|
for (; n < p->numparams; n++)
|
||||||
setnilvalue(L->top++); /* complete missing arguments */
|
setnilvalue(L->top++); /* complete missing arguments */
|
||||||
|
|
Loading…
Reference in New Issue