Commit e9ebc175 authored by Karl Heuer's avatar Karl Heuer
Browse files

(wrong_type_argument, Fconsp, Fatom, Flistp, Fnlistp, Fsymbolp, Fvectorp,

Fstringp, Farrayp, Fsequencep, Fbufferp, Fmarkerp, Fsubrp,
Fbyte_code_function_p, Fchar_or_string_p, Fintegerp, Finteger_or_marker_p,
Fnatnump, Fnumber_or_marker_p, Ffloatp, Fcar, Fcar_safe, Fcdr, Fcdr_safe,
Fsetcar, Fsetcdr, Fboundp, Ffboundp, store_symval_forwarding, Fset,
default_value, Fdefault_boundp, Fdefault_value, Fset_default,
Fmake_variable_buffer_local, Fmake_local_variable, Fkill_local_variable,
indirect_function, Faref, Faset, Farray_length, arithcompare, Fzerop,
Fnumber_to_string, arith_driver, float_arith_driver, Fmod, Fadd1, Fsub1): Use
type test macros.
parent a7a60ce9
...@@ -95,10 +95,10 @@ wrong_type_argument (predicate, value) ...@@ -95,10 +95,10 @@ wrong_type_argument (predicate, value)
{ {
if (!EQ (Vmocklisp_arguments, Qt)) if (!EQ (Vmocklisp_arguments, Qt))
{ {
if (XTYPE (value) == Lisp_String && if (STRINGP (value) &&
(EQ (predicate, Qintegerp) || EQ (predicate, Qinteger_or_marker_p))) (EQ (predicate, Qintegerp) || EQ (predicate, Qinteger_or_marker_p)))
return Fstring_to_number (value); return Fstring_to_number (value);
if (XTYPE (value) == Lisp_Int && EQ (predicate, Qstringp)) if (INTEGERP (value) && EQ (predicate, Qstringp))
return Fnumber_to_string (value); return Fnumber_to_string (value);
} }
value = Fsignal (Qwrong_type_argument, Fcons (predicate, Fcons (value, Qnil))); value = Fsignal (Qwrong_type_argument, Fcons (predicate, Fcons (value, Qnil)));
...@@ -180,7 +180,7 @@ DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0, "T if OBJECT is a cons cell.") ...@@ -180,7 +180,7 @@ DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0, "T if OBJECT is a cons cell.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Cons) if (CONSP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -189,7 +189,7 @@ DEFUN ("atom", Fatom, Satom, 1, 1, 0, "T if OBJECT is not a cons cell. This inc ...@@ -189,7 +189,7 @@ DEFUN ("atom", Fatom, Satom, 1, 1, 0, "T if OBJECT is not a cons cell. This inc
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Cons) if (CONSP (obj))
return Qnil; return Qnil;
return Qt; return Qt;
} }
...@@ -198,7 +198,7 @@ DEFUN ("listp", Flistp, Slistp, 1, 1, 0, "T if OBJECT is a list. This includes ...@@ -198,7 +198,7 @@ DEFUN ("listp", Flistp, Slistp, 1, 1, 0, "T if OBJECT is a list. This includes
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Cons || NILP (obj)) if (CONSP (obj) || NILP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -207,7 +207,7 @@ DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, "T if OBJECT is not a list. Lists i ...@@ -207,7 +207,7 @@ DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, "T if OBJECT is not a list. Lists i
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Cons || NILP (obj)) if (CONSP (obj) || NILP (obj))
return Qnil; return Qnil;
return Qt; return Qt;
} }
...@@ -216,7 +216,7 @@ DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0, "T if OBJECT is a symbol.") ...@@ -216,7 +216,7 @@ DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0, "T if OBJECT is a symbol.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Symbol) if (SYMBOLP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -225,7 +225,7 @@ DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, "T if OBJECT is a vector.") ...@@ -225,7 +225,7 @@ DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, "T if OBJECT is a vector.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Vector) if (VECTORP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -234,7 +234,7 @@ DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0, "T if OBJECT is a string.") ...@@ -234,7 +234,7 @@ DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0, "T if OBJECT is a string.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_String) if (STRINGP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -243,7 +243,7 @@ DEFUN ("arrayp", Farrayp, Sarrayp, 1, 1, 0, "T if OBJECT is an array (string or ...@@ -243,7 +243,7 @@ DEFUN ("arrayp", Farrayp, Sarrayp, 1, 1, 0, "T if OBJECT is an array (string or
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Vector || XTYPE (obj) == Lisp_String) if (VECTORP (obj) || STRINGP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -253,8 +253,7 @@ DEFUN ("sequencep", Fsequencep, Ssequencep, 1, 1, 0, ...@@ -253,8 +253,7 @@ DEFUN ("sequencep", Fsequencep, Ssequencep, 1, 1, 0,
(obj) (obj)
register Lisp_Object obj; register Lisp_Object obj;
{ {
if (CONSP (obj) || NILP (obj) || if (CONSP (obj) || NILP (obj) || VECTORP (obj) || STRINGP (obj))
XTYPE (obj) == Lisp_Vector || XTYPE (obj) == Lisp_String)
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -263,7 +262,7 @@ DEFUN ("bufferp", Fbufferp, Sbufferp, 1, 1, 0, "T if OBJECT is an editor buffer. ...@@ -263,7 +262,7 @@ DEFUN ("bufferp", Fbufferp, Sbufferp, 1, 1, 0, "T if OBJECT is an editor buffer.
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Buffer) if (BUFFERP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -272,7 +271,7 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, "T if OBJECT is a marker (editor ...@@ -272,7 +271,7 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, "T if OBJECT is a marker (editor
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Marker) if (MARKERP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -281,7 +280,7 @@ DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, "T if OBJECT is a built-in function.") ...@@ -281,7 +280,7 @@ DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, "T if OBJECT is a built-in function.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Subr) if (SUBRP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -291,7 +290,7 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p, ...@@ -291,7 +290,7 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Compiled) if (COMPILEDP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -301,7 +300,7 @@ DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0, ...@@ -301,7 +300,7 @@ DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0,
(obj) (obj)
register Lisp_Object obj; register Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Int || XTYPE (obj) == Lisp_String) if (INTEGERP (obj) || STRINGP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -310,7 +309,7 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, "T if OBJECT is an integer.") ...@@ -310,7 +309,7 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, "T if OBJECT is an integer.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Int) if (INTEGERP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -320,7 +319,7 @@ DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, ...@@ -320,7 +319,7 @@ DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1,
(obj) (obj)
register Lisp_Object obj; register Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Marker || XTYPE (obj) == Lisp_Int) if (MARKERP (obj) || INTEGERP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -330,7 +329,7 @@ DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, ...@@ -330,7 +329,7 @@ DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Int && XINT (obj) >= 0) if (INTEGERP (obj) && XINT (obj) >= 0)
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -352,8 +351,7 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p, ...@@ -352,8 +351,7 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (NUMBERP (obj) if (NUMBERP (obj) || MARKERP (obj))
|| XTYPE (obj) == Lisp_Marker)
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -364,7 +362,7 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0, ...@@ -364,7 +362,7 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Float) if (FLOATP (obj))
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -380,7 +378,7 @@ Error if arg is not nil and not a cons cell. See also `car-safe'.") ...@@ -380,7 +378,7 @@ Error if arg is not nil and not a cons cell. See also `car-safe'.")
{ {
while (1) while (1)
{ {
if (XTYPE (list) == Lisp_Cons) if (CONSP (list))
return XCONS (list)->car; return XCONS (list)->car;
else if (EQ (list, Qnil)) else if (EQ (list, Qnil))
return Qnil; return Qnil;
...@@ -394,7 +392,7 @@ DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0, ...@@ -394,7 +392,7 @@ DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0,
(object) (object)
Lisp_Object object; Lisp_Object object;
{ {
if (XTYPE (object) == Lisp_Cons) if (CONSP (object))
return XCONS (object)->car; return XCONS (object)->car;
else else
return Qnil; return Qnil;
...@@ -409,7 +407,7 @@ Error if arg is not nil and not a cons cell. See also `cdr-safe'.") ...@@ -409,7 +407,7 @@ Error if arg is not nil and not a cons cell. See also `cdr-safe'.")
{ {
while (1) while (1)
{ {
if (XTYPE (list) == Lisp_Cons) if (CONSP (list))
return XCONS (list)->cdr; return XCONS (list)->cdr;
else if (EQ (list, Qnil)) else if (EQ (list, Qnil))
return Qnil; return Qnil;
...@@ -423,7 +421,7 @@ DEFUN ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0, ...@@ -423,7 +421,7 @@ DEFUN ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0,
(object) (object)
Lisp_Object object; Lisp_Object object;
{ {
if (XTYPE (object) == Lisp_Cons) if (CONSP (object))
return XCONS (object)->cdr; return XCONS (object)->cdr;
else else
return Qnil; return Qnil;
...@@ -434,7 +432,7 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, ...@@ -434,7 +432,7 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
(cell, newcar) (cell, newcar)
register Lisp_Object cell, newcar; register Lisp_Object cell, newcar;
{ {
if (XTYPE (cell) != Lisp_Cons) if (!CONSP (cell))
cell = wrong_type_argument (Qconsp, cell); cell = wrong_type_argument (Qconsp, cell);
CHECK_IMPURE (cell); CHECK_IMPURE (cell);
...@@ -447,7 +445,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, ...@@ -447,7 +445,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
(cell, newcdr) (cell, newcdr)
register Lisp_Object cell, newcdr; register Lisp_Object cell, newcdr;
{ {
if (XTYPE (cell) != Lisp_Cons) if (!CONSP (cell))
cell = wrong_type_argument (Qconsp, cell); cell = wrong_type_argument (Qconsp, cell);
CHECK_IMPURE (cell); CHECK_IMPURE (cell);
...@@ -477,7 +475,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, "T if SYMBOL's value is not void.") ...@@ -477,7 +475,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, "T if SYMBOL's value is not void.")
valcontents = swap_in_symval_forwarding (sym, valcontents); valcontents = swap_in_symval_forwarding (sym, valcontents);
} }
return (XTYPE (valcontents) == Lisp_Void || EQ (valcontents, Qunbound) return (VOIDP (valcontents) || EQ (valcontents, Qunbound)
? Qnil : Qt); ? Qnil : Qt);
} }
...@@ -486,9 +484,9 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, "T if SYMBOL's function definitio ...@@ -486,9 +484,9 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, "T if SYMBOL's function definitio
register Lisp_Object sym; register Lisp_Object sym;
{ {
CHECK_SYMBOL (sym, 0); CHECK_SYMBOL (sym, 0);
return (XTYPE (XSYMBOL (sym)->function) == Lisp_Void return ((VOIDP (XSYMBOL (sym)->function)
|| EQ (XSYMBOL (sym)->function, Qunbound)) || EQ (XSYMBOL (sym)->function, Qunbound))
? Qnil : Qt; ? Qnil : Qt);
} }
DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, "Make SYMBOL's value be void.") DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, "Make SYMBOL's value be void.")
...@@ -701,8 +699,8 @@ store_symval_forwarding (sym, valcontents, newval) ...@@ -701,8 +699,8 @@ store_symval_forwarding (sym, valcontents, newval)
default: default:
valcontents = XSYMBOL (sym)->value; valcontents = XSYMBOL (sym)->value;
if (XTYPE (valcontents) == Lisp_Buffer_Local_Value if (BUFFER_LOCAL_VALUEP (valcontents)
|| XTYPE (valcontents) == Lisp_Some_Buffer_Local_Value) || SOME_BUFFER_LOCAL_VALUEP (valcontents))
XCONS (XSYMBOL (sym)->value)->car = newval; XCONS (XSYMBOL (sym)->value)->car = newval;
else else
XSYMBOL (sym)->value = newval; XSYMBOL (sym)->value = newval;
...@@ -819,7 +817,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, ...@@ -819,7 +817,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
(sym, newval) (sym, newval)
register Lisp_Object sym, newval; register Lisp_Object sym, newval;
{ {
int voide = (XTYPE (newval) == Lisp_Void || EQ (newval, Qunbound)); int voide = (VOIDP (newval) || EQ (newval, Qunbound));
register Lisp_Object valcontents, tem1, current_alist_element; register Lisp_Object valcontents, tem1, current_alist_element;
...@@ -828,7 +826,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, ...@@ -828,7 +826,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
return Fsignal (Qsetting_constant, Fcons (sym, Qnil)); return Fsignal (Qsetting_constant, Fcons (sym, Qnil));
valcontents = XSYMBOL (sym)->value; valcontents = XSYMBOL (sym)->value;
if (XTYPE (valcontents) == Lisp_Buffer_Objfwd) if (BUFFER_OBJFWDP (valcontents))
{ {
register int idx = XUINT (valcontents); register int idx = XUINT (valcontents);
register int mask = *(int *)(idx + (char *) &buffer_local_flags); register int mask = *(int *)(idx + (char *) &buffer_local_flags);
...@@ -836,8 +834,8 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, ...@@ -836,8 +834,8 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
current_buffer->local_var_flags |= mask; current_buffer->local_var_flags |= mask;
} }
else if (XTYPE (valcontents) == Lisp_Buffer_Local_Value else if (BUFFER_LOCAL_VALUEP (valcontents)
|| XTYPE (valcontents) == Lisp_Some_Buffer_Local_Value) || SOME_BUFFER_LOCAL_VALUEP (valcontents))
{ {
/* valcontents is actually a pointer to a cons heading something like: /* valcontents is actually a pointer to a cons heading something like:
(REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE).
...@@ -876,7 +874,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, ...@@ -876,7 +874,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
need to write it out, and find the new CURRENT-ALIST-ELEMENT. */ need to write it out, and find the new CURRENT-ALIST-ELEMENT. */
if ((current_buffer if ((current_buffer
!= XBUFFER (XCONS (XCONS (valcontents)->cdr)->car)) != XBUFFER (XCONS (XCONS (valcontents)->cdr)->car))
|| (XTYPE (valcontents) == Lisp_Buffer_Local_Value || (BUFFER_LOCAL_VALUEP (valcontents)
&& EQ (XCONS (current_alist_element)->car, && EQ (XCONS (current_alist_element)->car,
current_alist_element))) current_alist_element)))
{ {
...@@ -895,7 +893,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, ...@@ -895,7 +893,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
/* If the variable is a Lisp_Some_Buffer_Local_Value, /* If the variable is a Lisp_Some_Buffer_Local_Value,
make CURRENT-ALIST-ELEMENT point to itself, make CURRENT-ALIST-ELEMENT point to itself,
indicating that we're seeing the default value. */ indicating that we're seeing the default value. */
if (XTYPE (valcontents) == Lisp_Some_Buffer_Local_Value) if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
tem1 = XCONS (XCONS (valcontents)->cdr)->cdr; tem1 = XCONS (XCONS (valcontents)->cdr)->cdr;
/* If it's a Lisp_Buffer_Local_Value, give this buffer a /* If it's a Lisp_Buffer_Local_Value, give this buffer a
...@@ -944,7 +942,7 @@ default_value (sym) ...@@ -944,7 +942,7 @@ default_value (sym)
/* For a built-in buffer-local variable, get the default value /* For a built-in buffer-local variable, get the default value
rather than letting do_symval_forwarding get the current value. */ rather than letting do_symval_forwarding get the current value. */
if (XTYPE (valcontents) == Lisp_Buffer_Objfwd) if (BUFFER_OBJFWDP (valcontents))
{ {
register int idx = XUINT (valcontents); register int idx = XUINT (valcontents);
...@@ -953,8 +951,8 @@ default_value (sym) ...@@ -953,8 +951,8 @@ default_value (sym)
} }
/* Handle user-created local variables. */ /* Handle user-created local variables. */
if (XTYPE (valcontents) == Lisp_Buffer_Local_Value if (BUFFER_LOCAL_VALUEP (valcontents)
|| XTYPE (valcontents) == Lisp_Some_Buffer_Local_Value) || SOME_BUFFER_LOCAL_VALUEP (valcontents))
{ {
/* If var is set up for a buffer that lacks a local value for it, /* If var is set up for a buffer that lacks a local value for it,
the current value is nominally the default value. the current value is nominally the default value.
...@@ -983,7 +981,7 @@ for this variable.") ...@@ -983,7 +981,7 @@ for this variable.")
register Lisp_Object value; register Lisp_Object value;
value = default_value (sym); value = default_value (sym);
return (XTYPE (value) == Lisp_Void || EQ (value, Qunbound) return (VOIDP (value) || EQ (value, Qunbound)
? Qnil : Qt); ? Qnil : Qt);
} }
...@@ -998,7 +996,7 @@ local bindings in certain buffers.") ...@@ -998,7 +996,7 @@ local bindings in certain buffers.")
register Lisp_Object value; register Lisp_Object value;
value = default_value (sym); value = default_value (sym);
if (XTYPE (value) == Lisp_Void || EQ (value, Qunbound)) if (VOIDP (value) || EQ (value, Qunbound))
return Fsignal (Qvoid_variable, Fcons (sym, Qnil)); return Fsignal (Qvoid_variable, Fcons (sym, Qnil));
return value; return value;
} }
...@@ -1018,7 +1016,7 @@ for this variable.") ...@@ -1018,7 +1016,7 @@ for this variable.")
/* Handle variables like case-fold-search that have special slots /* Handle variables like case-fold-search that have special slots
in the buffer. Make them work apparently like Lisp_Buffer_Local_Value in the buffer. Make them work apparently like Lisp_Buffer_Local_Value
variables. */ variables. */
if (XTYPE (valcontents) == Lisp_Buffer_Objfwd) if (BUFFER_OBJFWDP (valcontents))
{ {
register int idx = XUINT (valcontents); register int idx = XUINT (valcontents);
register struct buffer *b; register struct buffer *b;
...@@ -1034,8 +1032,8 @@ for this variable.") ...@@ -1034,8 +1032,8 @@ for this variable.")
return value; return value;
} }
if (XTYPE (valcontents) != Lisp_Buffer_Local_Value && if (!BUFFER_LOCAL_VALUEP (valcontents)
XTYPE (valcontents) != Lisp_Some_Buffer_Local_Value) && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
return Fset (sym, value); return Fset (sym, value);
/* Store new value into the DEFAULT-VALUE slot */ /* Store new value into the DEFAULT-VALUE slot */
...@@ -1110,10 +1108,9 @@ The function `default-value' gets the default value and `set-default' sets it.") ...@@ -1110,10 +1108,9 @@ The function `default-value' gets the default value and `set-default' sets it.")
error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data); error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
valcontents = XSYMBOL (sym)->value; valcontents = XSYMBOL (sym)->value;
if ((XTYPE (valcontents) == Lisp_Buffer_Local_Value) || if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
(XTYPE (valcontents) == Lisp_Buffer_Objfwd))
return sym; return sym;
if (XTYPE (valcontents) == Lisp_Some_Buffer_Local_Value) if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
{ {
XSETTYPE (XSYMBOL (sym)->value, Lisp_Buffer_Local_Value); XSETTYPE (XSYMBOL (sym)->value, Lisp_Buffer_Local_Value);
return sym; return sym;
...@@ -1148,8 +1145,7 @@ just as if the variable were set.") ...@@ -1148,8 +1145,7 @@ just as if the variable were set.")
error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data); error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
valcontents = XSYMBOL (sym)->value; valcontents = XSYMBOL (sym)->value;
if (XTYPE (valcontents) == Lisp_Buffer_Local_Value if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
|| XTYPE (valcontents) == Lisp_Buffer_Objfwd)
{ {
tem = Fboundp (sym); tem = Fboundp (sym);
...@@ -1159,7 +1155,7 @@ just as if the variable were set.") ...@@ -1159,7 +1155,7 @@ just as if the variable were set.")
return sym; return sym;
} }
/* Make sure sym is set up to hold per-buffer values */ /* Make sure sym is set up to hold per-buffer values */
if (XTYPE (valcontents) != Lisp_Some_Buffer_Local_Value) if (!SOME_BUFFER_LOCAL_VALUEP (valcontents))
{ {
tem = Fcons (Qnil, do_symval_forwarding (valcontents)); tem = Fcons (Qnil, do_symval_forwarding (valcontents));
XCONS (tem)->car = tem; XCONS (tem)->car = tem;
...@@ -1191,9 +1187,7 @@ just as if the variable were set.") ...@@ -1191,9 +1187,7 @@ just as if the variable were set.")
variable before we swap in, then that new value will clobber the variable before we swap in, then that new value will clobber the
default value the next time we swap. */ default value the next time we swap. */
valcontents = XCONS (XSYMBOL (sym)->value)->car; valcontents = XCONS (XSYMBOL (sym)->value)->car;
if (XTYPE (valcontents) == Lisp_Intfwd if (INTFWDP (valcontents) || BOOLFWDP (valcontents) || OBJFWDP (valcontents))
|| XTYPE (valcontents) == Lisp_Boolfwd
|| XTYPE (valcontents) == Lisp_Objfwd)
swap_in_symval_forwarding (sym, XSYMBOL (sym)->value); swap_in_symval_forwarding (sym, XSYMBOL (sym)->value);
return sym; return sym;
...@@ -1212,7 +1206,7 @@ From now on the default value will apply in this buffer.") ...@@ -1212,7 +1206,7 @@ From now on the default value will apply in this buffer.")
valcontents = XSYMBOL (sym)->value; valcontents = XSYMBOL (sym)->value;
if (XTYPE (valcontents) == Lisp_Buffer_Objfwd) if (BUFFER_OBJFWDP (valcontents))
{ {
register int idx = XUINT (valcontents); register int idx = XUINT (valcontents);
register int mask = *(int *) (idx + (char *) &buffer_local_flags); register int mask = *(int *) (idx + (char *) &buffer_local_flags);
...@@ -1226,8 +1220,8 @@ From now on the default value will apply in this buffer.") ...@@ -1226,8 +1220,8 @@ From now on the default value will apply in this buffer.")
return sym; return sym;
} }
if (XTYPE (valcontents) != Lisp_Buffer_Local_Value && if (!BUFFER_LOCAL_VALUEP (valcontents)
XTYPE (valcontents) != Lisp_Some_Buffer_Local_Value) && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
return sym; return sym;