diff src/alloc.c @ 39973:579177964efa

Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting with lisp system changes.
author Ken Raeburn <raeburn@raeburn.org>
date Tue, 16 Oct 2001 09:09:51 +0000
parents 91951fb5b9e5
children eac4e9ae201c
line wrap: on
line diff
--- a/src/alloc.c	Mon Oct 15 20:52:59 2001 +0000
+++ b/src/alloc.c	Tue Oct 16 09:09:51 2001 +0000
@@ -2087,8 +2087,8 @@
       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 @@
 
   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 @@
 		    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 @@
 	      && ! 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 @@
 	    break;
 	}
 
-      mark_object (&XCDR (tail));
+      mark_object (&XCDR_AS_LVALUE (tail));
     }
   else
     mark_object (&buffer->undo_list);