commit 389c890ed3bd0d3e8b7d08d2509e0accc812a92e
parent e3866afa97c7cc0d0fce9277b13136f86d16e26c
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 6 Jan 2010 09:47:38 -0200
again changing macro to function to save a few bytes
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lparser.c b/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
** 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) {
FuncState *fs = ls->fs;
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) {
int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx;
lua_assert(idx < fs->nlocvars);