diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-18 11:46:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-18 11:46:47 -0300 |
commit | bb129031205acc64eb6b41c98d8a08c1fccce308 (patch) | |
tree | 65e01a5af21d2867c3108507ed0afbb8d32201bd /lstate.h | |
parent | ca41b43f53562e64abe433d6346d174c92548603 (diff) | |
download | lua-bb129031205acc64eb6b41c98d8a08c1fccce308.tar.gz lua-bb129031205acc64eb6b41c98d8a08c1fccce308.tar.bz2 lua-bb129031205acc64eb6b41c98d8a08c1fccce308.zip |
type 'Udata' refers directly to structure inside the union (union
used only for aligning purposes now)
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.111 2014/07/18 12:17:54 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.112 2014/07/18 13:36:14 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -175,7 +175,7 @@ struct lua_State { | |||
175 | union GCUnion { | 175 | union GCUnion { |
176 | GCObject gc; /* common header */ | 176 | GCObject gc; /* common header */ |
177 | struct TString ts; | 177 | struct TString ts; |
178 | union Udata u; | 178 | struct Udata u; |
179 | union Closure cl; | 179 | union Closure cl; |
180 | struct Table h; | 180 | struct Table h; |
181 | struct Proto p; | 181 | struct Proto p; |
@@ -188,8 +188,7 @@ union GCUnion { | |||
188 | /* macros to convert a GCObject into a specific value */ | 188 | /* macros to convert a GCObject into a specific value */ |
189 | #define gco2ts(o) \ | 189 | #define gco2ts(o) \ |
190 | check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) | 190 | check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) |
191 | #define rawgco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u)) | 191 | #define gco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u)) |
192 | #define gco2u(o) (&rawgco2u(o)->uv) | ||
193 | #define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l)) | 192 | #define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l)) |
194 | #define gco2ccl(o) check_exp((o)->tt == LUA_TCCL, &((cast_u(o))->cl.c)) | 193 | #define gco2ccl(o) check_exp((o)->tt == LUA_TCCL, &((cast_u(o))->cl.c)) |
195 | #define gco2cl(o) \ | 194 | #define gco2cl(o) \ |