Declare Lisp_Object Q* variables to be 'static' if not exproted.
[bpt/emacs.git] / src / data.c
index 31cf0fc..68ceff4 100644 (file)
@@ -1,6 +1,5 @@
 /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
-                 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2011
                  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -53,26 +52,33 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 extern double atof (const char *);
 #endif /* !atof */
 
-Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
+Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
+static Lisp_Object Qsubr;
 Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
-Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range;
-Lisp_Object Qvoid_variable, Qvoid_function, Qcyclic_function_indirection;
-Lisp_Object Qcyclic_variable_indirection, Qcircular_list;
-Lisp_Object Qsetting_constant, Qinvalid_read_syntax;
+Lisp_Object Qerror, Qquit, Qargs_out_of_range;
+static Lisp_Object Qwrong_type_argument;
+Lisp_Object Qvoid_variable, Qvoid_function;
+static Lisp_Object Qcyclic_function_indirection;
+static Lisp_Object Qcyclic_variable_indirection;
+Lisp_Object Qcircular_list;
+static Lisp_Object Qsetting_constant;
+Lisp_Object Qinvalid_read_syntax;
 Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
 Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 Lisp_Object Qtext_read_only;
 
-Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp;
+Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
+static Lisp_Object Qnatnump;
 Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
 Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
-Lisp_Object Qbuffer_or_string_p, Qkeywordp;
-Lisp_Object Qboundp, Qfboundp;
+Lisp_Object Qbuffer_or_string_p;
+static Lisp_Object Qkeywordp, Qboundp;
+Lisp_Object Qfboundp;
 Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 
 Lisp_Object Qcdr;
-Lisp_Object Qad_advice_info, Qad_activate_internal;
+static Lisp_Object Qad_advice_info, Qad_activate_internal;
 
 Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
 Lisp_Object Qoverflow_error, Qunderflow_error;
@@ -84,7 +90,7 @@ Lisp_Object Qinteger;
 static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay;
 Lisp_Object Qwindow;
 static Lisp_Object Qfloat, Qwindow_configuration;
-Lisp_Object Qprocess;
+static Lisp_Object Qprocess;
 static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
 static Lisp_Object Qchar_table, Qbool_vector, Qhash_table;
 static Lisp_Object Qsubrp, Qmany, Qunevalled;
@@ -94,8 +100,6 @@ Lisp_Object Qinteractive_form;
 
 static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *);
 
-Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum;
-
 
 void
 circular_list_error (Lisp_Object list)
@@ -465,7 +469,7 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
 \f
 /* Extract and set components of lists */
 
-DEFUN ("car", Fcar, Scar, 1, 1, 0,
+DEFUE ("car", Fcar, Scar, 1, 1, 0,
        doc: /* Return the car of LIST.  If arg is nil, return nil.
 Error if arg is not nil and not a cons cell.  See also `car-safe'.
 
@@ -476,14 +480,14 @@ Lisp concepts such as car, cdr, cons cell and list.  */)
   return CAR (list);
 }
 
-DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0,
+DEFUE ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0,
        doc: /* Return the car of OBJECT if it is a cons cell, or else nil.  */)
   (Lisp_Object object)
 {
   return CAR_SAFE (object);
 }
 
-DEFUN ("cdr", Fcdr, Scdr, 1, 1, 0,
+DEFUE ("cdr", Fcdr, Scdr, 1, 1, 0,
        doc: /* Return the cdr of LIST.  If arg is nil, return nil.
 Error if arg is not nil and not a cons cell.  See also `cdr-safe'.
 
@@ -494,14 +498,14 @@ Lisp concepts such as cdr, car, cons cell and list.  */)
   return CDR (list);
 }
 
-DEFUN ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0,
+DEFUE ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0,
        doc: /* Return the cdr of OBJECT if it is a cons cell, or else nil.  */)
   (Lisp_Object object)
 {
   return CDR_SAFE (object);
 }
 
-DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
+DEFUE ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
        doc: /* Set the car of CELL to be NEWCAR.  Returns NEWCAR.  */)
   (register Lisp_Object cell, Lisp_Object newcar)
 {
@@ -511,7 +515,7 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
   return newcar;
 }
 
-DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
+DEFUE ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
        doc: /* Set the cdr of CELL to be NEWCDR.  Returns NEWCDR.  */)
   (register Lisp_Object cell, Lisp_Object newcdr)
 {
@@ -523,7 +527,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
 \f
 /* Extract and set components of symbols */
 
-DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
+DEFUE ("boundp", Fboundp, Sboundp, 1, 1, 0,
        doc: /* Return t if SYMBOL's value is not void.  */)
   (register Lisp_Object symbol)
 {
@@ -561,7 +565,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
   return (EQ (valcontents, Qunbound) ? Qnil : Qt);
 }
 
-DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
+DEFUE ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
        doc: /* Return t if SYMBOL's function definition is not void.  */)
   (register Lisp_Object symbol)
 {
@@ -593,7 +597,7 @@ Return SYMBOL.  */)
   return symbol;
 }
 
-DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
+DEFUE ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
        doc: /* Return SYMBOL's function definition.  Error if that is void.  */)
   (register Lisp_Object symbol)
 {
@@ -611,7 +615,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
   return XSYMBOL (symbol)->plist;
 }
 
-DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
+DEFUE ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
        doc: /* Return SYMBOL's name, a string.  */)
   (register Lisp_Object symbol)
 {
@@ -622,7 +626,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
   return name;
 }
 
-DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
+DEFUE ("fset", Ffset, Sfset, 2, 2, 0,
        doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION.  */)
   (register Lisp_Object symbol, Lisp_Object definition)
 {
@@ -709,7 +713,7 @@ SUBR must be a built-in function.  */)
   return make_string (name, strlen (name));
 }
 
-DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
+DEFUE ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
        doc: /* Return the interactive form of CMD or nil if none.
 If CMD is not a command, the return value is nil.
 Value, if non-nil, is a list \(interactive SPEC).  */)
@@ -748,7 +752,9 @@ Value, if non-nil, is a list \(interactive SPEC).  */)
   else if (CONSP (fun))
     {
       Lisp_Object funcar = XCAR (fun);
-      if (EQ (funcar, Qlambda))
+      if (EQ (funcar, Qclosure))
+       return Fassq (Qinteractive, Fcdr (Fcdr (XCDR (fun))));
+      else if (EQ (funcar, Qlambda))
        return Fassq (Qinteractive, Fcdr (XCDR (fun)));
       else if (EQ (funcar, Qautoload))
        {
@@ -808,7 +814,10 @@ variable chain of symbols.  */)
   (Lisp_Object object)
 {
   if (SYMBOLP (object))
-    XSETSYMBOL (object,  indirect_variable (XSYMBOL (object)));
+    {
+      struct Lisp_Symbol *sym = indirect_variable (XSYMBOL (object));
+      XSETSYMBOL (object, sym);
+    }
   return object;
 }
 
@@ -818,9 +827,6 @@ variable chain of symbols.  */)
    This does not handle buffer-local variables; use
    swap_in_symval_forwarding for that.  */
 
-#define do_blv_forwarding(blv) \
-  ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
-
 Lisp_Object
 do_symval_forwarding (register union Lisp_Fwd *valcontents)
 {
@@ -867,14 +873,6 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
    BUF non-zero means set the value in buffer BUF instead of the
    current buffer.  This only plays a role for per-buffer variables.  */
 
-#define store_blv_forwarding(blv, newval, buf)                 \
-  do {                                                         \
-    if ((blv)->forwarded)                                      \
-      store_symval_forwarding (BLV_FWD (blv), (newval), (buf));        \
-    else                                                       \
-      SET_BLV_VALUE (blv, newval);                             \
-  } while (0)
-
 static void
 store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf)
 {
@@ -910,12 +908,12 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
 
          for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
            {
-             Lisp_Object buf;
+             Lisp_Object lbuf;
              struct buffer *b;
 
-             buf = Fcdr (XCAR (tail));
-             if (!BUFFERP (buf)) continue;
-             b = XBUFFER (buf);
+             lbuf = Fcdr (XCAR (tail));
+             if (!BUFFERP (lbuf)) continue;
+             b = XBUFFER (lbuf);
 
              if (! PER_BUFFER_VALUE_P (b, idx))
                PER_BUFFER_VALUE (b, offset) = newval;
@@ -1012,7 +1010,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
          }
        else
          {
-           tem1 = assq_no_quit (var, current_buffer->local_var_alist);
+           tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist));
            XSETBUFFER (blv->where, current_buffer);
          }
       }
@@ -1058,7 +1056,7 @@ find_symbol_value (Lisp_Object symbol)
     }
 }
 
-DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
+DEFUE ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
        doc: /* Return SYMBOL's value.  Error if that is void.  */)
   (Lisp_Object symbol)
 {
@@ -1071,7 +1069,7 @@ DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
   xsignal1 (Qvoid_variable, symbol);
 }
 
-DEFUN ("set", Fset, Sset, 2, 2, 0,
+DEFUE ("set", Fset, Sset, 2, 2, 0,
        doc: /* Set SYMBOL's value to NEWVAL, and return NEWVAL.  */)
   (register Lisp_Object symbol, Lisp_Object newval)
 {
@@ -1181,7 +1179,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
            tem1 = Fassq (symbol,
                          (blv->frame_local
                           ? XFRAME (where)->param_alist
-                          : XBUFFER (where)->local_var_alist));
+                          : BVAR (XBUFFER (where), local_var_alist)));
            blv->where = where;
            blv->found = 1;
 
@@ -1212,8 +1210,8 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
                       bindings, not for frame-local bindings.  */
                    eassert (!blv->frame_local);
                    tem1 = Fcons (symbol, XCDR (blv->defcell));
-                   XBUFFER (where)->local_var_alist
-                     = Fcons (tem1, XBUFFER (where)->local_var_alist);
+                   BVAR (XBUFFER (where), local_var_alist)
+                     = Fcons (tem1, BVAR (XBUFFER (where), local_var_alist));
                  }
              }
 
@@ -1272,7 +1270,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
 /* Return the default value of SYMBOL, but don't check for voidness.
    Return Qunbound if it is void.  */
 
-Lisp_Object
+static Lisp_Object
 default_value (Lisp_Object symbol)
 {
   struct Lisp_Symbol *sym;
@@ -1317,7 +1315,7 @@ default_value (Lisp_Object symbol)
     }
 }
 
-DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
+DEFUE ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
        doc: /* Return t if SYMBOL has a non-void default value.
 This is the value that is seen in buffers that do not have their own values
 for this variable.  */)
@@ -1329,7 +1327,7 @@ for this variable.  */)
   return (EQ (value, Qunbound) ? Qnil : Qt);
 }
 
-DEFUN ("default-value", Fdefault_value, Sdefault_value, 1, 1, 0,
+DEFUE ("default-value", Fdefault_value, Sdefault_value, 1, 1, 0,
        doc: /* Return SYMBOL's default value.
 This is the value that is seen in buffers that do not have their own values
 for this variable.  The default value is meaningful for variables with
@@ -1345,7 +1343,7 @@ local bindings in certain buffers.  */)
   xsignal1 (Qvoid_variable, symbol);
 }
 
-DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0,
+DEFUE ("set-default", Fset_default, Sset_default, 2, 2, 0,
        doc: /* Set SYMBOL's default value to VALUE.  SYMBOL and VALUE are evaluated.
 The default value is seen in buffers that do not have their own values
 for this variable.  */)
@@ -1442,7 +1440,7 @@ usage: (setq-default [VAR VALUE]...)  */)
 
   do
     {
-      val = Feval (Fcar (Fcdr (args_left)));
+      val = eval_sub (Fcar (Fcdr (args_left)));
       symbol = XCAR (args_left);
       Fset_default (symbol, val);
       args_left = Fcdr (XCDR (args_left));
@@ -1488,8 +1486,8 @@ make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents
   return blv;
 }
 
-DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local,
-       1, 1, "vMake Variable Buffer Local: ",
+DEFUE ("make-variable-buffer-local", Fmake_variable_buffer_local,
+       Smake_variable_buffer_local, 1, 1, "vMake Variable Buffer Local: ",
        doc: /* Make VARIABLE become buffer-local whenever it is set.
 At any time, the value for the current buffer is in effect,
 unless the variable has never been set in this buffer,
@@ -1506,8 +1504,8 @@ The function `default-value' gets the default value and `set-default' sets it.
 {
   struct Lisp_Symbol *sym;
   struct Lisp_Buffer_Local_Value *blv = NULL;
-  union Lisp_Val_Fwd valcontents;
-  int forwarded;
+  union Lisp_Val_Fwd valcontents IF_LINT (= {0});
+  int forwarded IF_LINT (= 0);
 
   CHECK_SYMBOL (variable);
   sym = XSYMBOL (variable);
@@ -1559,7 +1557,7 @@ The function `default-value' gets the default value and `set-default' sets it.
   return variable;
 }
 
-DEFUN ("make-local-variable", Fmake_local_variable, Smake_local_variable,
+DEFUE ("make-local-variable", Fmake_local_variable, Smake_local_variable,
        1, 1, "vMake Local Variable: ",
        doc: /* Make VARIABLE have a separate value in the current buffer.
 Other buffers will continue to share a common default value.
@@ -1582,8 +1580,8 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
   (register Lisp_Object variable)
 {
   register Lisp_Object tem;
-  int forwarded;
-  union Lisp_Val_Fwd valcontents;
+  int forwarded IF_LINT (= 0);
+  union Lisp_Val_Fwd valcontents IF_LINT (= {0});
   struct Lisp_Symbol *sym;
   struct Lisp_Buffer_Local_Value *blv = NULL;
 
@@ -1635,13 +1633,13 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
        if (let_shadows_global_binding_p (symbol))
          message ("Making %s local to %s while let-bound!",
                   SDATA (SYMBOL_NAME (variable)),
-                  SDATA (current_buffer->name));
+                  SDATA (BVAR (current_buffer, name)));
       }
     }
 
   /* Make sure this buffer has its own value of symbol.  */
   XSETSYMBOL (variable, sym);  /* Update in case of aliasing.  */
-  tem = Fassq (variable, current_buffer->local_var_alist);
+  tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
   if (NILP (tem))
     {
       if (let_shadows_buffer_binding_p (sym))
@@ -1653,9 +1651,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
         default value.  */
       find_symbol_value (variable);
 
-      current_buffer->local_var_alist
+      BVAR (current_buffer, local_var_alist)
         = Fcons (Fcons (variable, XCDR (blv->defcell)),
-                current_buffer->local_var_alist);
+                BVAR (current_buffer, local_var_alist));
 
       /* Make sure symbol does not think it is set up for this buffer;
         force it to look once again for this buffer's value.  */
@@ -1721,10 +1719,10 @@ From now on the default value will apply in this buffer.  Return VARIABLE.  */)
 
   /* Get rid of this buffer's alist element, if any.  */
   XSETSYMBOL (variable, sym);  /* Propagate variable indirection.  */
-  tem = Fassq (variable, current_buffer->local_var_alist);
+  tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
   if (!NILP (tem))
-    current_buffer->local_var_alist
-      = Fdelq (tem, current_buffer->local_var_alist);
+    BVAR (current_buffer, local_var_alist)
+      = Fdelq (tem, BVAR (current_buffer, local_var_alist));
 
   /* If the symbol is set up with the current buffer's binding
      loaded, recompute its value.  We have to do it now, or else
@@ -1819,7 +1817,7 @@ frame-local bindings).  */)
   return variable;
 }
 
-DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p,
+DEFUE ("local-variable-p", Flocal_variable_p, Slocal_variable_p,
        1, 2, 0,
        doc: /* Non-nil if VARIABLE has a local binding in buffer BUFFER.
 BUFFER defaults to the current buffer.  */)
@@ -1851,7 +1849,7 @@ BUFFER defaults to the current buffer.  */)
        XSETBUFFER (tmp, buf);
        XSETSYMBOL (variable, sym); /* Update in case of aliasing.  */
 
-       for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+       for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
          {
            elt = XCAR (tail);
            if (EQ (variable, XCAR (elt)))
@@ -1964,7 +1962,8 @@ If the current binding is global (the default), the value is nil.  */)
 #if 0
 extern struct terminal *get_terminal (Lisp_Object display, int);
 
-DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
+DEFUE ("terminal-local-value", Fterminal_local_value,
+       Sterminal_local_value, 2, 2, 0,
        doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
 If SYMBOL is not a terminal-local variable, then return its normal
 value, like `symbol-value'.
@@ -1981,7 +1980,8 @@ selected frame's terminal device).  */)
   return result;
 }
 
-DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
+DEFUE ("set-terminal-local-value", Fset_terminal_local_value,
+       Sset_terminal_local_value, 3, 3, 0,
        doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
 If VARIABLE is not a terminal-local variable, then set its normal
 binding, like `set'.
@@ -2033,7 +2033,7 @@ indirect_function (register Lisp_Object object)
   return hare;
 }
 
-DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
+DEFUE ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
        doc: /* Return the function at the end of OBJECT's function chain.
 If OBJECT is not a symbol, just return it.  Otherwise, follow all
 function indirections to find the final function binding and return it.
@@ -2061,7 +2061,7 @@ function chain of symbols.  */)
 \f
 /* Extract and set vector and string elements */
 
-DEFUN ("aref", Faref, Saref, 2, 2, 0,
+DEFUE ("aref", Faref, Saref, 2, 2, 0,
        doc: /* Return the element of ARRAY at index IDX.
 ARRAY may be a vector, a string, a char-table, a bool-vector,
 or a byte-code object.  IDX starts at 0.  */)
@@ -2112,11 +2112,11 @@ or a byte-code object.  IDX starts at 0.  */)
 
       if (idxval < 0 || idxval >= size)
        args_out_of_range (array, idx);
-      return XVECTOR (array)->contents[idxval];
+      return AREF (array, idxval);
     }
 }
 
-DEFUN ("aset", Faset, Saset, 3, 3, 0,
+DEFUE ("aset", Faset, Saset, 3, 3, 0,
        doc: /* Store into the element of ARRAY at index IDX the value NEWELT.
 Return NEWELT.  ARRAY may be a vector, a string, a char-table or a
 bool-vector.  IDX starts at 0.  */)
@@ -2219,7 +2219,7 @@ bool-vector.  IDX starts at 0.  */)
 
 enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal };
 
-Lisp_Object
+static Lisp_Object
 arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
 {
   double f1 = 0, f2 = 0;
@@ -2279,21 +2279,21 @@ DEFUN ("=", Feqlsign, Seqlsign, 2, 2, 0,
   return arithcompare (num1, num2, equal);
 }
 
-DEFUN ("<", Flss, Slss, 2, 2, 0,
+DEFUE ("<", Flss, Slss, 2, 2, 0,
        doc: /* Return t if first arg is less than second arg.  Both must be numbers or markers.  */)
   (register Lisp_Object num1, Lisp_Object num2)
 {
   return arithcompare (num1, num2, less);
 }
 
-DEFUN (">", Fgtr, Sgtr, 2, 2, 0,
+DEFUE (">", Fgtr, Sgtr, 2, 2, 0,
        doc: /* Return t if first arg is greater than second arg.  Both must be numbers or markers.  */)
   (register Lisp_Object num1, Lisp_Object num2)
 {
   return arithcompare (num1, num2, grtr);
 }
 
-DEFUN ("<=", Fleq, Sleq, 2, 2, 0,
+DEFUE ("<=", Fleq, Sleq, 2, 2, 0,
        doc: /* Return t if first arg is less than or equal to second arg.
 Both must be numbers or markers.  */)
   (register Lisp_Object num1, Lisp_Object num2)
@@ -2301,7 +2301,7 @@ Both must be numbers or markers.  */)
   return arithcompare (num1, num2, less_or_equal);
 }
 
-DEFUN (">=", Fgeq, Sgeq, 2, 2, 0,
+DEFUE (">=", Fgeq, Sgeq, 2, 2, 0,
        doc: /* Return t if first arg is greater than or equal to second arg.
 Both must be numbers or markers.  */)
   (register Lisp_Object num1, Lisp_Object num2)
@@ -2316,7 +2316,7 @@ DEFUN ("/=", Fneq, Sneq, 2, 2, 0,
   return arithcompare (num1, num2, notequal);
 }
 
-DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
+DEFUE ("zerop", Fzerop, Szerop, 1, 1, 0,
        doc: /* Return t if NUMBER is zero.  */)
   (register Lisp_Object number)
 {
@@ -2363,7 +2363,7 @@ cons_to_long (Lisp_Object c)
   return ((XINT (top) << 16) | XINT (bot));
 }
 \f
-DEFUN ("number-to-string", Fnumber_to_string, Snumber_to_string, 1, 1, 0,
+DEFUE ("number-to-string", Fnumber_to_string, Snumber_to_string, 1, 1, 0,
        doc: /* Return the decimal representation of NUMBER as a string.
 Uses a minus sign if negative.
 NUMBER may be an integer or a floating point number.  */)
@@ -2410,7 +2410,7 @@ digit_to_number (int character, int base)
     return digit;
 }
 
-DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
+DEFUE ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
        doc: /* Parse STRING as a decimal number and return the number.
 This parses both integers and floating point numbers.
 It ignores leading spaces and tabs, and all trailing chars.
@@ -2420,7 +2420,7 @@ present, base 10 is used.  BASE must be between 2 and 16 (inclusive).
 If the base used is not 10, STRING is always parsed as integer.  */)
   (register Lisp_Object string, Lisp_Object base)
 {
-  register unsigned char *p;
+  register char *p;
   register int b;
   int sign = 1;
   Lisp_Object val;
@@ -2439,7 +2439,7 @@ If the base used is not 10, STRING is always parsed as integer.  */)
 
   /* Skip any whitespace at the front of the number.  Some versions of
      atoi do this anyway, so we might as well make Emacs lisp consistent.  */
-  p = SDATA (string);
+  p = SSDATA (string);
   while (*p == ' ' || *p == '\t')
     p++;
 
@@ -2485,13 +2485,13 @@ enum arithop
     Amin
   };
 
-static Lisp_Object float_arith_driver (double, int, enum arithop,
-                                       int, Lisp_Object *);
-Lisp_Object
-arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
+static Lisp_Object float_arith_driver (double, size_t, enum arithop,
+                                       size_t, Lisp_Object *);
+static Lisp_Object
+arith_driver (enum arithop code, size_t nargs, register Lisp_Object *args)
 {
   register Lisp_Object val;
-  register int argnum;
+  register size_t argnum;
   register EMACS_INT accum = 0;
   register EMACS_INT next;
 
@@ -2573,7 +2573,8 @@ arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
 #define isnan(x) ((x) != (x))
 
 static Lisp_Object
-float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args)
+float_arith_driver (double accum, register size_t argnum, enum arithop code,
+                   size_t nargs, register Lisp_Object *args)
 {
   register Lisp_Object val;
   double next;
@@ -2632,46 +2633,46 @@ float_arith_driver (double accum, register int argnum, enum arithop code, int na
 }
 
 
-DEFUN ("+", Fplus, Splus, 0, MANY, 0,
+DEFUE ("+", Fplus, Splus, 0, MANY, 0,
        doc: /* Return sum of any number of arguments, which are numbers or markers.
 usage: (+ &rest NUMBERS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Aadd, nargs, args);
 }
 
-DEFUN ("-", Fminus, Sminus, 0, MANY, 0,
+DEFUE ("-", Fminus, Sminus, 0, MANY, 0,
        doc: /* Negate number or subtract numbers or markers and return the result.
 With one arg, negates it.  With more than one arg,
 subtracts all but the first from the first.
 usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Asub, nargs, args);
 }
 
-DEFUN ("*", Ftimes, Stimes, 0, MANY, 0,
+DEFUE ("*", Ftimes, Stimes, 0, MANY, 0,
        doc: /* Return product of any number of arguments, which are numbers or markers.
 usage: (* &rest NUMBERS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Amult, nargs, args);
 }
 
-DEFUN ("/", Fquo, Squo, 2, MANY, 0,
+DEFUE ("/", Fquo, Squo, 2, MANY, 0,
        doc: /* Return first argument divided by all the remaining arguments.
 The arguments must be numbers or markers.
 usage: (/ DIVIDEND DIVISOR &rest DIVISORS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
-  int argnum;
+  size_t argnum;
   for (argnum = 2; argnum < nargs; argnum++)
     if (FLOATP (args[argnum]))
       return float_arith_driver (0, 0, Adiv, nargs, args);
   return arith_driver (Adiv, nargs, args);
 }
 
-DEFUN ("%", Frem, Srem, 2, 2, 0,
+DEFUE ("%", Frem, Srem, 2, 2, 0,
        doc: /* Return remainder of X divided by Y.
 Both must be integers or markers.  */)
   (register Lisp_Object x, Lisp_Object y)
@@ -2742,20 +2743,20 @@ Both X and Y must be numbers or markers.  */)
   return val;
 }
 
-DEFUN ("max", Fmax, Smax, 1, MANY, 0,
+DEFUE ("max", Fmax, Smax, 1, MANY, 0,
        doc: /* Return largest of all the arguments (which must be numbers or markers).
 The value is always a number; markers are converted to numbers.
 usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Amax, nargs, args);
 }
 
-DEFUN ("min", Fmin, Smin, 1, MANY, 0,
+DEFUE ("min", Fmin, Smin, 1, MANY, 0,
        doc: /* Return smallest of all the arguments (which must be numbers or markers).
 The value is always a number; markers are converted to numbers.
 usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Amin, nargs, args);
 }
@@ -2764,7 +2765,7 @@ DEFUN ("logand", Flogand, Slogand, 0, MANY, 0,
        doc: /* Return bitwise-and of all the arguments.
 Arguments may be integers, or markers converted to integers.
 usage: (logand &rest INTS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Alogand, nargs, args);
 }
@@ -2773,7 +2774,7 @@ DEFUN ("logior", Flogior, Slogior, 0, MANY, 0,
        doc: /* Return bitwise-or of all the arguments.
 Arguments may be integers, or markers converted to integers.
 usage: (logior &rest INTS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Alogior, nargs, args);
 }
@@ -2782,7 +2783,7 @@ DEFUN ("logxor", Flogxor, Slogxor, 0, MANY, 0,
        doc: /* Return bitwise-exclusive-or of all the arguments.
 Arguments may be integers, or markers converted to integers.
 usage: (logxor &rest INTS-OR-MARKERS)  */)
-  (int nargs, Lisp_Object *args)
+  (size_t nargs, Lisp_Object *args)
 {
   return arith_driver (Alogxor, nargs, args);
 }
@@ -2831,7 +2832,7 @@ In this case, zeros are shifted in on the left.  */)
   return val;
 }
 
-DEFUN ("1+", Fadd1, Sadd1, 1, 1, 0,
+DEFUE ("1+", Fadd1, Sadd1, 1, 1, 0,
        doc: /* Return NUMBER plus one.  NUMBER may be a number or a marker.
 Markers are converted to integers.  */)
   (register Lisp_Object number)
@@ -2845,7 +2846,7 @@ Markers are converted to integers.  */)
   return number;
 }
 
-DEFUN ("1-", Fsub1, Ssub1, 1, 1, 0,
+DEFUE ("1-", Fsub1, Ssub1, 1, 1, 0,
        doc: /* Return NUMBER minus one.  NUMBER may be a number or a marker.
 Markers are converted to integers.  */)
   (register Lisp_Object number)
@@ -2868,7 +2869,7 @@ DEFUN ("lognot", Flognot, Slognot, 1, 1, 0,
   return number;
 }
 
-DEFUN ("byteorder", Fbyteorder, Sbyteorder, 0, 0, 0,
+DEFUE ("byteorder", Fbyteorder, Sbyteorder, 0, 0, 0,
        doc: /* Return the byteorder for the machine.
 Returns 66 (ASCII uppercase B) for big endian machines or 108 (ASCII
 lowercase l) for small endian machines.  */)
@@ -3300,18 +3301,18 @@ syms_of_data (void)
 
   XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function;
 
-  DEFVAR_LISP ("most-positive-fixnum", &Vmost_positive_fixnum,
+  DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum,
               doc: /* The largest value that is representable in a Lisp integer.  */);
   Vmost_positive_fixnum = make_number (MOST_POSITIVE_FIXNUM);
   XSYMBOL (intern_c_string ("most-positive-fixnum"))->constant = 1;
 
-  DEFVAR_LISP ("most-negative-fixnum", &Vmost_negative_fixnum,
+  DEFVAR_LISP ("most-negative-fixnum", Vmost_negative_fixnum,
               doc: /* The smallest value that is representable in a Lisp integer.  */);
   Vmost_negative_fixnum = make_number (MOST_NEGATIVE_FIXNUM);
   XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1;
 }
 
-SIGTYPE
+static void
 arith_error (int signo)
 {
   sigsetmask (SIGEMPTYMASK);
@@ -3337,6 +3338,3 @@ init_data (void)
   signal (SIGEMT, arith_error);
 #endif /* uts */
 }
-
-/* arch-tag: 25879798-b84d-479a-9c89-7d148e2109f7
-   (do not change this comment) */