[Zodb-checkins] CVS: Zope2/lib/python/ZODB - cPickleCache.c:1.32

jeremy@digicool.com jeremy@digicool.com
Tue, 27 Mar 2001 19:35:10 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv22024

Modified Files:
	cPickleCache.c 
Log Message:
gcc -Wall satisfaction
add parens and module doc string



--- Updated File cPickleCache.c in package Zope2/lib/python/ZODB --
--- cPickleCache.c	1999/10/13 12:35:19	1.31
+++ cPickleCache.c	2001/03/28 00:35:09	1.32
@@ -82,7 +82,10 @@
   attributions are listed in the accompanying credits file.
   
  ****************************************************************************/
-static char *what_string = "$Id$";
+static char cPickleCache_doc_string[] = 
+"Defines the PickleCache used by ZODB Connection objects.\n"
+"\n"
+"$Id$\n";
 
 #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
 #define UNLESS(E) if(!(E))
@@ -478,7 +481,7 @@
   
   UNLESS(self = PyObject_NEW(ccobject, &Cctype)) return NULL;
   self->setklassstate=self->jar=NULL;
-  if(self->data=PyDict_New())
+  if((self->data=PyDict_New()))
     {
       self->jar=jar; 
       Py_INCREF(jar);
@@ -542,14 +545,13 @@
 	  return self->data;
 	}
     }
-  if(
-     *name=='h' && strcmp(name, "has_key")==0 ||
-     *name=='i' && strcmp(name, "items")==0 ||
-     *name=='k' && strcmp(name, "keys")==0
+  if((*name=='h' && strcmp(name, "has_key")==0) ||
+     (*name=='i' && strcmp(name, "items")==0) ||
+     (*name=='k' && strcmp(name, "keys")==0)
      )
     return PyObject_GetAttrString(self->data, name);
 
-  if(r=Py_FindMethod(cc_methods, (PyObject *)self, name))
+  if((r=Py_FindMethod(cc_methods, (PyObject *)self, name)))
     return r;
   PyErr_Clear();
   return PyObject_GetAttrString(self->data, name);
@@ -662,7 +664,8 @@
   int cache_size=100, cache_age=1000;
   PyObject *jar;
 
-  UNLESS(PyArg_ParseTuple(args, "O|ii", &jar, &cache_size, &cache_age)) return NULL;
+  UNLESS(PyArg_ParseTuple(args, "O|ii", &jar, &cache_size, &cache_age))
+      return NULL;
   return (PyObject*)newccobject(jar, cache_size,cache_age);
 }
 
@@ -672,7 +675,7 @@
 };
 
 void
-initcPickleCache()
+initcPickleCache(void)
 {
   PyObject *m, *d;
   char *rev="$Revision$";
@@ -681,8 +684,8 @@
 
   UNLESS(ExtensionClassImported) return;
 
-  m = Py_InitModule4("cPickleCache", cCM_methods, "",
-		     (PyObject*)NULL,PYTHON_API_VERSION);
+  m = Py_InitModule4("cPickleCache", cCM_methods, cPickleCache_doc_string,
+		     (PyObject*)NULL, PYTHON_API_VERSION);
 
   d = PyModule_GetDict(m);
 
@@ -692,6 +695,4 @@
 
   PyDict_SetItemString(d,"__version__",
 		       PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
-  
-  if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache");
 }