[Zope3-checkins] CVS: Zope3/lib/python/Persistence/BTrees - BTreeItemsTemplate.c:1.10 BTreeModuleTemplate.c:1.10 BTreeTemplate.c:1.41 BucketTemplate.c:1.17

Jeremy Hylton jeremy@zope.com
Thu, 18 Jul 2002 18:43:41 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees
In directory cvs.zope.org:/tmp/cvs-serv27810/lib/python/Persistence/BTrees

Modified Files:
	BTreeItemsTemplate.c BTreeModuleTemplate.c BTreeTemplate.c 
	BucketTemplate.c 
Log Message:
staticforward does not appear to be necessary any more.



=== Zope3/lib/python/Persistence/BTrees/BTreeItemsTemplate.c 1.9 => 1.10 ===
 
 /* Support for the iteration protocol new in Python 2.2. */
 
-staticforward PyTypeObject BTreeIter_Type;
+static PyTypeObject BTreeIter_Type;
 
 /* The type of iterator objects, returned by e.g. iter(IIBTree()). */
 typedef struct {


=== Zope3/lib/python/Persistence/BTrees/BTreeModuleTemplate.c 1.9 => 1.10 ===
   BTreeItem *data;
 } BTree;
 
-staticforward PyTypeObject BTreeType;
+static PyTypeObject BTreeType;
+static PyTypeObject BucketType;
 
 #define BTREE(O) ((BTree*)(O))
 


=== Zope3/lib/python/Persistence/BTrees/BTreeTemplate.c 1.40 => 1.41 ===
             goto Done;                          \
     }
 
-    assert(self->ob_type->tp_dictoffset == 0);
+    if (self->ob_type == &BTreeType)
+	assert(self->ob_type->tp_dictoffset == 0);
 
     err = PyPersist_BASE_TYPE->tp_traverse((PyObject *)self, visit, arg);
     if (err)


=== Zope3/lib/python/Persistence/BTrees/BucketTemplate.c 1.16 => 1.17 ===
         goto Done;
 
     if (self->len > i) {
-        memmove(self->keys + i+1, self->keys + i,
-                sizeof(KEY_TYPE)*(self->len - i));
+        memmove(self->keys + i + 1, self->keys + i,
+                sizeof(KEY_TYPE) * (self->len - i));
         if (self->values) {
-            memmove(self->values + i+1, self->values + i,
-                    sizeof(VALUE_TYPE)*(self->len - i));
+            memmove(self->values + i + 1, self->values + i,
+                    sizeof(VALUE_TYPE) * (self->len - i));
         }
     }
 
@@ -420,8 +420,9 @@
 static int
 bucket_setitem(Bucket *self, PyObject *key, PyObject *v)
 {
-  if (_bucket_set(self, key, v, 0, 0, 0) < 0) return -1;
-  return 0;
+    if (_bucket_set(self, key, v, 0, 0, 0) < 0) 
+	return -1;
+    return 0;
 }
 
 /**
@@ -1361,7 +1362,7 @@
 */
 
 static struct PyMemberDef Bucket_members[] = {
-    {"_next", T_OBJECT, offsetof(Bucket, next), RO},
+    {"_next", T_OBJECT, offsetof(Bucket, next)},
     {NULL}
 };
 
@@ -1450,8 +1451,9 @@
         if (err)                                \
             goto Done;                          \
     }
-
-    assert(self->ob_type->tp_dictoffset == 0);
+    
+    if (self->ob_type == &BucketType)
+	assert(self->ob_type->tp_dictoffset == 0);
 
     err = PyPersist_BASE_TYPE->tp_traverse((PyObject *)self, visit, arg);
     if (err)