From ca41b43f53562e64abe433d6346d174c92548603 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 18 Jul 2014 10:36:14 -0300 Subject: type 'TString' refers directly to the structure inside the union (union used only for size purposes) --- lstate.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 69c91b63..662e925a 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.110 2014/07/17 17:27:49 roberto Exp roberto $ +** $Id: lstate.h,v 2.111 2014/07/18 12:17:54 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -174,7 +174,7 @@ struct lua_State { */ union GCUnion { GCObject gc; /* common header */ - union TString ts; + struct TString ts; union Udata u; union Closure cl; struct Table h; @@ -186,9 +186,8 @@ union GCUnion { #define cast_u(o) cast(union GCUnion *, (o)) /* macros to convert a GCObject into a specific value */ -#define rawgco2ts(o) \ +#define gco2ts(o) \ check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) -#define gco2ts(o) (&rawgco2ts(o)->tsv) #define rawgco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u)) #define gco2u(o) (&rawgco2u(o)->uv) #define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l)) @@ -204,13 +203,6 @@ union GCUnion { #define obj2gco(v) \ check_exp(novariant((v)->tt) < LUA_TDEADKEY, (&(cast_u(v)->gc))) -/* -** macro to convert a TString into a GCObject. -** (TString is a union, and therefore needs an access slightly different -** from the other objects.) -*/ -#define ts2gco(v) (obj2gco(&(v)->tsv)) - /* actual number of total bytes allocated */ #define gettotalbytes(g) ((g)->totalbytes + (g)->GCdebt) -- cgit v1.2.3-55-g6feb