[Zodb-checkins] CVS: ZODB3/Persistence - cPickleCache.c:1.85.8.4
Jeremy Hylton
jeremy at zope.com
Mon Jul 7 15:22:35 EDT 2003
Update of /cvs-repository/ZODB3/Persistence
In directory cvs.zope.org:/tmp/cvs-serv27463
Modified Files:
Tag: zodb33-devel-branch
cPickleCache.c
Log Message:
Remove unused macro definitions.
In some cases, make sure the macro is unused.
=== ZODB3/Persistence/cPickleCache.c 1.85.8.3 => 1.85.8.4 ===
--- ZODB3/Persistence/cPickleCache.c:1.85.8.3 Mon Jul 7 14:11:17 2003
+++ ZODB3/Persistence/cPickleCache.c Mon Jul 7 14:22:29 2003
@@ -92,11 +92,6 @@
"\n"
"$Id$\n";
-#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
-#define UNLESS(E) if(!(E))
-#define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V)
-#define OBJECT(O) ((PyObject*)O)
-
#define DONT_USE_CPERSISTENCECAPI
#include "cPersistence.h"
#include <time.h>
@@ -106,14 +101,6 @@
static PyObject *py__p_oid, *py_reload, *py__p_jar, *py__p_changed;
static cPersistenceCAPIstruct *capi;
-/* Do we want 'engine noise'.... abstract debugging output useful for
- visualizing cache behavior */
-#if 0
-#define ENGINE_NOISE(A) printf(A)
-#else
-#define ENGINE_NOISE(A) ((void)A)
-#endif
-
/* This object is the pickle cache. The CACHE_HEAD macro guarantees
that layout of this struct is the same as the start of
ccobject_head in cPersistence.c */
@@ -204,8 +191,6 @@
here->next->prev = &placeholder;
here->next = &placeholder;
- ENGINE_NOISE("G");
-
/* In Python, "obj._p_changed = None" spells, ghostify */
error = PyObject_SetAttr((PyObject *)object, py__p_changed,
Py_None);
@@ -221,7 +206,6 @@
return -1; /* problem */
}
else {
- ENGINE_NOISE(".");
here = here->next;
}
}
@@ -239,14 +223,12 @@
return Py_None;
}
- ENGINE_NOISE("<");
self->ring_lock = 1;
if (scan_gc_items(self, target_size)) {
self->ring_lock = 0;
return NULL;
}
self->ring_lock = 0;
- ENGINE_NOISE(">\n");
Py_INCREF(Py_None);
return Py_None;
@@ -575,10 +557,10 @@
static void
cc_dealloc(ccobject *self)
{
- Py_XDECREF(self->data);
- Py_XDECREF(self->jar);
- Py_XDECREF(self->setklassstate);
- PyMem_DEL(self);
+ Py_XDECREF(self->data);
+ Py_XDECREF(self->jar);
+ Py_XDECREF(self->setklassstate);
+ PyMem_DEL(self);
}
static PyObject *
@@ -621,19 +603,19 @@
return 0;
}
- if(strcmp(name,"cache_size")==0)
- {
- UNLESS(PyArg_Parse(value,"i",&v)) return -1;
- self->cache_size=v;
- return 0;
- }
+ if (strcmp(name, "cache_size") == 0) {
+ if (!PyArg_Parse(value,"i",&v))
+ return -1;
+ self->cache_size=v;
+ return 0;
+ }
- if(strcmp(name,"cache_drain_resistance")==0)
- {
- UNLESS(PyArg_Parse(value,"i",&v)) return -1;
- self->cache_drain_resistance=v;
+ if (strcmp(name, "cache_drain_resistance") == 0) {
+ if (!PyArg_Parse(value,"i",&v))
+ return -1;
+ self->cache_drain_resistance = v;
return 0;
- }
+ }
}
PyErr_SetString(PyExc_AttributeError, name);
return -1;
More information about the Zodb-checkins
mailing list