diff options
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 46 |
1 files changed, 2 insertions, 44 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.52 2000/03/16 21:06:16 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.53 2000/03/20 19:14:54 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 | */ |
@@ -8,8 +8,7 @@ | |||
8 | #define lobject_h | 8 | #define lobject_h |
9 | 9 | ||
10 | 10 | ||
11 | #include <limits.h> | 11 | #include "llims.h" |
12 | |||
13 | #include "lua.h" | 12 | #include "lua.h" |
14 | 13 | ||
15 | 14 | ||
@@ -26,39 +25,6 @@ | |||
26 | 25 | ||
27 | #define UNUSED(x) (void)x /* to avoid warnings */ | 26 | #define UNUSED(x) (void)x /* to avoid warnings */ |
28 | 27 | ||
29 | /* | ||
30 | ** Define the type `number' of Lua | ||
31 | ** GREP LUA_NUMBER to change that | ||
32 | */ | ||
33 | #ifndef LUA_NUM_TYPE | ||
34 | #define LUA_NUM_TYPE double | ||
35 | #endif | ||
36 | |||
37 | typedef LUA_NUM_TYPE Number; | ||
38 | |||
39 | |||
40 | /* | ||
41 | ** type for virtual-machine instructions | ||
42 | ** must be an unsigned with 4 bytes (see details in lopcodes.h) | ||
43 | */ | ||
44 | typedef unsigned long Instruction; | ||
45 | |||
46 | |||
47 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ | ||
48 | |||
49 | |||
50 | /* conversion of pointer to int (for hashing only) */ | ||
51 | /* (the shift removes bits that are usually 0 because of alignment) */ | ||
52 | #define IntPoint(L, p) (((unsigned long)(p)) >> 3) | ||
53 | |||
54 | |||
55 | /* | ||
56 | ** number of `blocks' for garbage collection: each reference to other | ||
57 | ** objects count 1, and each 32 bytes of `raw' memory count 1; we add | ||
58 | ** 2 to the total as a minimum (and also to count the overhead of malloc) | ||
59 | */ | ||
60 | #define numblocks(L, o,b) ((o)+((b)>>5)+2) | ||
61 | |||
62 | 28 | ||
63 | /* | 29 | /* |
64 | ** Lua TYPES | 30 | ** Lua TYPES |
@@ -112,7 +78,6 @@ typedef struct TObject { | |||
112 | } TObject; | 78 | } TObject; |
113 | 79 | ||
114 | 80 | ||
115 | |||
116 | typedef struct GlobalVar { | 81 | typedef struct GlobalVar { |
117 | TObject value; | 82 | TObject value; |
118 | struct GlobalVar *next; | 83 | struct GlobalVar *next; |
@@ -142,8 +107,6 @@ typedef struct TString { | |||
142 | } TString; | 107 | } TString; |
143 | 108 | ||
144 | 109 | ||
145 | |||
146 | |||
147 | /* | 110 | /* |
148 | ** Function Prototypes | 111 | ** Function Prototypes |
149 | */ | 112 | */ |
@@ -173,8 +136,6 @@ typedef struct LocVar { | |||
173 | 136 | ||
174 | 137 | ||
175 | 138 | ||
176 | |||
177 | |||
178 | /* Macros to access structure members */ | 139 | /* Macros to access structure members */ |
179 | #define ttype(o) ((o)->ttype) | 140 | #define ttype(o) ((o)->ttype) |
180 | #define nvalue(o) ((o)->value.n) | 141 | #define nvalue(o) ((o)->value.n) |
@@ -199,7 +160,6 @@ typedef struct Closure { | |||
199 | } Closure; | 160 | } Closure; |
200 | 161 | ||
201 | 162 | ||
202 | |||
203 | typedef struct Node { | 163 | typedef struct Node { |
204 | TObject key; | 164 | TObject key; |
205 | TObject val; | 165 | TObject val; |
@@ -221,8 +181,6 @@ extern const TObject luaO_nilobject; | |||
221 | 181 | ||
222 | #define luaO_typename(o) luaO_typenames[ttype(o)] | 182 | #define luaO_typename(o) luaO_typenames[ttype(o)] |
223 | 183 | ||
224 | #define MINPOWER2 4 /* minimum size for "growing" vectors */ | ||
225 | |||
226 | unsigned long luaO_power2 (unsigned long n); | 184 | unsigned long luaO_power2 (unsigned long n); |
227 | 185 | ||
228 | #define luaO_equalObj(t1,t2) (ttype(t1) == ttype(t2) && luaO_equalval(t1,t2)) | 186 | #define luaO_equalObj(t1,t2) (ttype(t1) == ttype(t2) && luaO_equalval(t1,t2)) |