diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-08 12:49:25 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-08 12:49:25 -0300 |
| commit | 6556fcfe5a90ca7d218489102788d1c1dac9b503 (patch) | |
| tree | 085206471c91b68ccf8607b369a2a9b4af8ab189 | |
| parent | 41964648eea1427d53934b886abb68cc8457b019 (diff) | |
| download | lua-6556fcfe5a90ca7d218489102788d1c1dac9b503.tar.gz lua-6556fcfe5a90ca7d218489102788d1c1dac9b503.tar.bz2 lua-6556fcfe5a90ca7d218489102788d1c1dac9b503.zip | |
small janitor work
| -rw-r--r-- | lobject.h | 51 |
1 files changed, 23 insertions, 28 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.110 2015/04/02 21:10:53 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.111 2015/06/09 14:21:42 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 | */ |
| @@ -19,8 +19,8 @@ | |||
| 19 | /* | 19 | /* |
| 20 | ** Extra tags for non-values | 20 | ** Extra tags for non-values |
| 21 | */ | 21 | */ |
| 22 | #define LUA_TPROTO LUA_NUMTAGS | 22 | #define LUA_TPROTO LUA_NUMTAGS /* function prototypes */ |
| 23 | #define LUA_TDEADKEY (LUA_NUMTAGS+1) | 23 | #define LUA_TDEADKEY (LUA_NUMTAGS+1) /* removed keys in tables */ |
| 24 | 24 | ||
| 25 | /* | 25 | /* |
| 26 | ** number of all possible tags (including LUA_TNONE but excluding DEADKEY) | 26 | ** number of all possible tags (including LUA_TNONE but excluding DEADKEY) |
| @@ -88,22 +88,32 @@ struct GCObject { | |||
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | /* | ||
| 92 | ** Union of all Lua values | ||
| 93 | */ | ||
| 94 | typedef union Value Value; | ||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | 91 | ||
| 99 | /* | 92 | /* |
| 100 | ** Tagged Values. This is the basic representation of values in Lua, | 93 | ** Tagged Values. This is the basic representation of values in Lua, |
| 101 | ** an actual value plus a tag with its type. | 94 | ** an actual value plus a tag with its type. |
| 102 | */ | 95 | */ |
| 103 | 96 | ||
| 97 | /* | ||
| 98 | ** Union of all Lua values | ||
| 99 | */ | ||
| 100 | typedef union Value { | ||
| 101 | GCObject *gc; /* collectable objects */ | ||
| 102 | void *p; /* light userdata */ | ||
| 103 | int b; /* booleans */ | ||
| 104 | lua_CFunction f; /* light C functions */ | ||
| 105 | lua_Integer i; /* integer numbers */ | ||
| 106 | lua_Number n; /* float numbers */ | ||
| 107 | } Value; | ||
| 108 | |||
| 109 | |||
| 104 | #define TValuefields Value value_; int tt_ | 110 | #define TValuefields Value value_; int tt_ |
| 105 | 111 | ||
| 106 | typedef struct lua_TValue TValue; | 112 | |
| 113 | typedef struct lua_TValue { | ||
| 114 | TValuefields; | ||
| 115 | } TValue; | ||
| 116 | |||
| 107 | 117 | ||
| 108 | 118 | ||
| 109 | /* macro defining a nil value */ | 119 | /* macro defining a nil value */ |
| @@ -280,21 +290,6 @@ typedef struct lua_TValue TValue; | |||
| 280 | */ | 290 | */ |
| 281 | 291 | ||
| 282 | 292 | ||
| 283 | union Value { | ||
| 284 | GCObject *gc; /* collectable objects */ | ||
| 285 | void *p; /* light userdata */ | ||
| 286 | int b; /* booleans */ | ||
| 287 | lua_CFunction f; /* light C functions */ | ||
| 288 | lua_Integer i; /* integer numbers */ | ||
| 289 | lua_Number n; /* float numbers */ | ||
| 290 | }; | ||
| 291 | |||
| 292 | |||
| 293 | struct lua_TValue { | ||
| 294 | TValuefields; | ||
| 295 | }; | ||
| 296 | |||
| 297 | |||
| 298 | typedef TValue *StkId; /* index to stack elements */ | 293 | typedef TValue *StkId; /* index to stack elements */ |
| 299 | 294 | ||
| 300 | 295 | ||
| @@ -419,8 +414,8 @@ typedef struct Proto { | |||
| 419 | int sizelineinfo; | 414 | int sizelineinfo; |
| 420 | int sizep; /* size of 'p' */ | 415 | int sizep; /* size of 'p' */ |
| 421 | int sizelocvars; | 416 | int sizelocvars; |
| 422 | int linedefined; | 417 | int linedefined; /* debug information */ |
| 423 | int lastlinedefined; | 418 | int lastlinedefined; /* debug information */ |
| 424 | TValue *k; /* constants used by the function */ | 419 | TValue *k; /* constants used by the function */ |
| 425 | Instruction *code; /* opcodes */ | 420 | Instruction *code; /* opcodes */ |
| 426 | struct Proto **p; /* functions defined inside the function */ | 421 | struct Proto **p; /* functions defined inside the function */ |
