Commit c644523b authored by Dmitry Antipov's avatar Dmitry Antipov

Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.

* src/lisp.h (struct Lisp_Symbol): Change xname to meaningful
name since all xname users are fixed long time ago.  Do not use
INTERNAL_FIELD.
(set_symbol_name, set_symbol_function, set_symbol_plist):
(set_symbol_next, set_overlay_plist): New function.
(struct Lisp_Cons): Do not use INTERNAL_FIELD.
(struct Lisp_Overlay): Likewise.
(CVAR, MVAR, SVAR): Remove.
* src/alloc.c, src/buffer.c, src/buffer.h, src/bytecode.c:
* src/cmds.c, src/data.c, src/doc.c, src/eval.c, src/fns.c:
* src/keyboard.c, src/lread.c, src/nsselect.m, src/xterm.c:
Adjust users.
* src/.gdbinit: Change to use name field of struct Lisp_Symbol
where appropriate.
* admin/coccinelle/overlay.cocci, admin/coccinelle/symbol.cocci:
Remove.
parent 6a3d20cc
2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
* coccinelle/overlay.cocci, coccinelle/symbol.cocci: Remove.
2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
Port to Solaris 8.
......
// Change direct access to Lisp_Object fields of struct
// Lisp_Overlay to MVAR. Beginning M denotes "misc", and
// MVAR is likely to be used for other second-class objects.
@@
struct Lisp_Overlay *V;
Lisp_Object O;
@@
(
- V->start
+ MVAR (V, start)
|
- V->end
+ MVAR (V, end)
|
- V->plist
+ MVAR (V, plist)
|
- XOVERLAY (O)->start
+ MVAR (XOVERLAY (O), start)
|
- XOVERLAY (O)->end
+ MVAR (XOVERLAY (O), end)
|
- XOVERLAY (O)->plist
+ MVAR (XOVERLAY (O), plist)
)
// Change direct access to Lisp_Object fields of struct Lisp_Symbol to SVAR.
@@
struct Lisp_Symbol *S;
Lisp_Object O;
@@
(
- S->xname
+ SVAR (S, xname)
|
- S->val.value
+ SVAR (S, val.value)
|
- S->function
+ SVAR (S, function)
|
- S->plist
+ SVAR (S, plist)
|
- XSYMBOL (O)->xname
+ SVAR (XSYMBOL (O), xname)
|
- XSYMBOL (O)->val.value
+ SVAR (XSYMBOL (O), val.value)
|
- XSYMBOL (O)->function
+ SVAR (XSYMBOL (O), function)
|
- XSYMBOL (O)->plist
+ SVAR (XSYMBOL (O), plist)
)
......@@ -1047,7 +1047,7 @@ end
define xprintsym
xgetptr $arg0
set $sym = (struct Lisp_Symbol *) $ptr
xgetptr $sym->xname_
xgetptr $sym->name
set $sym_name = (struct Lisp_String *) $ptr
xprintstr $sym_name
end
......@@ -1218,7 +1218,7 @@ xgetptr globals.f_Vsystem_type
# $ptr is NULL in temacs
if ($ptr != 0)
set $tem = (struct Lisp_Symbol *) $ptr
xgetptr $tem->xname_
xgetptr $tem->name
set $tem = (struct Lisp_String *) $ptr
set $tem = (char *) $tem->data
......@@ -1241,7 +1241,7 @@ commands
silent
xgetptr globals.f_Vinitial_window_system
set $tem = (struct Lisp_Symbol *) $ptr
xgetptr $tem->xname_
xgetptr $tem->name
set $tem = (struct Lisp_String *) $ptr
set $tem = (char *) $tem->data
# If we are running in synchronous mode, we want a chance to look
......
2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
* lisp.h (struct Lisp_Symbol): Change xname to meaningful
name since all xname users are fixed long time ago. Do not
use INTERNAL_FIELD.
(set_symbol_name, set_symbol_function, set_symbol_plist):
(set_symbol_next, set_overlay_plist): New function.
(struct Lisp_Cons): Do not use INTERNAL_FIELD.
(struct Lisp_Overlay): Likewise.
(CVAR, MVAR, SVAR): Remove.
* alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
* doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
* xterm.c: Adjust users.
* .gdbinit: Change to use name field of struct Lisp_Symbol
where appropriate.
2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
Basic functions to set Lisp_Object and pointer slots of intervals.
......
......@@ -2691,7 +2691,7 @@ free_cons (struct Lisp_Cons *ptr)
{
ptr->u.chain = cons_free_list;
#if GC_MARK_STACK
CVAR (ptr, car) = Vdead;
ptr->car = Vdead;
#endif
cons_free_list = ptr;
consing_since_gc -= sizeof *ptr;
......@@ -3522,12 +3522,12 @@ Its value and function definition are void, and its property list is nil. */)
MALLOC_UNBLOCK_INPUT;
p = XSYMBOL (val);
SVAR (p, xname) = name;
SVAR (p, plist) = Qnil;
set_symbol_name (val, name);
set_symbol_plist (val, Qnil);
p->redirect = SYMBOL_PLAINVAL;
SET_SYMBOL_VAL (p, Qunbound);
SVAR (p, function) = Qunbound;
p->next = NULL;
set_symbol_function (val, Qunbound);
set_symbol_next (val, NULL);
p->gcmarkbit = 0;
p->interned = SYMBOL_UNINTERNED;
p->constant = 0;
......@@ -3654,7 +3654,7 @@ build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist)
overlay = allocate_misc (Lisp_Misc_Overlay);
OVERLAY_START (overlay) = start;
OVERLAY_END (overlay) = end;
OVERLAY_PLIST (overlay) = plist;
set_overlay_plist (overlay, plist);
XOVERLAY (overlay)->next = NULL;
return overlay;
}
......@@ -4299,7 +4299,7 @@ live_cons_p (struct mem_node *m, void *p)
&& offset < (CONS_BLOCK_SIZE * sizeof b->conses[0])
&& (b != cons_block
|| offset / sizeof b->conses[0] < cons_block_index)
&& !EQ (CVAR ((struct Lisp_Cons *) p, car), Vdead));
&& !EQ (((struct Lisp_Cons *) p)->car, Vdead));
}
else
return 0;
......@@ -4325,7 +4325,7 @@ live_symbol_p (struct mem_node *m, void *p)
&& offset < (SYMBOL_BLOCK_SIZE * sizeof b->symbols[0])
&& (b != symbol_block
|| offset / sizeof b->symbols[0] < symbol_block_index)
&& !EQ (SVAR (((struct Lisp_Symbol *)p), function), Vdead));
&& !EQ (((struct Lisp_Symbol *)p)->function, Vdead));
}
else
return 0;
......@@ -5831,9 +5831,9 @@ mark_overlay (struct Lisp_Overlay *ptr)
for (; ptr && !ptr->gcmarkbit; ptr = ptr->next)
{
ptr->gcmarkbit = 1;
mark_object (MVAR (ptr, start));
mark_object (MVAR (ptr, end));
mark_object (MVAR (ptr, plist));
mark_object (ptr->start);
mark_object (ptr->end);
mark_object (ptr->plist);
}
}
......@@ -6067,8 +6067,8 @@ mark_object (Lisp_Object arg)
break;
CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
ptr->gcmarkbit = 1;
mark_object (SVAR (ptr, function));
mark_object (SVAR (ptr, plist));
mark_object (ptr->function);
mark_object (ptr->plist);
switch (ptr->redirect)
{
case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break;
......@@ -6099,9 +6099,9 @@ mark_object (Lisp_Object arg)
break;
default: abort ();
}
if (!PURE_POINTER_P (XSTRING (SVAR (ptr, xname))))
MARK_STRING (XSTRING (SVAR (ptr, xname)));
MARK_INTERVAL_TREE (STRING_INTERVALS (SVAR (ptr, xname)));
if (!PURE_POINTER_P (XSTRING (ptr->name)))
MARK_STRING (XSTRING (ptr->name));
MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->name));
ptr = ptr->next;
if (ptr)
......@@ -6163,14 +6163,14 @@ mark_object (Lisp_Object arg)
CHECK_ALLOCATED_AND_LIVE (live_cons_p);
CONS_MARK (ptr);
/* If the cdr is nil, avoid recursion for the car. */
if (EQ (CVAR (ptr, u.cdr), Qnil))
if (EQ (ptr->u.cdr, Qnil))
{
obj = CVAR (ptr, car);
obj = ptr->car;
cdr_count = 0;
goto loop;
}
mark_object (CVAR (ptr, car));
obj = CVAR (ptr, u.cdr);
mark_object (ptr->car);
obj = ptr->u.cdr;
cdr_count++;
if (cdr_count == mark_object_loop_halt)
abort ();
......@@ -6319,7 +6319,7 @@ gc_sweep (void)
cblk->conses[pos].u.chain = cons_free_list;
cons_free_list = &cblk->conses[pos];
#if GC_MARK_STACK
CVAR (cons_free_list, car) = Vdead;
cons_free_list->car = Vdead;
#endif
}
else
......@@ -6467,7 +6467,7 @@ gc_sweep (void)
/* Check if the symbol was created during loadup. In such a case
it might be pointed to by pure bytecode which we don't trace,
so we conservatively assume that it is live. */
int pure_p = PURE_POINTER_P (XSTRING (sym->s.INTERNAL_FIELD (xname)));
int pure_p = PURE_POINTER_P (XSTRING (sym->s.name));
if (!sym->s.gcmarkbit && !pure_p)
{
......@@ -6476,7 +6476,7 @@ gc_sweep (void)
sym->s.next = symbol_free_list;
symbol_free_list = &sym->s;
#if GC_MARK_STACK
SVAR (symbol_free_list, function) = Vdead;
symbol_free_list->function = Vdead;
#endif
++this_free;
}
......@@ -6484,7 +6484,7 @@ gc_sweep (void)
{
++num_used;
if (!pure_p)
UNMARK_STRING (XSTRING (sym->s.INTERNAL_FIELD (xname)));
UNMARK_STRING (XSTRING (sym->s.name));
sym->s.gcmarkbit = 0;
}
}
......@@ -6669,10 +6669,10 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max)
XSETSYMBOL (tem, sym);
val = find_symbol_value (tem);
if (EQ (val, obj)
|| EQ (SVAR (sym, function), obj)
|| (!NILP (SVAR (sym, function))
&& COMPILEDP (SVAR (sym, function))
&& EQ (AREF (SVAR (sym, function), COMPILED_BYTECODE), obj))
|| EQ (sym->function, obj)
|| (!NILP (sym->function)
&& COMPILEDP (sym->function)
&& EQ (AREF (sym->function, COMPILED_BYTECODE), obj))
|| (!NILP (val)
&& COMPILEDP (val)
&& EQ (AREF (val, COMPILED_BYTECODE), obj)))
......
......@@ -419,17 +419,17 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
Lisp_Object overlay, start, end;
struct Lisp_Marker *m;
eassert (MARKERP (MVAR (list, start)));
m = XMARKER (MVAR (list, start));
eassert (MARKERP (list->start));
m = XMARKER (list->start);
start = build_marker (b, m->charpos, m->bytepos);
XMARKER (start)->insertion_type = m->insertion_type;
eassert (MARKERP (MVAR (list, end)));
m = XMARKER (MVAR (list, end));
eassert (MARKERP (list->end));
m = XMARKER (list->end);
end = build_marker (b, m->charpos, m->bytepos);
XMARKER (end)->insertion_type = m->insertion_type;
overlay = build_overlay (start, end, Fcopy_sequence (MVAR (list, plist)));
overlay = build_overlay (start, end, Fcopy_sequence (list->plist));
if (tail)
tail = tail->next = XOVERLAY (overlay);
else
......@@ -659,11 +659,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
static void
drop_overlay (struct buffer *b, struct Lisp_Overlay *ov)
{
eassert (b == XBUFFER (Fmarker_buffer (MVAR (ov, start))));
modify_overlay (b, marker_position (MVAR (ov, start)),
marker_position (MVAR (ov, end)));
Fset_marker (MVAR (ov, start), Qnil, Qnil);
Fset_marker (MVAR (ov, end), Qnil, Qnil);
eassert (b == XBUFFER (Fmarker_buffer (ov->start)));
modify_overlay (b, marker_position (ov->start),
marker_position (ov->end));
Fset_marker (ov->start, Qnil, Qnil);
Fset_marker (ov->end, Qnil, Qnil);
}
......@@ -3889,7 +3889,7 @@ OVERLAY. */)
{
CHECK_OVERLAY (overlay);
return Fcopy_sequence (MVAR (XOVERLAY (overlay), plist));
return Fcopy_sequence (XOVERLAY (overlay)->plist);
}
......@@ -4065,7 +4065,7 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0,
(Lisp_Object overlay, Lisp_Object prop)
{
CHECK_OVERLAY (overlay);
return lookup_char_property (MVAR (XOVERLAY (overlay), plist), prop, 0);
return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0);
}
DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,
......@@ -4080,7 +4080,7 @@ VALUE will be returned.*/)
buffer = Fmarker_buffer (OVERLAY_START (overlay));
for (tail = MVAR (XOVERLAY (overlay), plist);
for (tail = XOVERLAY (overlay)->plist;
CONSP (tail) && CONSP (XCDR (tail));
tail = XCDR (XCDR (tail)))
if (EQ (XCAR (tail), prop))
......@@ -4091,8 +4091,8 @@ VALUE will be returned.*/)
}
/* It wasn't in the list, so add it to the front. */
changed = !NILP (value);
MVAR (XOVERLAY (overlay), plist)
= Fcons (prop, Fcons (value, MVAR (XOVERLAY (overlay), plist)));
set_overlay_plist
(overlay, Fcons (prop, Fcons (value, XOVERLAY (overlay)->plist)));
found:
if (! NILP (buffer))
{
......
......@@ -991,15 +991,15 @@ BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
/* Return the marker that stands for where OV starts in the buffer. */
#define OVERLAY_START(OV) MVAR (XOVERLAY (OV), start)
#define OVERLAY_START(OV) XOVERLAY (OV)->start
/* Return the marker that stands for where OV ends in the buffer. */
#define OVERLAY_END(OV) MVAR (XOVERLAY (OV), end)
#define OVERLAY_END(OV) XOVERLAY (OV)->end
/* Return the plist of overlay OV. */
#define OVERLAY_PLIST(OV) MVAR (XOVERLAY (OV), plist)
#define OVERLAY_PLIST(OV) XOVERLAY (OV)->plist
/* Return the actual buffer position for the marker P.
We assume you know which buffer it's pointing into. */
......
......@@ -818,7 +818,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
&& !EQ (val, Qunbound)
&& !XSYMBOL (sym)->redirect
&& !SYMBOL_CONSTANT_P (sym))
SVAR (XSYMBOL (sym), val.value) = val;
SET_SYMBOL_VAL (XSYMBOL (sym), val);
else
{
BEFORE_POTENTIAL_GC ();
......
......@@ -447,12 +447,11 @@ internal_self_insert (int c, EMACS_INT n)
and the hook has a non-nil `no-self-insert' property,
return right away--don't really self-insert. */
if (SYMBOLP (sym) && ! NILP (sym)
&& ! NILP (SVAR (XSYMBOL (sym), function))
&& SYMBOLP (SVAR (XSYMBOL (sym), function)))
&& ! NILP (XSYMBOL (sym)->function)
&& SYMBOLP (XSYMBOL (sym)->function))
{
Lisp_Object prop;
prop = Fget (SVAR (XSYMBOL (sym), function),
intern ("no-self-insert"));
prop = Fget (XSYMBOL (sym)->function, intern ("no-self-insert"));
if (! NILP (prop))
return 1;
}
......
......@@ -562,7 +562,7 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
return (EQ (SVAR (XSYMBOL (symbol), function), Qunbound) ? Qnil : Qt);
return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt;
}
DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
......@@ -585,7 +585,7 @@ Return SYMBOL. */)
CHECK_SYMBOL (symbol);
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
SVAR (XSYMBOL (symbol), function) = Qunbound;
set_symbol_function (symbol, Qunbound);
return symbol;
}
......@@ -594,8 +594,8 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
if (!EQ (SVAR (XSYMBOL (symbol), function), Qunbound))
return SVAR (XSYMBOL (symbol), function);
if (!EQ (XSYMBOL (symbol)->function, Qunbound))
return XSYMBOL (symbol)->function;
xsignal1 (Qvoid_function, symbol);
}
......@@ -604,7 +604,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
return SVAR (XSYMBOL (symbol), plist);
return XSYMBOL (symbol)->plist;
}
DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
......@@ -628,7 +628,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
function = SVAR (XSYMBOL (symbol), function);
function = XSYMBOL (symbol)->function;
if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
......@@ -636,13 +636,13 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
if (CONSP (function) && EQ (XCAR (function), Qautoload))
Fput (symbol, Qautoload, XCDR (function));
SVAR (XSYMBOL (symbol), function) = definition;
set_symbol_function (symbol, definition);
/* Handle automatic advice activation. */
if (CONSP (SVAR (XSYMBOL (symbol), plist))
if (CONSP (XSYMBOL (symbol)->plist)
&& !NILP (Fget (symbol, Qad_advice_info)))
{
call2 (Qad_activate_internal, symbol, Qnil);
definition = SVAR (XSYMBOL (symbol), function);
definition = XSYMBOL (symbol)->function;
}
return definition;
}
......@@ -657,8 +657,8 @@ The return value is undefined. */)
(register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
{
CHECK_SYMBOL (symbol);
if (CONSP (SVAR (XSYMBOL (symbol), function))
&& EQ (XCAR (SVAR (XSYMBOL (symbol), function)), Qautoload))
if (CONSP (XSYMBOL (symbol)->function)
&& EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
LOADHIST_ATTACH (Fcons (Qt, symbol));
if (!NILP (Vpurify_flag)
/* If `definition' is a keymap, immutable (and copying) is wrong. */
......@@ -679,7 +679,7 @@ DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
(register Lisp_Object symbol, Lisp_Object newplist)
{
CHECK_SYMBOL (symbol);
SVAR (XSYMBOL (symbol), plist) = newplist;
set_symbol_plist (symbol, newplist);
return newplist;
}
......@@ -2019,12 +2019,12 @@ indirect_function (register Lisp_Object object)
{
if (!SYMBOLP (hare) || EQ (hare, Qunbound))
break;
hare = SVAR (XSYMBOL (hare), function);
hare = XSYMBOL (hare)->function;
if (!SYMBOLP (hare) || EQ (hare, Qunbound))
break;
hare = SVAR (XSYMBOL (hare), function);
hare = XSYMBOL (hare)->function;
tortoise = SVAR (XSYMBOL (tortoise), function);
tortoise = XSYMBOL (tortoise)->function;
if (EQ (hare, tortoise))
xsignal1 (Qcyclic_function_indirection, object);
......@@ -2048,7 +2048,7 @@ function chain of symbols. */)
/* Optimize for no indirection. */
result = object;
if (SYMBOLP (result) && !EQ (result, Qunbound)
&& (result = SVAR (XSYMBOL (result), function), SYMBOLP (result)))
&& (result = XSYMBOL (result)->function, SYMBOLP (result)))
result = indirect_function (result);
if (!EQ (result, Qunbound))
return result;
......@@ -3196,7 +3196,7 @@ syms_of_data (void)
defsubr (&Ssubr_arity);
defsubr (&Ssubr_name);
SVAR (XSYMBOL (Qwholenump), function) = SVAR (XSYMBOL (Qnatnump), function);
set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->function);
DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum,
doc: /* The largest value that is representable in a Lisp integer. */);
......
......@@ -508,7 +508,7 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
{
/* Don't use indirect_function here, or defaliases will apply their
docstrings to the base functions (Bug#2603). */
Lisp_Object fun = SYMBOLP (obj) ? SVAR (XSYMBOL (obj), function) : obj;
Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj;
/* The type determines where the docstring is stored. */
......
......@@ -976,7 +976,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
tem = Fassq (sym, environment);
if (NILP (tem))
{
def = SVAR (XSYMBOL (sym), function);
def = XSYMBOL (sym)->function;
if (!EQ (def, Qunbound))
continue;
}
......@@ -1893,9 +1893,9 @@ this does nothing and returns nil. */)
CHECK_STRING (file);
/* If function is defined and not as an autoload, don't override. */
if (!EQ (SVAR (XSYMBOL (function), function), Qunbound)
&& !(CONSP (SVAR (XSYMBOL (function), function))
&& EQ (XCAR (SVAR (XSYMBOL (function), function)), Qautoload)))
if (!EQ (XSYMBOL (function)->function, Qunbound)
&& !(CONSP (XSYMBOL (function)->function)
&& EQ (XCAR (XSYMBOL (function)->function), Qautoload)))
return Qnil;
if (NILP (Vpurify_flag))
......@@ -2081,7 +2081,7 @@ eval_sub (Lisp_Object form)
/* Optimize for no indirection. */
fun = original_fun;
if (SYMBOLP (fun) && !EQ (fun, Qunbound)
&& (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun)))
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (SUBRP (fun))
......@@ -2266,7 +2266,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
/* Optimize for no indirection. */
if (SYMBOLP (fun) && !EQ (fun, Qunbound)
&& (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun)))
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (EQ (fun, Qunbound))
{
......@@ -2771,7 +2771,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
/* Optimize for no indirection. */
fun = original_fun;
if (SYMBOLP (fun) && !EQ (fun, Qunbound)
&& (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun)))
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (SUBRP (fun))
......
......@@ -1868,7 +1868,7 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
(Lisp_Object symbol, Lisp_Object propname)
{
CHECK_SYMBOL (symbol);
return Fplist_get (SVAR (XSYMBOL (symbol), plist), propname);
return Fplist_get (XSYMBOL (symbol)->plist, propname);
}
DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
......@@ -1910,8 +1910,8 @@ It can be retrieved with `(get SYMBOL PROPNAME)'. */)
(Lisp_Object symbol, Lisp_Object propname, Lisp_Object value)
{
CHECK_SYMBOL (symbol);
SVAR (XSYMBOL (symbol), plist)
= Fplist_put (SVAR (XSYMBOL (symbol), plist), propname, value);
set_symbol_plist
(symbol, Fplist_put (XSYMBOL (symbol)->plist, propname, value));
return value;
}
......@@ -2053,8 +2053,8 @@ internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int
|| !internal_equal (OVERLAY_END (o1), OVERLAY_END (o2),
depth + 1, props))
return 0;
o1 = MVAR (XOVERLAY (o1), plist);
o2 = MVAR (XOVERLAY (o2), plist);
o1 = XOVERLAY (o1)->plist;
o2 = XOVERLAY (o2)->plist;
goto tail_recurse;
}
if (MARKERP (o1))
......
......@@ -7896,7 +7896,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
(such as lmenu.el set it up), check if the
original command matches the cached command. */
&& !(SYMBOLP (def)
&& EQ (tem, SVAR (XSYMBOL (def), function)))))
&& EQ (tem, XSYMBOL (def)->function))))
keys = Qnil;
}
......@@ -8830,9 +8830,9 @@ access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
/* Handle a symbol whose function definition is a keymap
or an array. */
if (SYMBOLP (next) && !NILP (Ffboundp (next))
&& (ARRAYP (SVAR (XSYMBOL (next), function))
|| KEYMAPP (SVAR (XSYMBOL (next), function))))
next = Fautoload_do_load (SVAR (XSYMBOL (next), function), next, Qnil);
&& (ARRAYP (XSYMBOL (next)->function)
|| KEYMAPP (XSYMBOL (next)->function)))
next = Fautoload_do_load (XSYMBOL (next)->function, next, Qnil);
/* If the keymap gives a function, not an
array, then call the function with one arg and use
......
......@@ -633,10 +633,7 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
#define CHECK_TYPE(ok, Qxxxp, x) \
do { if (!(ok)) wrong_type_argument (Qxxxp, (x)); } while (0)
/* Lisp fields are usually hidden from most code and accessed
via special macros. Only select pieces of code, like the GC,
are allowed to use INTERNAL_FIELD directly. Objects which
aren't using this convention should be fixed. */
/* Deprecated and will be removed soon. */
#define INTERNAL_FIELD(field) field ## _
......@@ -648,20 +645,15 @@ typedef struct interval *INTERVAL;