[Zodb-checkins] CVS: ZODB3/ZODB - cPersistence.h:1.25.120.1 cPickleCache.c:1.85.6.3

Tim Peters tim.one at comcast.net
Tue May 18 11:54:46 EDT 2004


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv6331/ZODB

Modified Files:
      Tag: Zope-2_7-branch
	cPersistence.h cPickleCache.c 
Log Message:
Trimmed trailing whitespace, in preparation for real changes.


=== ZODB3/ZODB/cPersistence.h 1.25 => 1.25.120.1 ===
--- ZODB3/ZODB/cPersistence.h:1.25	Thu Apr  4 20:12:48 2002
+++ ZODB3/ZODB/cPersistence.h	Tue May 18 11:54:44 2004
@@ -2,14 +2,14 @@
 
   Copyright (c) 2001, 2002 Zope Corporation and Contributors.
   All Rights Reserved.
-  
+
   This software is subject to the provisions of the Zope Public License,
   Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
   WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
   FOR A PARTICULAR PURPOSE
-  
+
  ****************************************************************************/
 
 #ifndef CPERSISTENCE_H
@@ -79,7 +79,7 @@
 #define PERSISTENT_TYPE_FLAG EXTENSIONCLASS_USER_FLAG8
 
 /* ExtensionClass class flags for persistent base classes should
-   include PERSISTENCE_FLAGS. 
+   include PERSISTENCE_FLAGS.
 */
 #define PERSISTENCE_FLAGS EXTENSIONCLASS_BASICNEW_FLAG | PERSISTENT_TYPE_FLAG \
   | EXTENSIONCLASS_PYTHONICATTR_FLAG
@@ -105,5 +105,3 @@
 #define PER_ACCESSED(O)  (cPersistenceCAPI->accessed((cPersistentObject*)(O)))
 
 #endif
-
-


=== ZODB3/ZODB/cPickleCache.c 1.85.6.2 => 1.85.6.3 ===
--- ZODB3/ZODB/cPickleCache.c:1.85.6.2	Wed Oct  1 16:36:19 2003
+++ ZODB3/ZODB/cPickleCache.c	Tue May 18 11:54:44 2004
@@ -180,7 +180,7 @@
 	   the current ring node is a persistent object now we know it
 	   is not the home */
         object = OBJECT_FROM_RING(self, here, "scan_gc_items");
-        if (!object) 
+        if (!object)
 	    return -1;
 
 	/* we are small enough */
@@ -207,7 +207,7 @@
             ENGINE_NOISE("G");
 
             /* In Python, "obj._p_changed = None" spells, ghostify */
-            error = PyObject_SetAttr((PyObject *)object, py__p_changed, 
+            error = PyObject_SetAttr((PyObject *)object, py__p_changed,
 				     Py_None);
 
 
@@ -263,13 +263,13 @@
         /* This cache will gradually drain down to a small size. Check
            a (small) number of objects proportional to the current size */
 
-        int target_size_2 = (starting_size - 1 
+        int target_size_2 = (starting_size - 1
 			     - starting_size / self->cache_drain_resistance);
         if (target_size_2 < target_size)
             target_size = target_size_2;
     }
 
-    if (!PyArg_ParseTuple(args, "|i:incrgc", &n)) 
+    if (!PyArg_ParseTuple(args, "|i:incrgc", &n))
 	return NULL;
 
     return lockgc(self, target_size);
@@ -279,7 +279,7 @@
 cc_full_sweep(ccobject *self, PyObject *args)
 {
     int dt = 0;
-    if (!PyArg_ParseTuple(args, "|i:full_sweep", &dt)) 
+    if (!PyArg_ParseTuple(args, "|i:full_sweep", &dt))
 	return NULL;
     if (dt == 0)
 	return lockgc(self, 0);
@@ -291,7 +291,7 @@
 cc_minimize(ccobject *self, PyObject *args)
 {
     int ignored;
-    if (!PyArg_ParseTuple(args, "|i:minimize", &ignored)) 
+    if (!PyArg_ParseTuple(args, "|i:minimize", &ignored))
 	return NULL;
     return lockgc(self, 0);
 }
@@ -311,9 +311,9 @@
 	}
 	else {
 	    v = PyObject_CallFunction(self->setklassstate, "O", v);
-	    if (v) 
+	    if (v)
 		Py_DECREF(v);
-	    else 
+	    else
 		PyErr_Clear();
 	}
     } else {
@@ -335,13 +335,13 @@
   }
   else {
       PyErr_Clear();
-      if (!PyArg_ParseTuple(args, "O:invalidate", &inv)) 
+      if (!PyArg_ParseTuple(args, "O:invalidate", &inv))
 	  return NULL;
       if (PyString_Check(inv))
 	  _invalidate(self, inv);
       else {
 	  int l;
-	  
+
 	  PyErr_Clear();
 	  l = PyObject_Length(inv);
 	  if (l < 0)
@@ -357,17 +357,17 @@
 	  PySequence_DelSlice(inv, 0, l);
       }
   }
-  
+
   Py_INCREF(Py_None);
   return Py_None;
 }
-  
+
 static PyObject *
 cc_get(ccobject *self, PyObject *args)
 {
     PyObject *r, *key, *d = NULL;
 
-    if (!PyArg_ParseTuple(args, "O|O:get", &key, &d)) 
+    if (!PyArg_ParseTuple(args, "O|O:get", &key, &d))
 	return NULL;
 
     r = PyDict_GetItem(self->data, key);
@@ -389,11 +389,11 @@
     PyObject *l,*k,*v;
     int p = 0;
 
-    if (!PyArg_ParseTuple(args, ":klass_items")) 
+    if (!PyArg_ParseTuple(args, ":klass_items"))
 	return NULL;
 
     l = PyList_New(PyDict_Size(self->data));
-    if (l == NULL) 
+    if (l == NULL)
 	return NULL;
 
     while (PyDict_Next(self->data, &p, &k, &v)) {
@@ -421,7 +421,7 @@
     PyObject *l;
     CPersistentRing *here;
 
-    if (!PyArg_ParseTuple(args, ":lru_items")) 
+    if (!PyArg_ParseTuple(args, ":lru_items"))
 	return NULL;
 
     if (self->ring_lock) {
@@ -434,7 +434,7 @@
     }
 
     l = PyList_New(0);
-    if (l == NULL) 
+    if (l == NULL)
 	return NULL;
 
     here = self->ring_home.next;
@@ -534,7 +534,7 @@
 
     assert(v->ob_refcnt == 0);
     /* Need to be very hairy here because a dictionary is about
-       to decref an already deleted object. 
+       to decref an already deleted object.
     */
 
 #ifdef Py_TRACE_REFS
@@ -542,7 +542,7 @@
        interpreter has untracked the reference.  Track it again.
      */
     _Py_NewReference(v);
-    /* Don't increment total refcount as a result of the 
+    /* Don't increment total refcount as a result of the
        shenanigans played in this function.  The _Py_NewReference()
        call above creates artificial references to v.
     */
@@ -559,7 +559,7 @@
     Py_INCREF(v);
 
     /* XXX Should we call _Py_ForgetReference() on error exit? */
-    if (PyDict_DelItem(self->data, oid) < 0) 
+    if (PyDict_DelItem(self->data, oid) < 0)
 	return -1;
     Py_DECREF((ccobject *)((cPersistentObject *)v)->cache);
 
@@ -697,7 +697,7 @@
 {
     return PyObject_Length(self->data);
 }
-  
+
 static PyObject *
 cc_subscript(ccobject *self, PyObject *key)
 {
@@ -730,7 +730,7 @@
         derive from Persistence.Persistent, BTrees, etc). Thats ok. */
     }
     else {
-	PyErr_SetString(PyExc_TypeError, 
+	PyErr_SetString(PyExc_TypeError,
 			"Cache values must be persistent objects.");
 	return -1;
     }
@@ -754,7 +754,7 @@
     if (PyErr_Occurred()) {
 	Py_DECREF(oid);
 	return -1;
-    } 
+    }
     Py_DECREF(oid);
     if (result) {
 	PyErr_SetString(PyExc_ValueError, "Cache key does not match oid");
@@ -786,7 +786,7 @@
     }
 
     if (PyExtensionClass_Check(v)) {
-	if (PyDict_SetItem(self->data, key, v) < 0) 
+	if (PyDict_SetItem(self->data, key, v) < 0)
 	    return -1;
 	self->klass_count++;
 	return 0;
@@ -795,28 +795,28 @@
 	if (cache) {
 	    if (cache != (PerCache *)self)
 		/* This object is already in a different cache. */
-		PyErr_SetString(PyExc_ValueError, 
+		PyErr_SetString(PyExc_ValueError,
 				"Cache values may only be in one cache.");
 	    return -1;
-	} 
+	}
 	/* else:
-	   
+
 	   This object is already one of ours, which is ok.  It
 	   would be very strange if someone was trying to register
-	   the same object under a different key. 
+	   the same object under a different key.
 	*/
     }
-    
-    if (PyDict_SetItem(self->data, key, v) < 0) 
+
+    if (PyDict_SetItem(self->data, key, v) < 0)
 	return -1;
     /* the dict should have a borrowed reference */
     Py_DECREF(v);
-    
+
     p = (cPersistentObject *)v;
     Py_INCREF(self);
     p->cache = (PerCache *)self;
     if (p->state >= 0) {
-	/* insert this non-ghost object into the ring just 
+	/* insert this non-ghost object into the ring just
 	   behind the home position. */
 	self->non_ghost_count++;
 	p->ring.next = &self->ring_home;
@@ -920,7 +920,7 @@
 newccobject(PyObject *jar, int cache_size)
 {
     ccobject *self;
-  
+
     self = PyObject_NEW(ccobject, &Cctype);
     if (self == NULL)
 	return NULL;
@@ -935,7 +935,7 @@
 	Py_DECREF(self);
 	return NULL;
     }
-    self->jar = jar; 
+    self->jar = jar;
     Py_INCREF(jar);
     self->cache_size = cache_size;
     self->non_ghost_count = 0;
@@ -970,7 +970,7 @@
 
     Cctype.ob_type = &PyType_Type;
 
-    if (!ExtensionClassImported) 
+    if (!ExtensionClassImported)
 	return;
 
     capi = (cPersistenceCAPIstruct *)PyCObject_Import("cPersistence", "CAPI");




More information about the Zodb-checkins mailing list