X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsymeval.h;h=141430b881165546e1ab5bfb2494193ec7efb868;hb=7809a0afe735c5f3e27be40be2978c16d6ff3a1d;hp=df25cab888dfd2b78a24cfdfc557c968ce8e0ee3;hpb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;p=chise%2Fxemacs-chise.git.1 diff --git a/src/symeval.h b/src/symeval.h index df25cab..141430b 100644 --- a/src/symeval.h +++ b/src/symeval.h @@ -31,7 +31,7 @@ enum symbol_value_type { /* The following tags use the 'symbol_value_forward' structure and are strictly for variables DEFVARed on the C level. */ - SYMVAL_FIXNUM_FORWARD, /* Forward C "int" */ + SYMVAL_FIXNUM_FORWARD, /* Forward C "Fixnum", really "EMACS_INT" */ SYMVAL_CONST_FIXNUM_FORWARD, /* Same, but can't be set */ SYMVAL_BOOLEAN_FORWARD, /* Forward C boolean ("int") */ SYMVAL_CONST_BOOLEAN_FORWARD, /* Same, but can't be set */ @@ -70,6 +70,9 @@ enum symbol_value_type #endif }; +/* Underlying C type used to implement DEFVAR_INT */ +typedef EMACS_INT Fixnum; + struct symbol_value_magic { struct lcrecord_header lcheader; @@ -345,13 +348,21 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{ \ DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ - dumpopaque (c_location, sizeof(int)); \ + dump_add_opaque_int (c_location); \ +} while (0) + +#define DEFVAR_SYMVAL_FWD_FIXNUM(lname, c_location, forward_type, magicfun) do{ \ + DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ + dump_add_opaque_fixnum (c_location); \ } while (0) -#define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ +#define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ - staticpro (c_location); \ - if (EQ (*c_location, Qnull_pointer)) *c_location = Qnil; \ + { \ + Lisp_Object *DSF_location = c_location; /* Type check */ \ + staticpro (DSF_location); \ + if (EQ (*DSF_location, Qnull_pointer)) *DSF_location = Qnil; \ + } \ } while (0) #define DEFVAR_LISP(lname, c_location) \ @@ -361,9 +372,9 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_SPECIFIER(lname, c_location) \ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0) #define DEFVAR_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) #define DEFVAR_CONST_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) #define DEFVAR_BOOL(lname, c_location) \ DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0) #define DEFVAR_CONST_BOOL(lname, c_location) \ @@ -371,7 +382,7 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun) #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \ DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun)