[Zodb-checkins] CVS: ZODB3/Persistence - cPickleCache.c:1.85.8.12 ring.c:1.1.2.3 ring.h:1.1.2.3

Tim Peters tim.one at comcast.net
Wed Jul 9 17:34:51 EDT 2003


Update of /cvs-repository/ZODB3/Persistence
In directory cvs.zope.org:/tmp/cvs-serv19818/Persistence

Modified Files:
      Tag: zodb33-devel-branch
	cPickleCache.c ring.c ring.h 
Log Message:
Put an "r_" prefix on the CPersistentRing_struct members.  We were
trying to track down a problem earlier today, and searching for "prev"
and (especially) "next" was simply hopeless.


=== ZODB3/Persistence/cPickleCache.c 1.85.8.11 => 1.85.8.12 ===
--- ZODB3/Persistence/cPickleCache.c:1.85.8.11	Wed Jul  9 15:38:13 2003
+++ ZODB3/Persistence/cPickleCache.c	Wed Jul  9 16:34:43 2003
@@ -187,26 +187,26 @@
 	       head of the list.
 	    */
 
-            placeholder.next = here->next;
-            placeholder.prev = here;
-            here->next->prev = &placeholder;
-            here->next = &placeholder;
+            placeholder.next = here->r_next;
+            placeholder.r_prev = here;
+            here->r_next->r_prev = &placeholder;
+            here->r_next = &placeholder;
 
             /* In Python, "obj._p_changed = None" spells, ghostify */
             error = PyObject_SetAttr((PyObject *)object, py__p_changed, 
 				     Py_None);
 
             /* unlink the placeholder */
-            placeholder.next->prev = placeholder.prev;
-            placeholder.prev->next = placeholder.next;
+            placeholder.r_next->r_prev = placeholder.r_prev;
+            placeholder.r_prev->r_next = placeholder.r_next;
 
-            here = placeholder.next;
+            here = placeholder.r_next;
 
             if (error) 
                 return -1; /* problem */
         }
         else 
-            here = here->next;
+            here = here->r_next;
     }
 }
 
@@ -434,7 +434,7 @@
             return NULL;
 	}
         Py_DECREF(v);
-        here = here->next;
+        here = here->r_next;
     }
 
     return l;
@@ -507,7 +507,7 @@
     int c = 0;
 
     for (here = self->ring_home.next; here != &self->ring_home;
-	 here = here->next)
+	 here = here->r_next)
 	c++;
     return PyInt_FromLong(c);
 }
@@ -625,11 +625,11 @@
 	}
 	o->cache = NULL;
 	Py_DECREF(self);
-	self->ring_home.next = here->next;
+	self->ring_home.next = here->r_next;
 	o->ring.prev = NULL;
 	o->ring.next = NULL;
 	Py_DECREF(o);
-	here = here->next;
+	here = here->r_next;
     }
 
     Py_XDECREF(self->jar);
@@ -674,7 +674,7 @@
     while (here != &self->ring_home) {
 	cPersistentObject *o = OBJECT_FROM_RING(self, here, "foo");
 	VISIT(o);
-	here = here->next;
+	here = here->r_next;
     }
 #undef VISIT
     


=== ZODB3/Persistence/ring.c 1.1.2.2 => 1.1.2.3 ===
--- ZODB3/Persistence/ring.c:1.1.2.2	Wed Jul  9 16:31:52 2003
+++ ZODB3/Persistence/ring.c	Wed Jul  9 16:34:43 2003
@@ -31,29 +31,29 @@
 void
 ring_add(CPersistentRing *ring, CPersistentRing *elt)
 {
-    assert(!elt->next);
-    elt->next = ring;
-    elt->prev = ring->prev;
-    ring->prev->next = elt;
-    ring->prev = elt;
+    assert(!elt->r_next);
+    elt->r_next = ring;
+    elt->r_prev = ring->r_prev;
+    ring->r_prev->r_next = elt;
+    ring->r_prev = elt;
 }
 
 void
 ring_del(CPersistentRing *elt)
 {
-    elt->next->prev = elt->prev;
-    elt->prev->next = elt->next;
-    elt->next = NULL;
-    elt->prev = NULL;
+    elt->r_next->r_prev = elt->r_prev;
+    elt->r_prev->r_next = elt->r_next;
+    elt->r_next = NULL;
+    elt->r_prev = NULL;
 }
 
 void
 ring_move_to_head(CPersistentRing *ring, CPersistentRing *elt)
 {
-    elt->prev->next = elt->next;
-    elt->next->prev = elt->prev;
-    elt->next = ring;
-    elt->prev = ring->prev;
-    ring->prev->next = elt;
-    ring->prev = elt;
+    elt->r_prev->r_next = elt->r_next;
+    elt->r_next->r_prev = elt->r_prev;
+    elt->r_next = ring;
+    elt->r_prev = ring->r_prev;
+    ring->r_prev->r_next = elt;
+    ring->r_prev = elt;
 }


=== ZODB3/Persistence/ring.h 1.1.2.2 => 1.1.2.3 ===
--- ZODB3/Persistence/ring.h:1.1.2.2	Wed Jul  9 16:31:52 2003
+++ ZODB3/Persistence/ring.h	Wed Jul  9 16:34:43 2003
@@ -27,8 +27,8 @@
 
 typedef struct CPersistentRing_struct
 {
-    struct CPersistentRing_struct *prev;
-    struct CPersistentRing_struct *next;
+    struct CPersistentRing_struct *r_prev;
+    struct CPersistentRing_struct *r_next;
 } CPersistentRing;
 
 void ring_add(CPersistentRing *ring, CPersistentRing *elt);




More information about the Zodb-checkins mailing list