comparison src/lisp.h @ 31901:4e2853ad5d2d

(union Lisp_Object) [!NO_UNION_TYPE]: Use EMACS_INT and EMACS_UINT instead of `int' and `unsigned int'. (XSET) [EXPLICIT_SIGN_EXTEND]: Use EMACS_INT instead of `int'.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 26 Sep 2000 12:35:33 +0000
parents 12c10704f00c
children b786c3535d32
comparison
equal deleted inserted replaced
31900:8b2fa657800d 31901:4e2853ad5d2d
176 typedef 176 typedef
177 union Lisp_Object 177 union Lisp_Object
178 { 178 {
179 /* Used for comparing two Lisp_Objects; 179 /* Used for comparing two Lisp_Objects;
180 also, positive integers can be accessed fast this way. */ 180 also, positive integers can be accessed fast this way. */
181 int i; 181 EMACS_INT i;
182 182
183 struct 183 struct
184 { 184 {
185 int val: VALBITS; 185 EMACS_INT val : VALBITS;
186 int type: GCTYPEBITS+1; 186 EMACS_INT type : GCTYPEBITS + 1;
187 } s; 187 } s;
188 struct 188 struct
189 { 189 {
190 unsigned int val: VALBITS; 190 EMACS_UINT val : VALBITS;
191 int type: GCTYPEBITS+1; 191 EMACS_INT type : GCTYPEBITS + 1;
192 } u; 192 } u;
193 struct 193 struct
194 { 194 {
195 unsigned int val: VALBITS; 195 EMACS_UINT val : VALBITS;
196 enum Lisp_Type type: GCTYPEBITS; 196 enum Lisp_Type type : GCTYPEBITS;
197 /* The markbit is not really part of the value of a Lisp_Object, 197 /* The markbit is not really part of the value of a Lisp_Object,
198 and is always zero except during garbage collection. */ 198 and is always zero except during garbage collection. */
199 unsigned int markbit: 1; 199 EMACS_UINT markbit : 1;
200 } gu; 200 } gu;
201 } 201 }
202 Lisp_Object; 202 Lisp_Object;
203 203
204 #else /* If WORDS_BIG_ENDIAN */ 204 #else /* If WORDS_BIG_ENDIAN */
206 typedef 206 typedef
207 union Lisp_Object 207 union Lisp_Object
208 { 208 {
209 /* Used for comparing two Lisp_Objects; 209 /* Used for comparing two Lisp_Objects;
210 also, positive integers can be accessed fast this way. */ 210 also, positive integers can be accessed fast this way. */
211 int i; 211 EMACS_INT i;
212 212
213 struct 213 struct
214 { 214 {
215 int type: GCTYPEBITS+1; 215 EMACS_INT type : GCTYPEBITS+1;
216 int val: VALBITS; 216 EMACS_INT val : VALBITS;
217 } s; 217 } s;
218 struct 218 struct
219 { 219 {
220 int type: GCTYPEBITS+1; 220 EMACS_INT type : GCTYPEBITS+1;
221 unsigned int val: VALBITS; 221 EMACS_UINT val : VALBITS;
222 } u; 222 } u;
223 struct 223 struct
224 { 224 {
225 /* The markbit is not really part of the value of a Lisp_Object, 225 /* The markbit is not really part of the value of a Lisp_Object,
226 and is always zero except during garbage collection. */ 226 and is always zero except during garbage collection. */
227 unsigned int markbit: 1; 227 EMACS_UINT markbit : 1;
228 enum Lisp_Type type: GCTYPEBITS; 228 enum Lisp_Type type : GCTYPEBITS;
229 unsigned int val: VALBITS; 229 EMACS_UINT val : VALBITS;
230 } gu; 230 } gu;
231 } 231 }
232 Lisp_Object; 232 Lisp_Object;
233 233
234 #endif /* WORDS_BIG_ENDIAN */ 234 #endif /* WORDS_BIG_ENDIAN */
426 426
427 #define XUINT(a) ((a).u.val) 427 #define XUINT(a) ((a).u.val)
428 #define XPNTR(a) ((a).u.val) 428 #define XPNTR(a) ((a).u.val)
429 429
430 #define XSET(var, vartype, ptr) \ 430 #define XSET(var, vartype, ptr) \
431 (((var).s.val = ((int) (ptr))), ((var).s.type = ((char) (vartype)))) 431 (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype))))
432 432
433 #if __GNUC__ >= 2 && defined (__OPTIMIZE__) 433 #if __GNUC__ >= 2 && defined (__OPTIMIZE__)
434 #define make_number(N) \ 434 #define make_number(N) \
435 (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; })) 435 (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; }))
436 #else 436 #else