diff options
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.63 2011/10/17 14:46:13 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.64 2011/10/31 17:48:22 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -109,12 +109,14 @@ typedef struct lua_TValue TValue; | |||
109 | /* raw type tag of a TValue */ | 109 | /* raw type tag of a TValue */ |
110 | #define rttype(o) ((o)->tt_) | 110 | #define rttype(o) ((o)->tt_) |
111 | 111 | ||
112 | /* tag with no variants (bits 0-3) */ | ||
113 | #define novariant(x) ((x) & 0x0F) | ||
114 | |||
112 | /* type tag of a TValue (bits 0-3 for tags + variant bits 4-5) */ | 115 | /* type tag of a TValue (bits 0-3 for tags + variant bits 4-5) */ |
113 | #define ttype(o) (rttype(o) & 0x3F) | 116 | #define ttype(o) (rttype(o) & 0x3F) |
114 | 117 | ||
115 | |||
116 | /* type tag of a TValue with no variants (bits 0-3) */ | 118 | /* type tag of a TValue with no variants (bits 0-3) */ |
117 | #define ttypenv(o) (rttype(o) & 0x0F) | 119 | #define ttypenv(o) (novariant(rttype(o))) |
118 | 120 | ||
119 | 121 | ||
120 | /* Macros to test type */ | 122 | /* Macros to test type */ |
@@ -161,7 +163,7 @@ typedef struct lua_TValue TValue; | |||
161 | 163 | ||
162 | 164 | ||
163 | /* Macros for internal tests */ | 165 | /* Macros for internal tests */ |
164 | #define righttt(obj) (ttypenv(obj) == gcvalue(obj)->gch.tt) | 166 | #define righttt(obj) (ttype(obj) == gcvalue(obj)->gch.tt) |
165 | 167 | ||
166 | #define checkliveness(g,obj) \ | 168 | #define checkliveness(g,obj) \ |
167 | lua_longassert(!iscollectable(obj) || \ | 169 | lua_longassert(!iscollectable(obj) || \ |
@@ -501,7 +503,7 @@ typedef struct UpVal { | |||
501 | */ | 503 | */ |
502 | 504 | ||
503 | #define ClosureHeader \ | 505 | #define ClosureHeader \ |
504 | CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist | 506 | CommonHeader; lu_byte nupvalues; GCObject *gclist |
505 | 507 | ||
506 | typedef struct CClosure { | 508 | typedef struct CClosure { |
507 | ClosureHeader; | 509 | ClosureHeader; |