#include <math.h>
#if !defined (atof)
-extern double atof ();
+extern double atof (const char *);
#endif /* !atof */
Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
void
-circular_list_error (list)
- Lisp_Object list;
+circular_list_error (Lisp_Object list)
{
xsignal (Qcircular_list, list);
}
Lisp_Object
-wrong_type_argument (predicate, value)
- register Lisp_Object predicate, value;
+wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
{
/* If VALUE is not even a valid Lisp object, we'd want to abort here
where we can get a backtrace showing where it came from. We used
}
void
-pure_write_error ()
+pure_write_error (void)
{
error ("Attempt to modify read-only object");
}
void
-args_out_of_range (a1, a2)
- Lisp_Object a1, a2;
+args_out_of_range (Lisp_Object a1, Lisp_Object a2)
{
xsignal2 (Qargs_out_of_range, a1, a2);
}
void
-args_out_of_range_3 (a1, a2, a3)
- Lisp_Object a1, a2, a3;
+args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3)
{
xsignal3 (Qargs_out_of_range, a1, a2, a3);
}
/* On a few machines, XINT can only be done by calling this. */
int
-sign_extend_lisp_int (num)
- EMACS_INT num;
+sign_extend_lisp_int (EMACS_INT num)
{
if (num & (((EMACS_INT) 1) << (VALBITS - 1)))
return num | (((EMACS_INT) (-1)) << VALBITS);
indirections contains a loop. */
struct Lisp_Symbol *
-indirect_variable (symbol)
- struct Lisp_Symbol *symbol;
+indirect_variable (struct Lisp_Symbol *symbol)
{
struct Lisp_Symbol *tortoise, *hare;
((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
Lisp_Object
-do_symval_forwarding (valcontents)
- register union Lisp_Fwd *valcontents;
+do_symval_forwarding (register union Lisp_Fwd *valcontents)
{
register Lisp_Object val;
switch (XFWDTYPE (valcontents))
} while (0)
static void
-store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
+store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf)
/* struct Lisp_Symbol *symbol; */
- union Lisp_Fwd *valcontents;
- register Lisp_Object newval;
- struct buffer *buf;
+
+
+
{
switch (XFWDTYPE (valcontents))
{
CHECK_NUMBER (newval);
*XINTFWD (valcontents)->intvar = XINT (newval);
break;
-
+
case Lisp_Fwd_Bool:
*XBOOLFWD (valcontents)->boolvar = !NILP (newval);
break;
-
+
case Lisp_Fwd_Obj:
*XOBJFWD (valcontents)->objvar = newval;
-
+
/* If this variable is a default for something stored
in the buffer itself, such as default-fill-column,
find the buffers that don't have local values for it
int offset = ((char *) XOBJFWD (valcontents)->objvar
- (char *) &buffer_defaults);
int idx = PER_BUFFER_IDX (offset);
-
+
Lisp_Object tail;
-
+
if (idx <= 0)
break;
-
+
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object buf;
This makes it safe to alter the status of other bindings. */
void
-swap_in_global_binding (symbol)
- struct Lisp_Symbol *symbol;
+swap_in_global_binding (struct Lisp_Symbol *symbol)
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol);
This could be another forwarding pointer. */
static void
-swap_in_symval_forwarding (symbol, blv)
- struct Lisp_Symbol *symbol;
- struct Lisp_Buffer_Local_Value *blv;
+swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_Value *blv)
{
register Lisp_Object tem1;
within this function. Great care is required for this. */
Lisp_Object
-find_symbol_value (symbol)
- Lisp_Object symbol;
+find_symbol_value (Lisp_Object symbol)
{
struct Lisp_Symbol *sym;
(symbol, newval)
register Lisp_Object symbol, newval;
{
- set_internal (symbol, newval, current_buffer, 0);
+ set_internal (symbol, newval, Qnil, 0);
return newval;
}
}
static int
-let_shadows_global_binding_p (symbol)
- Lisp_Object symbol;
+let_shadows_global_binding_p (Lisp_Object symbol)
{
struct specbinding *p;
}
/* Store the value NEWVAL into SYMBOL.
- If buffer-locality is an issue, BUF specifies which buffer to use.
- (0 stands for the current buffer.)
+ If buffer/frame-locality is an issue, WHERE specifies which context to use.
+ (nil stands for the current buffer/frame).
If BINDFLAG is zero, then if this symbol is supposed to become
local in every buffer where it is set, then we make it local.
If BINDFLAG is nonzero, we don't do that. */
void
-set_internal (symbol, newval, buf, bindflag)
- register Lisp_Object symbol, newval;
- struct buffer *buf;
- int bindflag;
+set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag)
{
int voide = EQ (newval, Qunbound);
struct Lisp_Symbol *sym;
Lisp_Object tem1;
- if (buf == 0)
- buf = current_buffer;
-
/* If restoring in a dead buffer, do nothing. */
- if (NILP (buf->name))
- return;
+ /* if (BUFFERP (where) && NILP (XBUFFER (where)->name))
+ return; */
CHECK_SYMBOL (symbol);
if (SYMBOL_CONSTANT_P (symbol))
case SYMBOL_LOCALIZED:
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
- Lisp_Object tmp; XSETBUFFER (tmp, buf);
-
+ if (NILP (where))
+ {
+ if (blv->frame_local)
+ where = selected_frame;
+ else
+ XSETBUFFER (where, current_buffer);
+ }
/* If the current buffer is not the buffer whose binding is
loaded, or if there may be frame-local bindings and the frame
isn't the right one, or if it's a Lisp_Buffer_Local_Value and
the default binding is loaded, the loaded binding may be the
wrong one. */
- if (!EQ (blv->where,
- blv->frame_local ? selected_frame : tmp)
+ if (!EQ (blv->where, where)
/* Also unload a global binding (if the var is local_if_set). */
|| (EQ (blv->valcell, blv->defcell)))
{
SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
/* Find the new binding. */
- {
- XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
- if (blv->frame_local)
- {
- tem1 = Fassq (symbol, XFRAME (selected_frame)->param_alist);
- blv->where = selected_frame;
- }
- else
- {
- tem1 = Fassq (symbol, buf->local_var_alist);
- blv->where = tmp;
- }
- }
+ XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
+ tem1 = Fassq (symbol,
+ (blv->frame_local
+ ? XFRAME (where)->param_alist
+ : XBUFFER (where)->local_var_alist));
+ blv->where = where;
blv->found = 1;
if (NILP (tem1))
bindings, not for frame-local bindings. */
eassert (!blv->frame_local);
tem1 = Fcons (symbol, XCDR (blv->defcell));
- buf->local_var_alist
- = Fcons (tem1, buf->local_var_alist);
+ XBUFFER (where)->local_var_alist
+ = Fcons (tem1, XBUFFER (where)->local_var_alist);
}
}
buffer-local indicator, not through Lisp_Objfwd, etc. */
blv->fwd = NULL;
else
- store_symval_forwarding (blv->fwd, newval, buf);
+ store_symval_forwarding (blv->fwd, newval,
+ BUFFERP (where)
+ ? XBUFFER (where) : current_buffer);
}
break;
}
case SYMBOL_FORWARDED:
{
+ struct buffer *buf
+ = BUFFERP (where) ? XBUFFER (where) : current_buffer;
union Lisp_Fwd *innercontents = SYMBOL_FWD (sym);
if (BUFFER_OBJFWDP (innercontents))
{
Return Qunbound if it is void. */
Lisp_Object
-default_value (symbol)
- Lisp_Object symbol;
+default_value (Lisp_Object symbol)
{
struct Lisp_Symbol *sym;
{
struct Lisp_Buffer_Local_Value *blv
= xmalloc (sizeof (struct Lisp_Buffer_Local_Value));
- Lisp_Object symbol; XSETSYMBOL (symbol, sym);
- Lisp_Object tem = Fcons (symbol, (forwarded
- ? do_symval_forwarding (valcontents.fwd)
- : valcontents.value));
+ Lisp_Object symbol;
+ Lisp_Object tem;
+
+ XSETSYMBOL (symbol, sym);
+ tem = Fcons (symbol, (forwarded
+ ? do_symval_forwarding (valcontents.fwd)
+ : valcontents.value));
+
/* Buffer_Local_Values cannot have as realval a buffer-local
or keyboard-local forwarding. */
eassert (!(forwarded && BUFFER_OBJFWDP (valcontents.fwd)));
Lisp_Object symbol;
XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
if (let_shadows_global_binding_p (symbol))
- error ("Making %s buffer-local while let-bound!",
- SDATA (SYMBOL_NAME (variable)));
+ message ("Making %s buffer-local while let-bound!",
+ SDATA (SYMBOL_NAME (variable)));
}
}
}
if (sym->constant)
- error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
if (blv ? blv->local_if_set
: (forwarded && BUFFER_OBJFWDP (valcontents.fwd)))
Lisp_Object symbol;
XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
if (let_shadows_global_binding_p (symbol))
- error ("Making %s local to %s while let-bound!",
- SDATA (SYMBOL_NAME (variable)), SDATA (current_buffer->name));
+ message ("Making %s local to %s while let-bound!",
+ SDATA (SYMBOL_NAME (variable)),
+ SDATA (current_buffer->name));
}
}
blv->frame_local = 1;
sym->redirect = SYMBOL_LOCALIZED;
SET_SYMBOL_BLV (sym, blv);
+ {
+ Lisp_Object symbol;
+ XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
+ if (let_shadows_global_binding_p (symbol))
+ message ("Making %s frame-local while let-bound!",
+ SDATA (SYMBOL_NAME (variable)));
+ }
return variable;
}
Lisp_Object tail, elt, tmp;
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
XSETBUFFER (tmp, buf);
-
+
for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
/* This code is disabled now that we use the selected frame to return
keyboard-local-values. */
#if 0
-extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
+extern struct terminal *get_terminal (Lisp_Object display, int);
DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
This is like Findirect_function, except that it doesn't signal an
error if the chain ends up unbound. */
Lisp_Object
-indirect_function (object)
- register Lisp_Object object;
+indirect_function (register Lisp_Object object)
{
Lisp_Object tortoise, hare;
idxval_byte = string_char_to_byte (array, idxval);
p1 = SDATA (array) + idxval_byte;
- PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes);
+ prev_bytes = BYTES_BY_CHAR_HEAD (*p1);
new_bytes = CHAR_STRING (XINT (newelt), p0);
if (prev_bytes != new_bytes)
{
enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal };
Lisp_Object
-arithcompare (num1, num2, comparison)
- Lisp_Object num1, num2;
- enum comparison comparison;
+arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
{
double f1 = 0, f2 = 0;
int floatp = 0;
when the value fits in one. */
Lisp_Object
-long_to_cons (i)
- unsigned long i;
+long_to_cons (long unsigned int i)
{
unsigned long top = i >> 16;
unsigned int bot = i & 0xFFFF;
}
unsigned long
-cons_to_long (c)
- Lisp_Object c;
+cons_to_long (Lisp_Object c)
{
Lisp_Object top, bot;
if (INTEGERP (c))
}
INLINE static int
-digit_to_number (character, base)
- int character, base;
+digit_to_number (int character, int base)
{
int digit;
Amin
};
-static Lisp_Object float_arith_driver P_ ((double, int, enum arithop,
- int, Lisp_Object *));
+static Lisp_Object float_arith_driver (double, int, enum arithop,
+ int, Lisp_Object *);
extern Lisp_Object fmod_float ();
Lisp_Object
-arith_driver (code, nargs, args)
- enum arithop code;
- int nargs;
- register Lisp_Object *args;
+arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
register int argnum;
#define isnan(x) ((x) != (x))
static Lisp_Object
-float_arith_driver (accum, argnum, code, nargs, args)
- double accum;
- register int argnum;
- enum arithop code;
- int nargs;
- register Lisp_Object *args;
+float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
double next;
\f
void
-syms_of_data ()
+syms_of_data (void)
{
Lisp_Object error_tail, arith_tail;
}
SIGTYPE
-arith_error (signo)
- int signo;
+arith_error (int signo)
{
sigsetmask (SIGEMPTYMASK);
}
void
-init_data ()
+init_data (void)
{
/* Don't do this if just dumping out.
We don't want to call `signal' in this case