mirror of https://github.com/rusefi/lua.git
again changing macro to function to save a few bytes
This commit is contained in:
parent
e3866afa97
commit
389c890ed3
14
lparser.c
14
lparser.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lparser.c,v 2.73 2009/11/26 11:39:20 roberto Exp roberto $
|
** $Id: lparser.c,v 2.74 2010/01/05 18:46:58 roberto Exp roberto $
|
||||||
** Lua Parser
|
** Lua Parser
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -164,10 +164,6 @@ static int registerlocalvar (LexState *ls, TString *varname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define new_localvarliteral(ls,v) \
|
|
||||||
new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1))
|
|
||||||
|
|
||||||
|
|
||||||
static void new_localvar (LexState *ls, TString *name) {
|
static void new_localvar (LexState *ls, TString *name) {
|
||||||
FuncState *fs = ls->fs;
|
FuncState *fs = ls->fs;
|
||||||
Varlist *vl = ls->varl;
|
Varlist *vl = ls->varl;
|
||||||
|
@ -180,6 +176,14 @@ static void new_localvar (LexState *ls, TString *name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void new_localvarliteral_ (LexState *ls, const char *name, size_t sz) {
|
||||||
|
new_localvar(ls, luaX_newstring(ls, name, sz));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define new_localvarliteral(ls,v) \
|
||||||
|
new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1)
|
||||||
|
|
||||||
|
|
||||||
static LocVar *getlocvar (FuncState *fs, int i) {
|
static LocVar *getlocvar (FuncState *fs, int i) {
|
||||||
int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx;
|
int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx;
|
||||||
lua_assert(idx < fs->nlocvars);
|
lua_assert(idx < fs->nlocvars);
|
||||||
|
|
Loading…
Reference in New Issue