[Zope-Checkins] CVS: Zope2 - intSet.c:1.20

shane@digicool.com shane@digicool.com
Wed, 23 May 2001 14:27:42 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/Components/BTree
In directory korak.digicool.com:/tmp/cvs-serv14269

Modified Files:
	intSet.c 
Log Message:
Silenced gcc warnings.

- Removed the ASSIGN macros, which are never used.

- Removed the unused functions _PER_RETURN and _PER_INT_RETURN.

- Removed a dereference operation whose result is never used.

- Changed empty parameter list to "void".

- Put inline assignment in parantheses.



--- Updated File intSet.c in package Zope2 --
--- intSet.c	2000/05/16 17:41:16	1.19
+++ intSet.c	2001/05/23 18:27:42	1.20
@@ -95,10 +95,7 @@
 #include <time.h>
 #include "cPersistence.h"
 
-static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;}
-#define ASSIGN(V,E) PyVar_Assign(&(V),(E))
 #define UNLESS(E) if(!(E))
-#define UNLESS_ASSIGN(V,E) ASSIGN(V,E); UNLESS(V)
 #define RETURN_NONE Py_INCREF(Py_None); return Py_None
 
 #define MIN_INTSET_ALLOC 8
@@ -118,20 +115,6 @@
 #define OBJECT(O) ((PyObject*)(O))
 #define INTSET(O) ((intSet*)(O))
 
-static PyObject *
-_PER_RETURN(intSet *self, PyObject *r)
-{
-  PER_ALLOW_DEACTIVATION(self);
-  return r;
-}
-
-static int
-_PER_INT_RETURN(intSet *self, int r)
-{
-  PER_ALLOW_DEACTIVATION(self);
-  return r;
-}
-
 /* We want to be sticky most of the time */
 #define PER_RETURN(O,R) R
 #define PER_INT_RETURN(O,R) R
@@ -276,7 +259,7 @@
   UNLESS(r=PyString_FromStringAndSize(NULL,l*4)) goto err;
   UNLESS(c=PyString_AsString(r)) goto err;
   d=self->data;
-  for(i=0; i < l; i++, *d++)
+  for(i=0; i < l; i++, d++)
     {
       *c++ = (int)( *d        & 0xff);
       *c++ = (int)((*d >> 8)  & 0xff);
@@ -610,14 +593,14 @@
 };
 
 void
-initintSet()
+initintSet(void)
 {
   PyObject *m, *d;
   char *rev="$Revision$";
 
   UNLESS(ExtensionClassImported) return;
 
-  if(cPersistenceCAPI=PyCObject_Import("cPersistence","CAPI"))
+  if((cPersistenceCAPI=PyCObject_Import("cPersistence","CAPI")))
     {
       intSetType.methods.link=cPersistenceCAPI->methods;
       intSetType.tp_getattro=cPersistenceCAPI->getattro;