Mercurial > emacs
comparison src/lisp.h @ 28417:4b675266db04
* lisp.h (XCONS, XSTRING, XSYMBOL, XFLOAT, XPROCESS, XWINDOW, XSUBR, XBUFFER):
Verify correct object type before returning pointer, using eassert.
* frame.h (XFRAME): Likewise.
* buffer.c (Frename_buffer, Fset_buffer_multibyte,
swap_out_buffer_local_variables, Fmove_overlay): Don't apply XSYMBOL, XBUFFER,
etc, to values that may be nil or of the wrong type.
* data.c (set_internal): Likewise.
* dispextern.h (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Likewise.
* fileio.c (auto_save_1): Likewise.
* insdel.c (check_markers): Likewise.
* marker.c (buf_charpos_to_bytepos, unchain_marker): Likewise.
* undo.c (record_insert): Likewise.
* vmsproc.c (child_sig): Likewise.
* window.c (unshow_buffer, window_loop): Likewise.
* xterm.c (x_erase_phys_cursor): Likewise.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Thu, 30 Mar 2000 09:56:31 +0000 |
parents | e5083ae09338 |
children | f805ef5a2a03 |
comparison
equal
deleted
inserted
replaced
28416:24ba809218ad | 28417:4b675266db04 |
---|---|
430 | 430 |
431 #endif /* NO_UNION_TYPE */ | 431 #endif /* NO_UNION_TYPE */ |
432 | 432 |
433 /* Extract a value or address from a Lisp_Object. */ | 433 /* Extract a value or address from a Lisp_Object. */ |
434 | 434 |
435 #define XCONS(a) ((struct Lisp_Cons *) XPNTR(a)) | 435 #define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a)) |
436 #define XVECTOR(a) ((struct Lisp_Vector *) XPNTR(a)) | 436 #define XVECTOR(a) ((struct Lisp_Vector *) XPNTR(a)) |
437 #define XSTRING(a) ((struct Lisp_String *) XPNTR(a)) | 437 #define XSTRING(a) (eassert (GC_STRINGP(a)),(struct Lisp_String *) XPNTR(a)) |
438 #define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a)) | 438 #define XSYMBOL(a) (eassert (GC_SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a)) |
439 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) | 439 #define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) |
440 | 440 |
441 /* Misc types. */ | 441 /* Misc types. */ |
442 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) | 442 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) |
443 #define XMISCTYPE(a) (XMARKER (a)->type) | 443 #define XMISCTYPE(a) (XMARKER (a)->type) |
444 #define XMARKER(a) (&(XMISC(a)->u_marker)) | 444 #define XMARKER(a) (&(XMISC(a)->u_marker)) |
449 #define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value)) | 449 #define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value)) |
450 #define XOVERLAY(a) (&(XMISC(a)->u_overlay)) | 450 #define XOVERLAY(a) (&(XMISC(a)->u_overlay)) |
451 #define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) | 451 #define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) |
452 | 452 |
453 /* Pseudovector types. */ | 453 /* Pseudovector types. */ |
454 #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a)) | 454 #define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) |
455 #define XWINDOW(a) ((struct window *) XPNTR(a)) | 455 #define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a)) |
456 #define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a)) | 456 #define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) |
457 #define XBUFFER(a) ((struct buffer *) XPNTR(a)) | 457 #define XBUFFER(a) (eassert (GC_BUFFERP(a)),(struct buffer *) XPNTR(a)) |
458 #define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a)) | 458 #define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a)) |
459 #define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a)) | 459 #define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a)) |
460 | 460 |
461 | 461 |
462 /* Construct a Lisp_Object from a value or address. */ | 462 /* Construct a Lisp_Object from a value or address. */ |