From c78940f21a956064ac79f715af072e283538f35c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 3 Dec 2004 18:50:25 -0200 Subject: static names do not need `luaX_' prefix --- lapi.c | 82 +++++++++++++++++++++++++++++++-------------------------------- lcode.c | 50 +++++++++++++++++++------------------- ldebug.c | 8 +++---- ldo.c | 6 ++--- lparser.c | 8 +++---- ltable.c | 6 ++--- lvm.c | 12 +++++----- 7 files changed, 86 insertions(+), 86 deletions(-) diff --git a/lapi.c b/lapi.c index 5e57f61c..a4cb91aa 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.19 2004/09/15 20:39:42 roberto Exp roberto $ +** $Id: lapi.c,v 2.20 2004/11/24 18:55:56 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -45,7 +45,7 @@ const char lua_ident[] = -static TValue *luaA_index (lua_State *L, int idx) { +static TValue *index2adr (lua_State *L, int idx) { if (idx > 0) { TValue *o = L->base + (idx - 1); api_check(L, idx <= L->ci->top - L->base); @@ -160,7 +160,7 @@ LUA_API void lua_settop (lua_State *L, int idx) { LUA_API void lua_remove (lua_State *L, int idx) { StkId p; lua_lock(L); - p = luaA_index(L, idx); + p = index2adr(L, idx); api_checkvalidindex(L, p); while (++p < L->top) setobjs2s(L, p-1, p); L->top--; @@ -172,7 +172,7 @@ LUA_API void lua_insert (lua_State *L, int idx) { StkId p; StkId q; lua_lock(L); - p = luaA_index(L, idx); + p = index2adr(L, idx); api_checkvalidindex(L, p); for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); setobjs2s(L, p, L->top); @@ -184,7 +184,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { StkId o; lua_lock(L); api_checknelems(L, 1); - o = luaA_index(L, idx); + o = index2adr(L, idx); api_checkvalidindex(L, o); setobj(L, o, L->top - 1); if (idx < LUA_GLOBALSINDEX) /* function upvalue? */ @@ -196,7 +196,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { LUA_API void lua_pushvalue (lua_State *L, int idx) { lua_lock(L); - setobj2s(L, L->top, luaA_index(L, idx)); + setobj2s(L, L->top, index2adr(L, idx)); api_incr_top(L); lua_unlock(L); } @@ -209,7 +209,7 @@ LUA_API void lua_pushvalue (lua_State *L, int idx) { LUA_API int lua_type (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); return (o == &luaO_nilobject) ? LUA_TNONE : ttype(o); } @@ -221,14 +221,14 @@ LUA_API const char *lua_typename (lua_State *L, int t) { LUA_API int lua_iscfunction (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); return iscfunction(o); } LUA_API int lua_isnumber (lua_State *L, int idx) { TValue n; - const TValue *o = luaA_index(L, idx); + const TValue *o = index2adr(L, idx); return tonumber(o, &n); } @@ -240,14 +240,14 @@ LUA_API int lua_isstring (lua_State *L, int idx) { LUA_API int lua_isuserdata (lua_State *L, int idx) { - const TValue *o = luaA_index(L, idx); + const TValue *o = index2adr(L, idx); return (ttisuserdata(o) || ttislightuserdata(o)); } LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { - StkId o1 = luaA_index(L, index1); - StkId o2 = luaA_index(L, index2); + StkId o1 = index2adr(L, index1); + StkId o2 = index2adr(L, index2); return (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0 : luaO_rawequalObj(o1, o2); } @@ -257,8 +257,8 @@ LUA_API int lua_equal (lua_State *L, int index1, int index2) { StkId o1, o2; int i; lua_lock(L); /* may call tag method */ - o1 = luaA_index(L, index1); - o2 = luaA_index(L, index2); + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); i = (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0 : equalobj(L, o1, o2); lua_unlock(L); @@ -270,8 +270,8 @@ LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { StkId o1, o2; int i; lua_lock(L); /* may call tag method */ - o1 = luaA_index(L, index1); - o2 = luaA_index(L, index2); + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); i = (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0 : luaV_lessthan(L, o1, o2); lua_unlock(L); @@ -282,7 +282,7 @@ LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { TValue n; - const TValue *o = luaA_index(L, idx); + const TValue *o = index2adr(L, idx); if (tonumber(o, &n)) return nvalue(o); else @@ -292,7 +292,7 @@ LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { TValue n; - const TValue *o = luaA_index(L, idx); + const TValue *o = index2adr(L, idx); if (tonumber(o, &n)) { lua_Integer res; lua_number2integer(res, nvalue(o)); @@ -304,13 +304,13 @@ LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { LUA_API int lua_toboolean (lua_State *L, int idx) { - const TValue *o = luaA_index(L, idx); + const TValue *o = index2adr(L, idx); return !l_isfalse(o); } LUA_API const char *lua_tostring (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); if (ttisstring(o)) return svalue(o); else { @@ -325,7 +325,7 @@ LUA_API const char *lua_tostring (lua_State *L, int idx) { LUA_API size_t lua_objsize (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); if (ttisstring(o)) return tsvalue(o)->len; else if (ttisuserdata(o)) @@ -341,13 +341,13 @@ LUA_API size_t lua_objsize (lua_State *L, int idx) { LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); return (!iscfunction(o)) ? NULL : clvalue(o)->c.f; } LUA_API void *lua_touserdata (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); switch (ttype(o)) { case LUA_TUSERDATA: return (rawuvalue(o) + 1); case LUA_TLIGHTUSERDATA: return pvalue(o); @@ -357,13 +357,13 @@ LUA_API void *lua_touserdata (lua_State *L, int idx) { LUA_API lua_State *lua_tothread (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); return (!ttisthread(o)) ? NULL : thvalue(o); } LUA_API const void *lua_topointer (lua_State *L, int idx) { - StkId o = luaA_index(L, idx); + StkId o = index2adr(L, idx); switch (ttype(o)) { case LUA_TTABLE: return hvalue(o); case LUA_TFUNCTION: return clvalue(o); @@ -498,7 +498,7 @@ LUA_API int lua_pushthread (lua_State *L) { LUA_API void lua_gettable (lua_State *L, int idx) { StkId t; lua_lock(L); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_checkvalidindex(L, t); luaV_gettable(L, t, L->top - 1, L->top - 1, NULL); lua_unlock(L); @@ -509,7 +509,7 @@ LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { StkId t; TValue key; lua_lock(L); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); luaV_gettable(L, t, &key, L->top, NULL); @@ -521,7 +521,7 @@ LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { LUA_API void lua_rawget (lua_State *L, int idx) { StkId t; lua_lock(L); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_check(L, ttistable(t)); setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); lua_unlock(L); @@ -531,7 +531,7 @@ LUA_API void lua_rawget (lua_State *L, int idx) { LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { StkId o; lua_lock(L); - o = luaA_index(L, idx); + o = index2adr(L, idx); api_check(L, ttistable(o)); setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); api_incr_top(L); @@ -553,7 +553,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { Table *mt = NULL; int res; lua_lock(L); - obj = luaA_index(L, objindex); + obj = index2adr(L, objindex); switch (ttype(obj)) { case LUA_TTABLE: mt = hvalue(obj)->metatable; @@ -577,7 +577,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { LUA_API void lua_getfenv (lua_State *L, int idx) { StkId o; lua_lock(L); - o = luaA_index(L, idx); + o = index2adr(L, idx); api_checkvalidindex(L, o); setobj2s(L, L->top, isLfunction(o) ? &clvalue(o)->l.g : gt(L)); api_incr_top(L); @@ -594,7 +594,7 @@ LUA_API void lua_settable (lua_State *L, int idx) { StkId t; lua_lock(L); api_checknelems(L, 2); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_checkvalidindex(L, t); luaV_settable(L, t, L->top - 2, L->top - 1, NULL); L->top -= 2; /* pop index and value */ @@ -607,7 +607,7 @@ LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { TValue key; lua_lock(L); api_checknelems(L, 1); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); luaV_settable(L, t, &key, L->top - 1, NULL); @@ -620,7 +620,7 @@ LUA_API void lua_rawset (lua_State *L, int idx) { StkId t; lua_lock(L); api_checknelems(L, 2); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_check(L, ttistable(t)); setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); luaC_barriert(L, hvalue(t), L->top-1); @@ -633,7 +633,7 @@ LUA_API void lua_rawseti (lua_State *L, int idx, int n) { StkId o; lua_lock(L); api_checknelems(L, 1); - o = luaA_index(L, idx); + o = index2adr(L, idx); api_check(L, ttistable(o)); setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); luaC_barriert(L, hvalue(o), L->top-1); @@ -648,7 +648,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { int res = 1; lua_lock(L); api_checknelems(L, 1); - obj = luaA_index(L, objindex); + obj = index2adr(L, objindex); api_checkvalidindex(L, obj); if (ttisnil(L->top - 1)) mt = NULL; @@ -685,7 +685,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) { int res = 0; lua_lock(L); api_checknelems(L, 1); - o = luaA_index(L, idx); + o = index2adr(L, idx); api_checkvalidindex(L, o); api_check(L, ttistable(L->top - 1)); if (isLfunction(o)) { @@ -751,7 +751,7 @@ LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) { if (errfunc == 0) func = 0; else { - StkId o = luaA_index(L, errfunc); + StkId o = index2adr(L, errfunc); api_checkvalidindex(L, o); func = savestack(L, o); } @@ -898,7 +898,7 @@ LUA_API int lua_next (lua_State *L, int idx) { StkId t; int more; lua_lock(L); - t = luaA_index(L, idx); + t = index2adr(L, idx); api_check(L, ttistable(t)); more = luaH_next(L, hvalue(t), L->top - 1); if (more) { @@ -970,7 +970,7 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { const char *name; TValue *val; lua_lock(L); - name = aux_upvalue(L, luaA_index(L, funcindex), n, &val); + name = aux_upvalue(L, index2adr(L, funcindex), n, &val); if (name) { setobj2s(L, L->top, val); api_incr_top(L); @@ -985,7 +985,7 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { TValue *val; StkId fi; lua_lock(L); - fi = luaA_index(L, funcindex); + fi = index2adr(L, funcindex); api_checknelems(L, 1); name = aux_upvalue(L, fi, n, &val); if (name) { diff --git a/lcode.c b/lcode.c index 504f57ef..d7ba78db 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.6 2004/08/24 20:09:11 roberto Exp $ +** $Id: lcode.c,v 2.7 2004/10/04 19:01:53 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -53,13 +53,13 @@ int luaK_jump (FuncState *fs) { } -static int luaK_condjump (FuncState *fs, OpCode op, int A, int B, int C) { +static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { luaK_codeABC(fs, op, A, B, C); return luaK_jump(fs); } -static void luaK_fixjump (FuncState *fs, int pc, int dest) { +static void fixjump (FuncState *fs, int pc, int dest) { Instruction *jmp = &fs->f->code[pc]; int offset = dest-(pc+1); lua_assert(dest != NO_JUMP); @@ -79,7 +79,7 @@ int luaK_getlabel (FuncState *fs) { } -static int luaK_getjump (FuncState *fs, int pc) { +static int getjump (FuncState *fs, int pc) { int offset = GETARG_sBx(fs->f->code[pc]); if (offset == NO_JUMP) /* point to itself represents end of list */ return NO_JUMP; /* end of list */ @@ -102,7 +102,7 @@ static Instruction *getjumpcontrol (FuncState *fs, int pc) { ** (or produce an inverted value) */ static int need_value (FuncState *fs, int list, int cond) { - for (; list != NO_JUMP; list = luaK_getjump(fs, list)) { + for (; list != NO_JUMP; list = getjump(fs, list)) { Instruction i = *getjumpcontrol(fs, list); if (GET_OPCODE(i) != OP_TEST || GETARG_C(i) != cond) return 1; } @@ -116,25 +116,25 @@ static void patchtestreg (Instruction *i, int reg) { } -static void luaK_patchlistaux (FuncState *fs, int list, +static void patchlistaux (FuncState *fs, int list, int ttarget, int treg, int ftarget, int freg, int dtarget) { while (list != NO_JUMP) { - int next = luaK_getjump(fs, list); + int next = getjump(fs, list); Instruction *i = getjumpcontrol(fs, list); if (GET_OPCODE(*i) != OP_TEST) { lua_assert(dtarget != NO_JUMP); - luaK_fixjump(fs, list, dtarget); /* jump to default target */ + fixjump(fs, list, dtarget); /* jump to default target */ } else { if (GETARG_C(*i)) { lua_assert(ttarget != NO_JUMP); patchtestreg(i, treg); - luaK_fixjump(fs, list, ttarget); + fixjump(fs, list, ttarget); } else { lua_assert(ftarget != NO_JUMP); patchtestreg(i, freg); - luaK_fixjump(fs, list, ftarget); + fixjump(fs, list, ftarget); } } list = next; @@ -142,8 +142,8 @@ static void luaK_patchlistaux (FuncState *fs, int list, } -static void luaK_dischargejpc (FuncState *fs) { - luaK_patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc, NO_REG, fs->pc); +static void dischargejpc (FuncState *fs) { + patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc, NO_REG, fs->pc); fs->jpc = NO_JUMP; } @@ -153,7 +153,7 @@ void luaK_patchlist (FuncState *fs, int list, int target) { luaK_patchtohere(fs, list); else { lua_assert(target < fs->pc); - luaK_patchlistaux(fs, list, target, NO_REG, target, NO_REG, target); + patchlistaux(fs, list, target, NO_REG, target, NO_REG, target); } } @@ -171,9 +171,9 @@ void luaK_concat (FuncState *fs, int *l1, int l2) { else { int list = *l1; int next; - while ((next = luaK_getjump(fs, list)) != NO_JUMP) /* find last element */ + while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ list = next; - luaK_fixjump(fs, list, l2); + fixjump(fs, list, l2); } } @@ -365,7 +365,7 @@ static void discharge2anyreg (FuncState *fs, expdesc *e) { } -static void luaK_exp2reg (FuncState *fs, expdesc *e, int reg) { +static void exp2reg (FuncState *fs, expdesc *e, int reg) { discharge2reg(fs, e, reg); if (e->k == VJMP) luaK_concat(fs, &e->t, e->info); /* put this jump in `t' list */ @@ -382,8 +382,8 @@ static void luaK_exp2reg (FuncState *fs, expdesc *e, int reg) { luaK_patchtohere(fs, fj); } final = luaK_getlabel(fs); - luaK_patchlistaux(fs, e->f, p_f, NO_REG, final, reg, p_f); - luaK_patchlistaux(fs, e->t, final, reg, p_t, NO_REG, p_t); + patchlistaux(fs, e->f, p_f, NO_REG, final, reg, p_f); + patchlistaux(fs, e->t, final, reg, p_t, NO_REG, p_t); } e->f = e->t = NO_JUMP; e->info = reg; @@ -395,7 +395,7 @@ void luaK_exp2nextreg (FuncState *fs, expdesc *e) { luaK_dischargevars(fs, e); freeexp(fs, e); luaK_reserveregs(fs, 1); - luaK_exp2reg(fs, e, fs->freereg - 1); + exp2reg(fs, e, fs->freereg - 1); } @@ -404,7 +404,7 @@ int luaK_exp2anyreg (FuncState *fs, expdesc *e) { if (e->k == VNONRELOC) { if (!hasjumps(e)) return e->info; /* exp is already in a register */ if (e->info >= fs->nactvar) { /* reg. is not a local? */ - luaK_exp2reg(fs, e, e->info); /* put value on it */ + exp2reg(fs, e, e->info); /* put value on it */ return e->info; } } @@ -450,7 +450,7 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { switch (var->k) { case VLOCAL: { freeexp(fs, ex); - luaK_exp2reg(fs, ex, var->info); + exp2reg(fs, ex, var->info); return; } case VUPVAL: { @@ -502,13 +502,13 @@ static int jumponcond (FuncState *fs, expdesc *e, int cond) { Instruction ie = getcode(fs, e); if (GET_OPCODE(ie) == OP_NOT) { fs->pc--; /* remove previous OP_NOT */ - return luaK_condjump(fs, OP_TEST, NO_REG, GETARG_B(ie), !cond); + return condjump(fs, OP_TEST, NO_REG, GETARG_B(ie), !cond); } /* else go through */ } discharge2anyreg(fs, e); freeexp(fs, e); - return luaK_condjump(fs, OP_TEST, NO_REG, e->info, cond); + return condjump(fs, OP_TEST, NO_REG, e->info, cond); } @@ -660,7 +660,7 @@ static void codebinop (FuncState *fs, expdesc *res, BinOpr op, temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ } else if (op == OPR_NE) cond = 0; - res->info = luaK_condjump(fs, ops[op - OPR_NE], cond, o1, o2); + res->info = condjump(fs, ops[op - OPR_NE], cond, o1, o2); res->k = VJMP; } } @@ -717,7 +717,7 @@ void luaK_fixline (FuncState *fs, int line) { int luaK_code (FuncState *fs, Instruction i, int line) { Proto *f = fs->f; - luaK_dischargejpc(fs); /* `pc' will change */ + dischargejpc(fs); /* `pc' will change */ /* put new instruction in code array */ luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, MAX_INT, "code size overflow"); diff --git a/ldebug.c b/ldebug.c index 1db6d4d0..fa88ffbd 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.9 2004/10/04 19:04:34 roberto Exp roberto $ +** $Id: ldebug.c,v 2.10 2004/10/07 17:27:00 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -284,7 +284,7 @@ static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) { } -static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { +static Instruction symbexec (const Proto *pt, int lastpc, int reg) { int pc; int last; /* stores position of last instruction that changed `reg' */ last = pt->sizecode-1; /* points to final return (a `neutral' instruction) */ @@ -434,7 +434,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { int luaG_checkcode (const Proto *pt) { - return (luaG_symbexec(pt, pt->sizecode, NO_REG) != 0); + return (symbexec(pt, pt->sizecode, NO_REG) != 0); } @@ -454,7 +454,7 @@ static const char *getobjname (CallInfo *ci, int stackpos, const char **name) { *name = luaF_getlocalname(p, stackpos+1, pc); if (*name) /* is a local? */ return "local"; - i = luaG_symbexec(p, pc, stackpos); /* try symbolic execution */ + i = symbexec(p, pc, stackpos); /* try symbolic execution */ lua_assert(pc != -1); switch (GET_OPCODE(i)) { case OP_GETGLOBAL: { diff --git a/ldo.c b/ldo.c index e5f67d5e..3dcb5ba9 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.11 2004/09/22 12:37:52 roberto Exp roberto $ +** $Id: ldo.c,v 2.12 2004/12/01 15:52:54 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -147,7 +147,7 @@ void luaD_growstack (lua_State *L, int n) { } -static CallInfo *luaD_growCI (lua_State *L) { +static CallInfo *growCI (lua_State *L) { if (L->size_ci > LUA_MAXCALLS) /* overflow while handling overflow? */ luaD_throw(L, LUA_ERRERR); else { @@ -238,7 +238,7 @@ static StkId tryfuncTM (lua_State *L, StkId func) { #define inc_ci(L) \ - ((L->ci == L->end_ci) ? luaD_growCI(L) : \ + ((L->ci == L->end_ci) ? growCI(L) : \ (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci)) diff --git a/lparser.c b/lparser.c index 17a89fd3..9a33bb42 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.8 2004/12/03 20:35:33 roberto Exp roberto $ +** $Id: lparser.c,v 2.9 2004/12/03 20:44:19 roberto Exp roberto $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -423,7 +423,7 @@ static void field (LexState *ls, expdesc *v) { } -static void luaY_index (LexState *ls, expdesc *v) { +static void yindex (LexState *ls, expdesc *v) { /* index -> '[' expr ']' */ next(ls); /* skip the '[' */ expr(ls, v); @@ -459,7 +459,7 @@ static void recfield (LexState *ls, struct ConsControl *cc) { checkname(ls, &key); } else /* ls->t.token == '[' */ - luaY_index(ls, &key); + yindex(ls, &key); check(ls, '='); luaK_exp2RK(fs, &key); expr(ls, &val); @@ -706,7 +706,7 @@ static void primaryexp (LexState *ls, expdesc *v) { case '[': { /* `[' exp1 `]' */ expdesc key; luaK_exp2anyreg(fs, v); - luaY_index(ls, &key); + yindex(ls, &key); luaK_indexed(fs, v, &key); break; } diff --git a/ltable.c b/ltable.c index ceac4da7..49f0f572 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.9 2004/11/24 19:16:03 roberto Exp roberto $ +** $Id: ltable.c,v 2.10 2004/11/24 19:20:21 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -124,7 +124,7 @@ static int arrayindex (const TValue *key) { ** elements in the array part, then elements in the hash part. The ** beginning and end of a traversal are signalled by -1. */ -static int luaH_index (lua_State *L, Table *t, StkId key) { +static int findindex (lua_State *L, Table *t, StkId key) { int i; if (ttisnil(key)) return -1; /* first iteration */ i = arrayindex(key); @@ -142,7 +142,7 @@ static int luaH_index (lua_State *L, Table *t, StkId key) { int luaH_next (lua_State *L, Table *t, StkId key) { - int i = luaH_index(L, t, key); /* find original element */ + int i = findindex(L, t, key); /* find original element */ for (i++; i < t->sizearray; i++) { /* try first array part */ if (!ttisnil(&t->array[i])) { /* a non-nil value? */ setnvalue(key, cast(lua_Number, i+1)); diff --git a/lvm.c b/lvm.c index b2845455..d98fcc7c 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.16 2004/10/28 17:45:51 roberto Exp $ +** $Id: lvm.c,v 2.17 2004/11/01 15:06:50 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -214,7 +214,7 @@ static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, } -static int luaV_strcmp (const TString *ls, const TString *rs) { +static int l_strcmp (const TString *ls, const TString *rs) { const char *l = getstr(ls); size_t ll = ls->tsv.len; const char *r = getstr(rs); @@ -243,21 +243,21 @@ int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { else if (ttisnumber(l)) return nvalue(l) < nvalue(r); else if (ttisstring(l)) - return luaV_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) return res; return luaG_ordererror(L, l, r); } -static int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { +static int lessequal (lua_State *L, const TValue *l, const TValue *r) { int res; if (ttype(l) != ttype(r)) return luaG_ordererror(L, l, r); else if (ttisnumber(l)) return nvalue(l) <= nvalue(r); else if (ttisstring(l)) - return luaV_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ return res; else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ @@ -568,7 +568,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { } case OP_LE: { L->ci->savedpc = pc; - if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) pc++; /***/ + if (lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) pc++; /***/ else dojump(L, pc, GETARG_sBx(*pc) + 1); base = L->base; continue; -- cgit v1.2.3-55-g6feb