From 389c890ed3bd0d3e8b7d08d2509e0accc812a92e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy <roberto@inf.puc-rio.br> Date: Wed, 6 Jan 2010 09:48:02 -0200 Subject: again changing macro to function to save a few bytes --- lparser.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index 2fb6f970..a42c6401 100644 --- 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); -- cgit v1.2.3-55-g6feb