rename of `kproto' to `p'

This commit is contained in:
Roberto Ierusalimschy 2001-06-28 11:57:17 -03:00
parent b346834a09
commit 770954510f
7 changed files with 24 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: ldebug.c,v 1.83 2001/06/15 20:36:57 roberto Exp roberto $
** $Id: ldebug.c,v 1.84 2001/06/26 13:20:45 roberto Exp roberto $
** Debug Interface
** See Copyright Notice in lua.h
*/
@ -450,8 +450,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
break;
}
case OP_CLOSURE: {
check(b < pt->sizekproto);
checkreg(pt, a + pt->kproto[b]->nupvalues - 1);
check(b < pt->sizep);
checkreg(pt, a + pt->p[b]->nupvalues - 1);
break;
}
default: break;

View File

@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 1.43 2001/03/26 14:31:49 roberto Exp roberto $
** $Id: lfunc.c,v 1.44 2001/06/05 18:17:01 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@ -32,8 +32,8 @@ Proto *luaF_newproto (lua_State *L) {
Proto *f = luaM_new(L, Proto);
f->k = NULL;
f->sizek = 0;
f->kproto = NULL;
f->sizekproto = 0;
f->p = NULL;
f->sizep = 0;
f->code = NULL;
f->sizecode = 0;
f->nupvalues = 0;
@ -57,7 +57,7 @@ void luaF_freeproto (lua_State *L, Proto *f) {
luaM_freearray(L, f->code, f->sizecode, Instruction);
luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);
luaM_freearray(L, f->k, f->sizek, TObject);
luaM_freearray(L, f->kproto, f->sizekproto, Proto *);
luaM_freearray(L, f->p, f->sizep, Proto *);
luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);
luaM_freelem(L, f, Proto);
}

6
lgc.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 1.107 2001/06/21 16:41:34 roberto Exp roberto $
** $Id: lgc.c,v 1.108 2001/06/26 13:20:45 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@ -40,8 +40,8 @@ static void protomark (Proto *f) {
if (ttype(f->k+i) == LUA_TSTRING)
strmark(tsvalue(f->k+i));
}
for (i=0; i<f->sizekproto; i++)
protomark(f->kproto[i]);
for (i=0; i<f->sizep; i++)
protomark(f->p[i]);
for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */
strmark(f->locvars[i].varname);
}

View File

@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 1.107 2001/06/26 13:20:45 roberto Exp roberto $
** $Id: lobject.h,v 1.108 2001/06/28 14:48:44 roberto Exp roberto $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@ -124,8 +124,8 @@ typedef union Udata {
typedef struct Proto {
TObject *k; /* constants used by the function */
int sizek; /* size of `k' */
struct Proto **kproto; /* functions defined inside the function */
int sizekproto; /* size of `kproto' */
struct Proto **p; /* functions defined inside the function */
int sizep; /* size of `p' */
Instruction *code;
int sizecode;
short nupvalues;

View File

@ -1,5 +1,5 @@
/*
** $Id: lparser.c,v 1.149 2001/06/12 14:36:48 roberto Exp roberto $
** $Id: lparser.c,v 1.150 2001/06/20 21:07:57 roberto Exp roberto $
** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h
*/
@ -296,13 +296,13 @@ static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
int reg = fs->freereg;
for (i=0; i<func->f->nupvalues; i++)
luaK_exp2nextreg(fs, &func->upvalues[i]);
luaM_growvector(ls->L, f->kproto, fs->nkproto, f->sizekproto, Proto *,
luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
MAXARG_Bc, l_s("constant table overflow"));
f->kproto[fs->nkproto++] = func->f;
f->p[fs->np++] = func->f;
fs->freereg = reg; /* CLOSURE will consume those values */
init_exp(v, VNONRELOC, reg);
luaK_reserveregs(fs, 1);
luaK_codeABc(fs, OP_CLOSURE, v->u.i.info, fs->nkproto-1);
luaK_codeABc(fs, OP_CLOSURE, v->u.i.info, fs->np-1);
}
@ -318,7 +318,7 @@ static void open_func (LexState *ls, FuncState *fs) {
fs->jlt = NO_JUMP;
fs->freereg = 0;
fs->nk = 0;
fs->nkproto = 0;
fs->np = 0;
fs->nlineinfo = 0;
fs->nlocvars = 0;
fs->nactloc = 0;
@ -343,8 +343,8 @@ static void close_func (LexState *ls) {
f->sizecode = fs->pc;
luaM_reallocvector(L, f->k, f->sizek, fs->nk, TObject);
f->sizek = fs->nk;
luaM_reallocvector(L, f->kproto, f->sizekproto, fs->nkproto, Proto *);
f->sizekproto = fs->nkproto;
luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
f->sizep = fs->np;
luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
f->sizelocvars = fs->nlocvars;
luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->nlineinfo+1, int);

View File

@ -1,5 +1,5 @@
/*
** $Id: lparser.h,v 1.30 2001/02/20 18:28:11 roberto Exp roberto $
** $Id: lparser.h,v 1.31 2001/06/05 18:17:01 roberto Exp roberto $
** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h
*/
@ -53,7 +53,7 @@ typedef struct FuncState {
int jlt; /* list of jumps to `lasttarget' */
int freereg; /* first free register */
int nk; /* number of elements in `k' */
int nkproto; /* number of elements in `kproto' */
int np; /* number of elements in `p' */
int nlineinfo; /* number of elements in `lineinfo' */
int nlocvars; /* number of elements in `locvars' */
int nactloc; /* number of active local variables */

4
lvm.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 1.188 2001/06/26 13:20:45 roberto Exp roberto $
** $Id: lvm.c,v 1.189 2001/06/28 14:48:44 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@ -644,7 +644,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
break;
}
case OP_CLOSURE: {
Proto *p = tf->kproto[GETARG_Bc(i)];
Proto *p = tf->p[GETARG_Bc(i)];
int nup = p->nupvalues;
luaV_checkGC(L, ra+nup);
L->top = ra+nup;