(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;
}
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)
{
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)
{
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;
}
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);
}
}
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;
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));
}
}
/* 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;
{
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);
(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;
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))
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. */
/* 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
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)))
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;
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;
/* 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++;
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;
#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;
DEFUN ("+", 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);
}
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,
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);
}
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);
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);
}
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);
}
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);
}
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);
}
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);
}
XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1;
}
-SIGTYPE
+static SIGTYPE
arith_error (int signo)
{
sigsetmask (SIGEMPTYMASK);
signal (SIGEMT, arith_error);
#endif /* uts */
}
-