summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2001-10-16 09:09:51 +0000
committerKen Raeburn <raeburn@raeburn.org>2001-10-16 09:09:51 +0000
commitf3fbd1553534bb85c75baf891c0ca9aaa4c3fa6f (patch)
tree43eb51ff0ca4af1705387403827ef210098f2da8 /src/alloc.c
parent018ba359ab456f6a43f3acea0c15df616aa0ad02 (diff)
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
with lisp system changes.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 3a9dcc3c59d..a7780e9ad91 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2087,8 +2087,8 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
XSETCONS (val, &cons_block->conses[cons_block_index++]);
}
- XCAR (val) = car;
- XCDR (val) = cdr;
+ XSETCAR (val, car);
+ XSETCDR (val, cdr);
consing_since_gc += sizeof (struct Lisp_Cons);
cons_cells_consed++;
return val;
@@ -3878,8 +3878,8 @@ pure_cons (car, cdr)
p = (struct Lisp_Cons *) pure_alloc (sizeof *p, Lisp_Cons);
XSETCONS (new, p);
- XCAR (new) = Fpurecopy (car);
- XCDR (new) = Fpurecopy (cdr);
+ XSETCAR (new, Fpurecopy (car));
+ XSETCDR (new, Fpurecopy (cdr));
return new;
}
@@ -4189,7 +4189,10 @@ Garbage collection happens automatically if you cons more than
if (NILP (prev))
nextb->undo_list = tail = XCDR (tail);
else
- tail = XCDR (prev) = XCDR (tail);
+ {
+ tail = XCDR (tail);
+ XSETCDR (prev, tail);
+ }
}
else
{
@@ -4800,8 +4803,8 @@ mark_buffer (buf)
&& ! XMARKBIT (XCAR (ptr->car))
&& GC_MARKERP (XCAR (ptr->car)))
{
- XMARK (XCAR (ptr->car));
- mark_object (&XCDR (ptr->car));
+ XMARK (XCAR_AS_LVALUE (ptr->car));
+ mark_object (&XCDR_AS_LVALUE (ptr->car));
}
else
mark_object (&ptr->car);
@@ -4812,7 +4815,7 @@ mark_buffer (buf)
break;
}
- mark_object (&XCDR (tail));
+ mark_object (&XCDR_AS_LVALUE (tail));
}
else
mark_object (&buffer->undo_list);