ANSI-fication, not really tested, but should (hopefully) compile
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c
index 23c2894..c211d23 100644
--- a/Modules/bsddbmodule.c
+++ b/Modules/bsddbmodule.c
@@ -54,17 +54,8 @@
static PyObject *BsddbError;
static PyObject *
-newdbhashobject(file, flags, mode,
- bsize, ffactor, nelem, cachesize, hash, lorder)
- char *file;
- int flags;
- int mode;
- int bsize;
- int ffactor;
- int nelem;
- int cachesize;
- int hash; /* XXX ignored */
- int lorder;
+newdbhashobject(char *file, int flags, int mode,
+ int bsize, int ffactor, int nelem, int cachesize, int hash, int lorder)
{
bsddbobject *dp;
HASHINFO info;
@@ -108,17 +99,8 @@
}
static PyObject *
-newdbbtobject(file, flags, mode,
- btflags, cachesize, maxkeypage, minkeypage, psize, lorder)
- char *file;
- int flags;
- int mode;
- int btflags;
- int cachesize;
- int maxkeypage;
- int minkeypage;
- int psize;
- int lorder;
+newdbbtobject(char *file, int flags, int mode,
+ int btflags, int cachesize, int maxkeypage, int minkeypage, int psize, int lorder)
{
bsddbobject *dp;
BTREEINFO info;
@@ -164,18 +146,8 @@
}
static PyObject *
-newdbrnobject(file, flags, mode,
- rnflags, cachesize, psize, lorder, reclen, bval, bfname)
- char *file;
- int flags;
- int mode;
- int rnflags;
- int cachesize;
- int psize;
- int lorder;
- size_t reclen;
- u_char bval;
- char *bfname;
+newdbrnobject(char *file, int flags, int mode,
+ int rnflags, int cachesize, int psize, int lorder, size_t reclen, u_char bval, char *bfname)
{
bsddbobject *dp;
RECNOINFO info;
@@ -220,8 +192,7 @@
}
static void
-bsddb_dealloc(dp)
- bsddbobject *dp;
+bsddb_dealloc(bsddbobject *dp)
{
#ifdef WITH_THREAD
if (dp->di_lock) {
@@ -253,8 +224,7 @@
#endif
static int
-bsddb_length(dp)
- bsddbobject *dp;
+bsddb_length(bsddbobject *dp)
{
if (dp->di_bsddb == NULL) {
PyErr_SetString(BsddbError, "BSDDB object has already been closed");
@@ -282,9 +252,7 @@
}
static PyObject *
-bsddb_subscript(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_subscript(bsddbobject *dp, PyObject *key)
{
int status;
DBT krec, drec;
@@ -321,9 +289,7 @@
}
static int
-bsddb_ass_sub(dp, key, value)
- bsddbobject *dp;
- PyObject *key, *value;
+bsddb_ass_sub(bsddbobject *dp, PyObject *key, PyObject *value)
{
int status;
DBT krec, drec;
@@ -387,9 +353,7 @@
};
static PyObject *
-bsddb_close(dp, args)
- bsddbobject *dp;
- PyObject *args;
+bsddb_close(bsddbobject *dp, PyObject *args)
{
if (!PyArg_NoArgs(args))
return NULL;
@@ -410,9 +374,7 @@
}
static PyObject *
-bsddb_keys(dp, args)
- bsddbobject *dp;
- PyObject *args;
+bsddb_keys(bsddbobject *dp, PyObject *args)
{
PyObject *list, *item;
DBT krec, drec;
@@ -467,9 +429,7 @@
}
static PyObject *
-bsddb_has_key(dp, args)
- bsddbobject *dp;
- PyObject *args;
+bsddb_has_key(bsddbobject *dp, PyObject *args)
{
DBT krec, drec;
int status;
@@ -494,9 +454,7 @@
}
static PyObject *
-bsddb_set_location(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_set_location(bsddbobject *dp, PyObject *key)
{
int status;
DBT krec, drec;
@@ -532,10 +490,7 @@
}
static PyObject *
-bsddb_seq(dp, args, sequence_request)
- bsddbobject *dp;
- PyObject *args;
- int sequence_request;
+bsddb_seq(bsddbobject *dp, PyObject *args, int sequence_request)
{
int status;
DBT krec, drec;
@@ -577,37 +532,27 @@
}
static PyObject *
-bsddb_next(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_next(bsddbobject *dp, PyObject *key)
{
return bsddb_seq(dp, key, R_NEXT);
}
static PyObject *
-bsddb_previous(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_previous(bsddbobject *dp, PyObject *key)
{
return bsddb_seq(dp, key, R_PREV);
}
static PyObject *
-bsddb_first(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_first(bsddbobject *dp, PyObject *key)
{
return bsddb_seq(dp, key, R_FIRST);
}
static PyObject *
-bsddb_last(dp, key)
- bsddbobject *dp;
- PyObject *key;
+bsddb_last(bsddbobject *dp, PyObject *key)
{
return bsddb_seq(dp, key, R_LAST);
}
static PyObject *
-bsddb_sync(dp, args)
- bsddbobject *dp;
- PyObject *args;
+bsddb_sync(bsddbobject *dp, PyObject *args)
{
int status;
@@ -637,9 +582,7 @@
};
static PyObject *
-bsddb_getattr(dp, name)
- PyObject *dp;
- char *name;
+bsddb_getattr(PyObject *dp, char *name)
{
return Py_FindMethod(bsddb_methods, dp, name);
}
@@ -662,9 +605,7 @@
};
static PyObject *
-bsdhashopen(self, args)
- PyObject *self;
- PyObject *args;
+bsdhashopen(PyObject *self, PyObject *args)
{
char *file;
char *flag = NULL;
@@ -715,9 +656,7 @@
}
static PyObject *
-bsdbtopen(self, args)
- PyObject *self;
- PyObject *args;
+bsdbtopen(PyObject *self, PyObject *args)
{
char *file;
char *flag = NULL;
@@ -769,9 +708,7 @@
}
static PyObject *
-bsdrnopen(self, args)
- PyObject *self;
- PyObject *args;
+bsdrnopen(PyObject *self, PyObject *args)
{
char *file;
char *flag = NULL;
diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c
index 53db0fa..cad99ba 100644
--- a/Modules/dbmmodule.c
+++ b/Modules/dbmmodule.c
@@ -34,10 +34,7 @@
static PyObject *DbmError;
static PyObject *
-newdbmobject(file, flags, mode)
- char *file;
-int flags;
-int mode;
+newdbmobject(char *file, int flags, int mode)
{
dbmobject *dp;
@@ -56,8 +53,7 @@
/* Methods */
static void
-dbm_dealloc(dp)
- register dbmobject *dp;
+dbm_dealloc(register dbmobject *dp)
{
if ( dp->di_dbm )
dbm_close(dp->di_dbm);
@@ -65,8 +61,7 @@
}
static int
-dbm_length(dp)
- dbmobject *dp;
+dbm_length(dbmobject *dp)
{
if (dp->di_dbm == NULL) {
PyErr_SetString(DbmError, "DBM object has already been closed");
@@ -86,9 +81,7 @@
}
static PyObject *
-dbm_subscript(dp, key)
- dbmobject *dp;
-register PyObject *key;
+dbm_subscript(dbmobject *dp, register PyObject *key)
{
datum drec, krec;
@@ -111,9 +104,7 @@
}
static int
-dbm_ass_sub(dp, v, w)
- dbmobject *dp;
-PyObject *v, *w;
+dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w)
{
datum krec, drec;
@@ -162,9 +153,7 @@
};
static PyObject *
-dbm__close(dp, args)
- register dbmobject *dp;
-PyObject *args;
+dbm__close(register dbmobject *dp, PyObject *args)
{
if ( !PyArg_NoArgs(args) )
return NULL;
@@ -176,9 +165,7 @@
}
static PyObject *
-dbm_keys(dp, args)
- register dbmobject *dp;
-PyObject *args;
+dbm_keys(register dbmobject *dp, PyObject *args)
{
register PyObject *v, *item;
datum key;
@@ -208,9 +195,7 @@
}
static PyObject *
-dbm_has_key(dp, args)
- register dbmobject *dp;
-PyObject *args;
+dbm_has_key(register dbmobject *dp, PyObject *args)
{
datum key, val;
@@ -229,9 +214,7 @@
};
static PyObject *
-dbm_getattr(dp, name)
- dbmobject *dp;
-char *name;
+dbm_getattr(dbmobject *dp, char *name)
{
return Py_FindMethod(dbm_methods, (PyObject *)dp, name);
}
@@ -256,9 +239,7 @@
/* ----------------------------------------------------------------- */
static PyObject *
-dbmopen(self, args)
- PyObject *self;
-PyObject *args;
+dbmopen(PyObject *self, PyObject *args)
{
char *name;
char *flags = "r";