[Zodb-checkins] CVS: Zope2/lib/python/ZODB - winlock.c:1.5

[email protected] [email protected]
Tue, 27 Mar 2001 19:36:33 -0500 (EST)


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

Modified Files:
	winlock.c 
Log Message:
gcc -Wall cleanup

Add parens (and reflow long line).
Add module doc string.
Remove PyErr_Occurred() test at end of module init.




--- Updated File winlock.c in package Zope2/lib/python/ZODB --
--- winlock.c	1999/03/10 00:15:00	1.4
+++ winlock.c	2001/03/28 00:36:32	1.5
@@ -82,7 +82,10 @@
   attributions are listed in the accompanying credits file.
   
  ****************************************************************************/
-static char *what_string = "$Id$";
+static char winlock_doc_string[] = 
+"Lock files on Windows."
+"\n"
+"$Id$\n";
 
 #include "Python.h"
 
@@ -134,22 +137,22 @@
 #define DL_EXPORT(RTYPE) RTYPE
 #endif
 DL_EXPORT(void)
-initwinlock() {
+initwinlock(void) {
   PyObject *m, *d;
   char *rev="$Revision$";
 
-  if (! (Error=PyString_FromString("winlock.error"))) return;
+  if (!(Error=PyString_FromString("winlock.error"))) 
+      return;
 
   /* Create the module and add the functions */
-  m = Py_InitModule4("winlock", methods,
-		     "lock files on windows",
-		     (PyObject*)NULL,PYTHON_API_VERSION);
+  m = Py_InitModule4("winlock", methods, winlock_doc_string, (PyObject*)NULL,
+		     PYTHON_API_VERSION);
 
   d = PyModule_GetDict(m);
   PyDict_SetItemString(d, "error", Error);
+  /* XXX below could blow up in PyDict_SetItem() */
   PyDict_SetItemString(d,"__version__",
 		       PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
-  if (PyErr_Occurred()) Py_FatalError("can't initialize module winlock");
 }