X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fconsole.c;h=7e27f8614b6186171e5c10e88396b3dcdfe807d2;hb=debb7eb5baa3e6aae77e4fc0b7704887baf3006e;hp=7190364924bbc96d874dc8c13619926ec36ade38;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git diff --git a/src/console.c b/src/console.c index 7190364..7e27f86 100644 --- a/src/console.c +++ b/src/console.c @@ -100,14 +100,14 @@ mark_console (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct console *con = XCONSOLE (obj); -#define MARKED_SLOT(x) ((markobj) (con->x)); +#define MARKED_SLOT(x) ((void) (markobj (con->x))); #include "conslots.h" #undef MARKED_SLOT /* Can be zero for Vconsole_defaults, Vconsole_local_symbols */ if (con->conmeths) { - ((markobj) (con->conmeths->symbol)); + markobj (con->conmeths->symbol); MAYBE_CONMETH (con, mark_console, (con, markobj)); } @@ -137,14 +137,14 @@ print_console (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) } DEFINE_LRECORD_IMPLEMENTATION ("console", console, - mark_console, print_console, 0, 0, 0, + mark_console, print_console, 0, 0, 0, 0, struct console); static struct console * allocate_console (void) { Lisp_Object console; - struct console *con = alloc_lcrecord_type (struct console, lrecord_console); + struct console *con = alloc_lcrecord_type (struct console, &lrecord_console); struct gcpro gcpro1; copy_lcrecord (con, XCONSOLE (Vconsole_defaults)); @@ -285,7 +285,7 @@ void set_console_last_nonminibuf_frame (struct console *con, Lisp_Object frame) { - con->_last_nonminibuf_frame = frame; + con->last_nonminibuf_frame = frame; } DEFUN ("consolep", Fconsolep, 1, 1, 0, /* @@ -1141,71 +1141,43 @@ One argument, the to-be-deleted console. #endif } -/* DOC is ignored because it is snagged and recorded externally - * by make-docfile */ +/* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ + /* Declaring this stuff as const produces 'Cannot reinitialize' messages from SunPro C's fix-and-continue feature (a way neato feature that makes debugging unbelievably more bearable) */ -#define DEFVAR_CONSOLE_LOCAL(lname, field_name) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_SELECTED_CONSOLE_FORWARD }, 0 }; \ - defvar_console_local ((lname), &I_hate_C); \ -} while (0) - -#define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_SELECTED_CONSOLE_FORWARD }, magicfun }; \ - defvar_console_local ((lname), &I_hate_C); \ -} while (0) - -#define DEFVAR_CONST_CONSOLE_LOCAL(lname, field_name) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_CONST_SELECTED_CONSOLE_FORWARD }, 0 }; \ - defvar_console_local ((lname), &I_hate_C); \ -} while (0) - -#define DEFVAR_CONST_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_CONST_SELECTED_CONSOLE_FORWARD }, magicfun }; \ - defvar_console_local ((lname), &I_hate_C); \ -} while (0) - -#define DEFVAR_CONSOLE_DEFAULTS(lname, field_name) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_DEFAULT_CONSOLE_FORWARD }, 0 }; \ - defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ -} while (0) - -#define DEFVAR_CONSOLE_DEFAULTS_MAGIC(lname, field_name, magicfun) do { \ -static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - SYMVAL_DEFAULT_CONSOLE_FORWARD }, magicfun }; \ - defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ +#define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) do { \ + static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ + forward_type }, magicfun }; \ + { \ + int offset = ((char *)symbol_value_forward_forward (&I_hate_C) \ + - (char *)&console_local_flags); \ + \ + defvar_magic (lname, &I_hate_C); \ + \ + *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \ + = intern (lname); \ + } \ } while (0) -static void -defvar_console_local (CONST char *namestring, - CONST struct symbol_value_forward *m) -{ - int offset = ((char *)symbol_value_forward_forward (m) - - (char *)&console_local_flags); - - defvar_mumble (namestring, m, sizeof (*m)); - - *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) - = intern (namestring); -} +#define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \ + DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \ + SYMVAL_SELECTED_CONSOLE_FORWARD, magicfun) +#define DEFVAR_CONSOLE_LOCAL(lname, field_name) \ + DEFVAR_CONSOLE_LOCAL_MAGIC (lname, field_name, 0) +#define DEFVAR_CONST_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \ + DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \ + SYMVAL_CONST_SELECTED_CONSOLE_FORWARD, magicfun) +#define DEFVAR_CONST_CONSOLE_LOCAL(lname, field_name) \ + DEFVAR_CONST_CONSOLE_LOCAL_MAGIC (lname, field_name, 0) + +#define DEFVAR_CONSOLE_DEFAULTS_MAGIC(lname, field_name, magicfun) \ + DEFVAR_SYMVAL_FWD(lname, &(console_local_flags.field_name), \ + SYMVAL_DEFAULT_CONSOLE_FORWARD, magicfun) +#define DEFVAR_CONSOLE_DEFAULTS(lname, field_name) \ + DEFVAR_CONSOLE_DEFAULTS_MAGIC (lname, field_name, 0) static void nuke_all_console_slots (struct console *con, Lisp_Object zap) @@ -1223,8 +1195,8 @@ complex_vars_of_console (void) /* Make sure all markable slots in console_defaults are initialized reasonably, so mark_console won't choke. */ - struct console *defs = alloc_lcrecord_type (struct console, lrecord_console); - struct console *syms = alloc_lcrecord_type (struct console, lrecord_console); + struct console *defs = alloc_lcrecord_type (struct console, &lrecord_console); + struct console *syms = alloc_lcrecord_type (struct console, &lrecord_console); staticpro (&Vconsole_defaults); staticpro (&Vconsole_local_symbols);