diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-06 09:48:02 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-06 09:48:02 -0200 |
commit | 389c890ed3bd0d3e8b7d08d2509e0accc812a92e (patch) | |
tree | 6eadd71448b83140f6de4ba45acece634c17b6f6 | |
parent | e3866afa97c7cc0d0fce9277b13136f86d16e26c (diff) | |
download | lua-389c890ed3bd0d3e8b7d08d2509e0accc812a92e.tar.gz lua-389c890ed3bd0d3e8b7d08d2509e0accc812a92e.tar.bz2 lua-389c890ed3bd0d3e8b7d08d2509e0accc812a92e.zip |
again changing macro to function to save a few bytes
-rw-r--r-- | lparser.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.73 2009/11/26 11:39:20 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.74 2010/01/05 18:46:58 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -164,10 +164,6 @@ static int registerlocalvar (LexState *ls, TString *varname) { | |||
164 | } | 164 | } |
165 | 165 | ||
166 | 166 | ||
167 | #define new_localvarliteral(ls,v) \ | ||
168 | new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1)) | ||
169 | |||
170 | |||
171 | static void new_localvar (LexState *ls, TString *name) { | 167 | static void new_localvar (LexState *ls, TString *name) { |
172 | FuncState *fs = ls->fs; | 168 | FuncState *fs = ls->fs; |
173 | Varlist *vl = ls->varl; | 169 | Varlist *vl = ls->varl; |
@@ -180,6 +176,14 @@ static void new_localvar (LexState *ls, TString *name) { | |||
180 | } | 176 | } |
181 | 177 | ||
182 | 178 | ||
179 | static void new_localvarliteral_ (LexState *ls, const char *name, size_t sz) { | ||
180 | new_localvar(ls, luaX_newstring(ls, name, sz)); | ||
181 | } | ||
182 | |||
183 | #define new_localvarliteral(ls,v) \ | ||
184 | new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1) | ||
185 | |||
186 | |||
183 | static LocVar *getlocvar (FuncState *fs, int i) { | 187 | static LocVar *getlocvar (FuncState *fs, int i) { |
184 | int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx; | 188 | int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx; |
185 | lua_assert(idx < fs->nlocvars); | 189 | lua_assert(idx < fs->nlocvars); |