diff src/fns.c @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 0132846995bd
children 85ec50267440
line wrap: on
line diff
--- a/src/fns.c	Mon Aug 13 09:43:39 2007 +0200
+++ b/src/fns.c	Mon Aug 13 09:44:42 2007 +0200
@@ -719,8 +719,8 @@
 	  /* Fetch next element of `seq' arg into `elt' */
 	  if (CONSP (seq))
             {
-              elt = Fcar (seq);
-              seq = Fcdr (seq);
+              elt = XCAR (seq);
+              seq = XCDR (seq);
             }
 	  else
 	    {
@@ -1733,8 +1733,9 @@
   while (!NILP (tail))
     {
       QUIT;
-      next = Fcdr (tail);
-      Fsetcdr (tail, prev);
+      CHECK_CONS (tail);
+      next = XCDR (tail);
+      XCDR (tail) = prev;
       prev = tail;
       tail = next;
     }
@@ -1748,17 +1749,13 @@
 */
        (list))
 {
-  Lisp_Object length;
-  Lisp_Object *vec;
-  Lisp_Object tail;
-  REGISTER int i;
-
-  length = Flength (list);
-  vec = (Lisp_Object *) alloca (XINT (length) * sizeof (Lisp_Object));
-  for (i = XINT (length) - 1, tail = list; i >= 0; i--, tail = Fcdr (tail))
-    vec[i] = Fcar (tail);
-
-  return Flist (XINT (length), vec);
+  Lisp_Object new;
+
+  for (new = Qnil; CONSP (list); list = XCDR (list))
+    new = Fcons (XCAR (list), new);
+  if (!NILP (list))
+    list = wrong_type_argument (Qconsp, list);
+  return new;
 }
 
 static Lisp_Object list_merge (Lisp_Object org_l1, Lisp_Object org_l2, 
@@ -2887,10 +2884,10 @@
     return 0;
   else if (CONSP (o1))
     {
-      if (!internal_equal (Fcar (o1), Fcar (o2), depth + 1))
+      if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1))
         return 0;
-      o1 = Fcdr (o1);
-      o2 = Fcdr (o2);
+      o1 = XCDR (o1);
+      o2 = XCDR (o2);
       goto do_cdr;
     }
 
@@ -2957,10 +2954,10 @@
     return 0;
   else if (CONSP (o1))
     {
-      if (!internal_old_equal (Fcar (o1), Fcar (o2), depth + 1))
+      if (!internal_old_equal (XCAR (o1), XCAR (o2), depth + 1))
         return 0;
-      o1 = Fcdr (o1);
-      o2 = Fcdr (o2);
+      o1 = XCDR (o1);
+      o2 = XCDR (o2);
       goto do_cdr;
     }
 
@@ -3135,7 +3132,7 @@
       while (CONSP (tem))
 	{
 	  tail = tem;
-	  tem = Fcdr (tail);
+	  tem = XCDR (tail);
 	  QUIT;
 	}