aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
commite1d072571ec6f9d830e575a2ecdc95fd43428e53 (patch)
tree830fab7f2acb9adaee2d63073d339cc9557a5437 /lfunc.c
parent7651a5c6b2ee6ec59cadec6199319d482071f176 (diff)
downloadlua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.gz
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.bz2
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.zip
better syntax for type casts
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lfunc.c b/lfunc.c
index 141d04a1..cece5a1b 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -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
21Closure *luaF_newclosure (lua_State *L, int nelems) { 22Closure *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;