[Zope-Checkins] CVS: Zope2 - BTree.c:1.29
shane@digicool.com
shane@digicool.com
Wed, 23 May 2001 14:24:49 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/Components/BTree
In directory korak.digicool.com:/tmp/cvs-serv14246
Modified Files:
BTree.c
Log Message:
Silenced gcc warnings.
- Added parentheses to inline assignments.
- Removed the unused function "Twople".
- Unnecessarily initialized "iv" of BTree_ini(). (Compiler isn't smart
enough to see that "iv" is never used uninitialized.)
- Added curly braces.
- Removed unused var "v" from BTree_setstate.
- Used "void" in place of empty parameter lists.
--- Updated File BTree.c in package Zope2 --
--- BTree.c 2000/05/16 17:36:00 1.28
+++ BTree.c 2001/05/23 18:24:49 1.29
@@ -389,7 +389,7 @@
{
void *r;
- if(r=malloc(sz)) return r;
+ if((r=malloc(sz))) return r;
PyErr_NoMemory();
return NULL;
@@ -400,28 +400,12 @@
{
void *r;
- if(r=realloc(p,sz)) return r;
+ if((r=realloc(p,sz))) return r;
PyErr_NoMemory();
return NULL;
}
-static PyObject *
-Twople(PyObject *i1, PyObject *i2)
-{
- PyObject *t;
-
- if(t=PyTuple_New(2))
- {
- Py_INCREF(i1);
- PyTuple_SET_ITEM(t,0,i1);
- Py_INCREF(i2);
- PyTuple_SET_ITEM(t,1,i2);
- }
-
- return t;
-}
-
static int
BTree_ini(BTree *self)
{
@@ -720,7 +704,7 @@
int ikey;
#endif
#ifdef INTVAL
- int iv;
+ int iv = 0;
#endif
#ifdef INTKEY
@@ -1417,7 +1401,9 @@
for(i=0; i<l; i++, d++)
{
UNLESS(r=PySequence_GetItem(keys,i)) goto err;
- if(i < self->len) Py_DECREF(d->key);
+ if(i < self->len) {
+ Py_DECREF(d->key);
+ }
d->key=r;
}
#endif
@@ -1438,7 +1424,9 @@
for(i=0; i<l; i++, d++)
{
UNLESS(r=PySequence_GetItem(values,i)) goto err;
- if(i < self->len) Py_DECREF(d->value);
+ if(i < self->len) {
+ Py_DECREF(d->value);
+ }
d->value=r;
}
#endif
@@ -1780,7 +1768,7 @@
static PyObject *
BTree_setstate(BTree *self, PyObject *args)
{
- PyObject *state, *v=0;
+ PyObject *state;
BTreeItem *d;
int l, i;
@@ -2094,18 +2082,18 @@
void
#ifdef INTKEY
#ifdef INTVAL
-initIIBTree()
+initIIBTree(void)
#define MODNAME "IIBTree"
#else
-initIOBTree()
+initIOBTree(void)
#define MODNAME "IOBTree"
#endif
#else
#ifdef INTVAL
-initOIBTree()
+initOIBTree(void)
#define MODNAME "OIBTree"
#else
-initBTree()
+initBTree(void)
#define MODNAME "BTree"
#endif
#endif
@@ -2119,7 +2107,7 @@
return;
#ifdef PERSISTENT
- if(cPersistenceCAPI=PyCObject_Import("cPersistence","CAPI"))
+ if((cPersistenceCAPI=PyCObject_Import("cPersistence","CAPI")))
{
BucketType.methods.link=cPersistenceCAPI->methods;
BucketType.tp_getattro=cPersistenceCAPI->getattro;