comparison src/lisp.h @ 8827:97bf951c0b98

(Lisp_Object): Use EMACS_INT. (MARKBIT): Don't define if already defined. (VALMASK, GCTYPEMASK, XSETTYPE, XSET) (XSETCONS, XSETBUFFER, XSETVECTOR, XSETSUBR, XSETSTRING) (XSETSYMBOL, XSETFUNCTION, XSETMARKER, XSETOBJFWD) (XSETINTPTR, XSETWINDOW, XSETPROCESS, XSETFLOAT) (struct Lisp_String, struct Lisp_Vector): Use EMACS_INT.
author Richard M. Stallman <rms@gnu.org>
date Sat, 17 Sep 1994 00:35:09 +0000
parents 232f6277bb8a
children 48bcdcb9d191
comparison
equal deleted inserted replaced
8826:9f5965fe4f6b 8827:97bf951c0b98
240 /* If union type is not wanted, define Lisp_Object as just a number 240 /* If union type is not wanted, define Lisp_Object as just a number
241 and define the macros below to extract fields by shifting */ 241 and define the macros below to extract fields by shifting */
242 242
243 #ifdef NO_UNION_TYPE 243 #ifdef NO_UNION_TYPE
244 244
245 #define Lisp_Object int 245 #define Lisp_Object EMACS_INT
246 246
247 /* These values are overridden by the m- file on some machines. */ 247 /* These values are overridden by the m- file on some machines. */
248 #ifndef VALBITS 248 #ifndef VALBITS
249 #define VALBITS 24 249 #define VALBITS 24
250 #endif 250 #endif
252 #ifndef GCTYPEBITS 252 #ifndef GCTYPEBITS
253 #define GCTYPEBITS 7 253 #define GCTYPEBITS 7
254 #endif 254 #endif
255 255
256 #ifndef VALMASK 256 #ifndef VALMASK
257 #define VALMASK ((1<<VALBITS) - 1) 257 #define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1)
258 #endif 258 #endif
259 #define GCTYPEMASK ((1<<GCTYPEBITS) - 1) 259 #define GCTYPEMASK ((((EMACS_INT) 1)<<GCTYPEBITS) - 1)
260 260
261 /* Two flags that are set during GC. On some machines, these flags 261 /* Two flags that are set during GC. On some machines, these flags
262 are defined differently by the m- file. */ 262 are defined differently by the m- file. */
263 263
264 /* This is set in the car of a cons and in the plist slot of a symbol 264 /* This is set in the car of a cons and in the plist slot of a symbol
268 268
269 In strings, this bit in the size field indicates that the string 269 In strings, this bit in the size field indicates that the string
270 is a "large" one, one which was separately malloc'd 270 is a "large" one, one which was separately malloc'd
271 rather than being part of a string block. */ 271 rather than being part of a string block. */
272 272
273 #ifndef MARKBIT
273 #define MARKBIT (1 << (VALBITS + GCTYPEBITS)) 274 #define MARKBIT (1 << (VALBITS + GCTYPEBITS))
275 #endif /*MARKBIT */
274 276
275 /* In the size word of a vector, this bit means the vector has been marked. 277 /* In the size word of a vector, this bit means the vector has been marked.
276 In the size word of a large string, likewise. */ 278 In the size word of a large string, likewise. */
277 279
278 #ifndef ARRAY_MARK_FLAG 280 #ifndef ARRAY_MARK_FLAG
298 #ifndef XTYPE 300 #ifndef XTYPE
299 #define XTYPE(a) ((enum Lisp_Type) ((a) >> VALBITS)) 301 #define XTYPE(a) ((enum Lisp_Type) ((a) >> VALBITS))
300 #endif 302 #endif
301 303
302 #ifndef XSETTYPE 304 #ifndef XSETTYPE
303 #define XSETTYPE(a, b) ((a) = XUINT (a) | ((int)(b) << VALBITS)) 305 #define XSETTYPE(a, b) ((a) = XUINT (a) | ((EMACS_INT)(b) << VALBITS))
304 #endif 306 #endif
305 307
306 /* Use XFASTINT for fast retrieval and storage of integers known 308 /* Use XFASTINT for fast retrieval and storage of integers known
307 to be positive. This takes advantage of the fact that Lisp_Int is 0. */ 309 to be positive. This takes advantage of the fact that Lisp_Int is 0. */
308 #define XFASTINT(a) (a) 310 #define XFASTINT(a) (a)
352 #define XSETPNTR(a, b) XSETINT (a, b) 354 #define XSETPNTR(a, b) XSETINT (a, b)
353 #endif 355 #endif
354 356
355 #ifndef XSET 357 #ifndef XSET
356 #define XSET(var, type, ptr) \ 358 #define XSET(var, type, ptr) \
357 ((var) = ((int)(type) << VALBITS) + ((int) (ptr) & VALMASK)) 359 ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK))
358 #endif 360 #endif
359 361
360 /* During garbage collection, XGCTYPE must be used for extracting types 362 /* During garbage collection, XGCTYPE must be used for extracting types
361 so that the mark bit is ignored. XMARKBIT accesses the markbit. 363 so that the mark bit is ignored. XMARKBIT accesses the markbit.
362 Markbits are used only in particular slots of particular structure types. 364 Markbits are used only in particular slots of particular structure types.
444 #define XINTPTR(a) ((int *) XPNTR(a)) 446 #define XINTPTR(a) ((int *) XPNTR(a))
445 #define XWINDOW(a) ((struct window *) XPNTR(a)) 447 #define XWINDOW(a) ((struct window *) XPNTR(a))
446 #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a)) 448 #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
447 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) 449 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a))
448 450
449 #define XSETCONS(a, b) XSETPNTR(a, (int) (b)) 451 #define XSETCONS(a, b) XSETPNTR(a, (EMACS_INT) (b))
450 #define XSETBUFFER(a, b) XSETPNTR(a, (int) (b)) 452 #define XSETBUFFER(a, b) XSETPNTR(a, (EMACS_INT) (b))
451 #define XSETVECTOR(a, b) XSETPNTR(a, (int) (b)) 453 #define XSETVECTOR(a, b) XSETPNTR(a, (EMACS_INT) (b))
452 #define XSETSUBR(a, b) XSETPNTR(a, (int) (b)) 454 #define XSETSUBR(a, b) XSETPNTR(a, (EMACS_INT) (b))
453 #define XSETSTRING(a, b) XSETPNTR(a, (int) (b)) 455 #define XSETSTRING(a, b) XSETPNTR(a, (EMACS_INT) (b))
454 #define XSETSYMBOL(a, b) XSETPNTR(a, (int) (b)) 456 #define XSETSYMBOL(a, b) XSETPNTR(a, (EMACS_INT) (b))
455 #define XSETFUNCTION(a, b) XSETPNTR(a, (int) (b)) 457 #define XSETFUNCTION(a, b) XSETPNTR(a, (EMACS_INT) (b))
456 #define XSETMARKER(a, b) XSETPNTR(a, (int) (b)) 458 #define XSETMARKER(a, b) XSETPNTR(a, (EMACS_INT) (b))
457 #define XSETOBJFWD(a, b) XSETPNTR(a, (int) (b)) 459 #define XSETOBJFWD(a, b) XSETPNTR(a, (EMACS_INT) (b))
458 #define XSETINTPTR(a, b) XSETPNTR(a, (int) (b)) 460 #define XSETINTPTR(a, b) XSETPNTR(a, (EMACS_INT) (b))
459 #define XSETWINDOW(a, b) XSETPNTR(a, (int) (b)) 461 #define XSETWINDOW(a, b) XSETPNTR(a, (EMACS_INT) (b))
460 #define XSETPROCESS(a, b) XSETPNTR(a, (int) (b)) 462 #define XSETPROCESS(a, b) XSETPNTR(a, (EMACS_INT) (b))
461 #define XSETFLOAT(a, b) XSETPNTR(a, (int) (b)) 463 #define XSETFLOAT(a, b) XSETPNTR(a, (EMACS_INT) (b))
462 464
463 #ifdef USE_TEXT_PROPERTIES 465 #ifdef USE_TEXT_PROPERTIES
464 /* Basic data type for use of intervals. See the macros in intervals.h */ 466 /* Basic data type for use of intervals. See the macros in intervals.h */
465 467
466 struct interval 468 struct interval
547 549
548 /* In a string or vector, the sign bit of the `size' is the gc mark bit */ 550 /* In a string or vector, the sign bit of the `size' is the gc mark bit */
549 551
550 struct Lisp_String 552 struct Lisp_String
551 { 553 {
552 int size; 554 EMACS_INT size;
553 DECLARE_INTERVALS /* `data' field must be last. */ 555 DECLARE_INTERVALS /* `data' field must be last. */
554 unsigned char data[1]; 556 unsigned char data[1];
555 }; 557 };
556 558
557 struct Lisp_Vector 559 struct Lisp_Vector
558 { 560 {
559 int size; 561 EMACS_INT size;
560 struct Lisp_Vector *next; 562 struct Lisp_Vector *next;
561 Lisp_Object contents[1]; 563 Lisp_Object contents[1];
562 }; 564 };
563 565
564 /* In a symbol, the markbit of the plist is used as the gc mark bit */ 566 /* In a symbol, the markbit of the plist is used as the gc mark bit */