diff options
Diffstat (limited to 'lfunc.c')
| -rw-r--r-- | lfunc.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.c,v 1.44 2001/06/05 18:17:01 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.45 2001/06/28 14:57:17 roberto Exp $ |
| 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 | */ |
| @@ -15,11 +15,12 @@ | |||
| 15 | #include "lstate.h" | 15 | #include "lstate.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | #define sizeclosure(n) ((int)sizeof(Closure) + (int)sizeof(TObject)*((n)-1)) | 18 | #define sizeclosure(n) (cast(int, sizeof(Closure)) + \ |
| 19 | cast(int, sizeof(TObject)*((n)-1))) | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | Closure *luaF_newclosure (lua_State *L, int nelems) { | 22 | Closure *luaF_newclosure (lua_State *L, int nelems) { |
| 22 | Closure *c = (Closure *)luaM_malloc(L, sizeclosure(nelems)); | 23 | Closure *c = cast(Closure *, luaM_malloc(L, sizeclosure(nelems))); |
| 23 | c->next = G(L)->rootcl; | 24 | c->next = G(L)->rootcl; |
| 24 | G(L)->rootcl = c; | 25 | G(L)->rootcl = c; |
| 25 | c->mark = c; | 26 | c->mark = c; |
