diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-19 15:27:20 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-19 15:27:20 -0300 |
| commit | 89b56e7d84d84de58fcc9d540c2003c6c2f8c134 (patch) | |
| tree | 85ba9c3aa3cdb5ff57fd4f82bf322fb2e75e7292 /lfunc.c | |
| parent | 14929f5764a7990dfb62c8792cfdfe03c061da21 (diff) | |
| download | lua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.tar.gz lua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.tar.bz2 lua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.zip | |
more precision between closure types ('LClosure' x 'CClosure')
Diffstat (limited to 'lfunc.c')
| -rw-r--r-- | lfunc.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.c,v 2.41 2014/02/18 13:39:37 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.42 2014/06/18 22:59:29 roberto Exp roberto $ |
| 3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -20,20 +20,20 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | Closure *luaF_newCclosure (lua_State *L, int n) { | 23 | CClosure *luaF_newCclosure (lua_State *L, int n) { |
| 24 | GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(n)); | 24 | GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(n)); |
| 25 | Closure *c = gco2cl(o); | 25 | CClosure *c = gco2ccl(o); |
| 26 | c->c.nupvalues = cast_byte(n); | 26 | c->nupvalues = cast_byte(n); |
| 27 | return c; | 27 | return c; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | Closure *luaF_newLclosure (lua_State *L, int n) { | 31 | LClosure *luaF_newLclosure (lua_State *L, int n) { |
| 32 | GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(n)); | 32 | GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(n)); |
| 33 | Closure *c = gco2cl(o); | 33 | LClosure *c = gco2lcl(o); |
| 34 | c->l.p = NULL; | 34 | c->p = NULL; |
| 35 | c->l.nupvalues = cast_byte(n); | 35 | c->nupvalues = cast_byte(n); |
| 36 | while (n--) c->l.upvals[n] = NULL; | 36 | while (n--) c->upvals[n] = NULL; |
| 37 | return c; | 37 | return c; |
| 38 | } | 38 | } |
| 39 | 39 | ||
