summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-07-09 04:06:11 (GMT)
committerFred Drake <fdrake@acm.org>2000-07-09 04:06:11 (GMT)
commit799124718ddfbb95440470037d8d7760b821646f (patch)
treecf0324bf7bc44649f01c6ad8184c47e4e9e42cc9 /Objects
parenta83b68a143b4d274bf8eb7e67b789f9d7dd27f86 (diff)
downloadcpython-799124718ddfbb95440470037d8d7760b821646f.zip
cpython-799124718ddfbb95440470037d8d7760b821646f.tar.gz
cpython-799124718ddfbb95440470037d8d7760b821646f.tar.bz2
ANSI-fication of the sources.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c195
-rw-r--r--Objects/bufferobject.c102
-rw-r--r--Objects/classobject.c198
3 files changed, 135 insertions, 360 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 6350794..c13cb72 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -16,15 +16,14 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Shorthands to return certain errors */
static PyObject *
-type_error(msg)
- char *msg;
+type_error(char *msg)
{
PyErr_SetString(PyExc_TypeError, msg);
return NULL;
}
static PyObject *
-null_error()
+null_error(void)
{
if (!PyErr_Occurred())
PyErr_SetString(PyExc_SystemError,
@@ -35,10 +34,7 @@ null_error()
/* Operations on any object */
int
-PyObject_Cmp(o1, o2, result)
- PyObject *o1;
- PyObject *o2;
- int *result;
+PyObject_Cmp(PyObject *o1, PyObject *o2, int *result)
{
int r;
@@ -54,8 +50,7 @@ PyObject_Cmp(o1, o2, result)
}
PyObject *
-PyObject_Type(o)
- PyObject *o;
+PyObject_Type(PyObject *o)
{
PyObject *v;
@@ -67,8 +62,7 @@ PyObject_Type(o)
}
int
-PyObject_Length(o)
- PyObject *o;
+PyObject_Length(PyObject *o)
{
PySequenceMethods *m;
@@ -85,9 +79,7 @@ PyObject_Length(o)
}
PyObject *
-PyObject_GetItem(o, key)
- PyObject *o;
- PyObject *key;
+PyObject_GetItem(PyObject *o, PyObject *key)
{
PyMappingMethods *m;
@@ -114,10 +106,7 @@ PyObject_GetItem(o, key)
}
int
-PyObject_SetItem(o, key, value)
- PyObject *o;
- PyObject *key;
- PyObject *value;
+PyObject_SetItem(PyObject *o, PyObject *key, PyObject *value)
{
PyMappingMethods *m;
@@ -147,9 +136,7 @@ PyObject_SetItem(o, key, value)
}
int
-PyObject_DelItem(o, key)
- PyObject *o;
- PyObject *key;
+PyObject_DelItem(PyObject *o, PyObject *key)
{
PyMappingMethods *m;
@@ -289,8 +276,7 @@ int PyObject_AsWriteBuffer(PyObject *obj,
/* Operations on numbers */
int
-PyNumber_Check(o)
- PyObject *o;
+PyNumber_Check(PyObject *o)
{
return o && o->ob_type->tp_as_number;
}
@@ -302,8 +288,7 @@ PyNumber_Check(o)
return PyInstance_DoBinOp(v, w, opname, ropname, thisfunc)
PyObject *
-PyNumber_Or(v, w)
- PyObject *v, *w;
+PyNumber_Or(PyObject *v, PyObject *w)
{
extern int PyNumber_Coerce();
@@ -324,8 +309,7 @@ PyNumber_Or(v, w)
}
PyObject *
-PyNumber_Xor(v, w)
- PyObject *v, *w;
+PyNumber_Xor(PyObject *v, PyObject *w)
{
extern int PyNumber_Coerce();
@@ -346,8 +330,7 @@ PyNumber_Xor(v, w)
}
PyObject *
-PyNumber_And(v, w)
- PyObject *v, *w;
+PyNumber_And(PyObject *v, PyObject *w)
{
BINOP(v, w, "__and__", "__rand__", PyNumber_And);
if (v->ob_type->tp_as_number != NULL) {
@@ -366,8 +349,7 @@ PyNumber_And(v, w)
}
PyObject *
-PyNumber_Lshift(v, w)
- PyObject *v, *w;
+PyNumber_Lshift(PyObject *v, PyObject *w)
{
BINOP(v, w, "__lshift__", "__rlshift__", PyNumber_Lshift);
if (v->ob_type->tp_as_number != NULL) {
@@ -386,8 +368,7 @@ PyNumber_Lshift(v, w)
}
PyObject *
-PyNumber_Rshift(v, w)
- PyObject *v, *w;
+PyNumber_Rshift(PyObject *v, PyObject *w)
{
BINOP(v, w, "__rshift__", "__rrshift__", PyNumber_Rshift);
if (v->ob_type->tp_as_number != NULL) {
@@ -406,8 +387,7 @@ PyNumber_Rshift(v, w)
}
PyObject *
-PyNumber_Add(v, w)
- PyObject *v, *w;
+PyNumber_Add(PyObject *v, PyObject *w)
{
PySequenceMethods *m;
@@ -431,8 +411,7 @@ PyNumber_Add(v, w)
}
PyObject *
-PyNumber_Subtract(v, w)
- PyObject *v, *w;
+PyNumber_Subtract(PyObject *v, PyObject *w)
{
BINOP(v, w, "__sub__", "__rsub__", PyNumber_Subtract);
if (v->ob_type->tp_as_number != NULL) {
@@ -451,8 +430,7 @@ PyNumber_Subtract(v, w)
}
PyObject *
-PyNumber_Multiply(v, w)
- PyObject *v, *w;
+PyNumber_Multiply(PyObject *v, PyObject *w)
{
PyTypeObject *tp = v->ob_type;
PySequenceMethods *m;
@@ -509,8 +487,7 @@ PyNumber_Multiply(v, w)
}
PyObject *
-PyNumber_Divide(v, w)
- PyObject *v, *w;
+PyNumber_Divide(PyObject *v, PyObject *w)
{
BINOP(v, w, "__div__", "__rdiv__", PyNumber_Divide);
if (v->ob_type->tp_as_number != NULL) {
@@ -529,8 +506,7 @@ PyNumber_Divide(v, w)
}
PyObject *
-PyNumber_Remainder(v, w)
- PyObject *v, *w;
+PyNumber_Remainder(PyObject *v, PyObject *w)
{
if (PyString_Check(v))
return PyString_Format(v, w);
@@ -553,8 +529,7 @@ PyNumber_Remainder(v, w)
}
PyObject *
-PyNumber_Divmod(v, w)
- PyObject *v, *w;
+PyNumber_Divmod(PyObject *v, PyObject *w)
{
BINOP(v, w, "__divmod__", "__rdivmod__", PyNumber_Divmod);
if (v->ob_type->tp_as_number != NULL) {
@@ -575,8 +550,7 @@ PyNumber_Divmod(v, w)
/* Power (binary or ternary) */
static PyObject *
-do_pow(v, w)
- PyObject *v, *w;
+do_pow(PyObject *v, PyObject *w)
{
PyObject *res;
PyObject * (*f)(PyObject *, PyObject *, PyObject *);
@@ -599,8 +573,7 @@ do_pow(v, w)
}
PyObject *
-PyNumber_Power(v, w, z)
- PyObject *v, *w, *z;
+PyNumber_Power(PyObject *v, PyObject *w, PyObject *z)
{
PyObject *res;
PyObject *v1, *z1, *w2, *z2;
@@ -646,8 +619,7 @@ PyNumber_Power(v, w, z)
/* Unary operators and functions */
PyObject *
-PyNumber_Negative(o)
- PyObject *o;
+PyNumber_Negative(PyObject *o)
{
PyNumberMethods *m;
@@ -661,8 +633,7 @@ PyNumber_Negative(o)
}
PyObject *
-PyNumber_Positive(o)
- PyObject *o;
+PyNumber_Positive(PyObject *o)
{
PyNumberMethods *m;
@@ -676,8 +647,7 @@ PyNumber_Positive(o)
}
PyObject *
-PyNumber_Invert(o)
- PyObject *o;
+PyNumber_Invert(PyObject *o)
{
PyNumberMethods *m;
@@ -691,8 +661,7 @@ PyNumber_Invert(o)
}
PyObject *
-PyNumber_Absolute(o)
- PyObject *o;
+PyNumber_Absolute(PyObject *o)
{
PyNumberMethods *m;
@@ -707,9 +676,7 @@ PyNumber_Absolute(o)
/* Add a check for embedded NULL-bytes in the argument. */
static PyObject *
-int_from_string(s, len)
- const char *s;
- int len;
+int_from_string(const char *s, int len)
{
char *end;
PyObject *x;
@@ -727,8 +694,7 @@ int_from_string(s, len)
}
PyObject *
-PyNumber_Int(o)
- PyObject *o;
+PyNumber_Int(PyObject *o)
{
PyNumberMethods *m;
const char *buffer;
@@ -758,9 +724,7 @@ PyNumber_Int(o)
/* Add a check for embedded NULL-bytes in the argument. */
static PyObject *
-long_from_string(s, len)
- const char *s;
- int len;
+long_from_string(const char *s, int len)
{
char *end;
PyObject *x;
@@ -778,8 +742,7 @@ long_from_string(s, len)
}
PyObject *
-PyNumber_Long(o)
- PyObject *o;
+PyNumber_Long(PyObject *o)
{
PyNumberMethods *m;
const char *buffer;
@@ -813,8 +776,7 @@ PyNumber_Long(o)
}
PyObject *
-PyNumber_Float(o)
- PyObject *o;
+PyNumber_Float(PyObject *o)
{
PyNumberMethods *m;
@@ -835,15 +797,13 @@ PyNumber_Float(o)
/* Operations on sequences */
int
-PySequence_Check(s)
- PyObject *s;
+PySequence_Check(PyObject *s)
{
return s != NULL && s->ob_type->tp_as_sequence;
}
int
-PySequence_Length(s)
- PyObject *s;
+PySequence_Length(PyObject *s)
{
PySequenceMethods *m;
@@ -861,9 +821,7 @@ PySequence_Length(s)
}
PyObject *
-PySequence_Concat(s, o)
- PyObject *s;
- PyObject *o;
+PySequence_Concat(PyObject *s, PyObject *o)
{
PySequenceMethods *m;
@@ -878,9 +836,7 @@ PySequence_Concat(s, o)
}
PyObject *
-PySequence_Repeat(o, count)
- PyObject *o;
- int count;
+PySequence_Repeat(PyObject *o, int count)
{
PySequenceMethods *m;
@@ -895,9 +851,7 @@ PySequence_Repeat(o, count)
}
PyObject *
-PySequence_GetItem(s, i)
- PyObject *s;
- int i;
+PySequence_GetItem(PyObject *s, int i)
{
PySequenceMethods *m;
@@ -921,10 +875,7 @@ PySequence_GetItem(s, i)
}
PyObject *
-PySequence_GetSlice(s, i1, i2)
- PyObject *s;
- int i1;
- int i2;
+PySequence_GetSlice(PyObject *s, int i1, int i2)
{
PySequenceMethods *m;
@@ -950,10 +901,7 @@ PySequence_GetSlice(s, i1, i2)
}
int
-PySequence_SetItem(s, i, o)
- PyObject *s;
- int i;
- PyObject *o;
+PySequence_SetItem(PyObject *s, int i, PyObject *o)
{
PySequenceMethods *m;
@@ -980,9 +928,7 @@ PySequence_SetItem(s, i, o)
}
int
-PySequence_DelItem(s, i)
- PyObject *s;
- int i;
+PySequence_DelItem(PyObject *s, int i)
{
PySequenceMethods *m;
@@ -1009,11 +955,7 @@ PySequence_DelItem(s, i)
}
int
-PySequence_SetSlice(s, i1, i2, o)
- PyObject *s;
- int i1;
- int i2;
- PyObject *o;
+PySequence_SetSlice(PyObject *s, int i1, int i2, PyObject *o)
{
PySequenceMethods *m;
@@ -1042,10 +984,7 @@ PySequence_SetSlice(s, i1, i2, o)
}
int
-PySequence_DelSlice(s, i1, i2)
- PyObject *s;
- int i1;
- int i2;
+PySequence_DelSlice(PyObject *s, int i1, int i2)
{
PySequenceMethods *m;
@@ -1074,8 +1013,7 @@ PySequence_DelSlice(s, i1, i2)
}
PyObject *
-PySequence_Tuple(v)
- PyObject *v;
+PySequence_Tuple(PyObject *v)
{
PySequenceMethods *m;
@@ -1135,8 +1073,7 @@ PySequence_Tuple(v)
}
PyObject *
-PySequence_List(v)
- PyObject *v;
+PySequence_List(PyObject *v)
{
PySequenceMethods *m;
@@ -1187,9 +1124,7 @@ PySequence_List(v)
}
PyObject *
-PySequence_Fast(v, m)
- PyObject *v;
- const char* m;
+PySequence_Fast(PyObject *v, const char *m)
{
if (v == NULL)
return null_error();
@@ -1207,9 +1142,7 @@ PySequence_Fast(v, m)
}
int
-PySequence_Count(s, o)
- PyObject *s;
- PyObject *o;
+PySequence_Count(PyObject *s, PyObject *o)
{
int l, i, n, cmp, err;
PyObject *item;
@@ -1239,9 +1172,7 @@ PySequence_Count(s, o)
}
int
-PySequence_Contains(w, v) /* v in w */
- PyObject *w;
- PyObject *v;
+PySequence_Contains(PyObject *w, PyObject *v) /* v in w */
{
int i, cmp;
PyObject *x;
@@ -1285,17 +1216,13 @@ PySequence_Contains(w, v) /* v in w */
/* Backwards compatibility */
#undef PySequence_In
int
-PySequence_In(w, v)
- PyObject *w;
- PyObject *v;
+PySequence_In(PyObject *w, PyObject *v)
{
return PySequence_Contains(w, v);
}
int
-PySequence_Index(s, o)
- PyObject *s;
- PyObject *o;
+PySequence_Index(PyObject *s, PyObject *o)
{
int l, i, cmp, err;
PyObject *item;
@@ -1328,15 +1255,13 @@ PySequence_Index(s, o)
/* Operations on mappings */
int
-PyMapping_Check(o)
- PyObject *o;
+PyMapping_Check(PyObject *o)
{
return o && o->ob_type->tp_as_mapping;
}
int
-PyMapping_Length(o)
- PyObject *o;
+PyMapping_Length(PyObject *o)
{
PyMappingMethods *m;
@@ -1354,9 +1279,7 @@ PyMapping_Length(o)
}
PyObject *
-PyMapping_GetItemString(o, key)
- PyObject *o;
- char *key;
+PyMapping_GetItemString(PyObject *o, char *key)
{
PyObject *okey, *r;
@@ -1372,10 +1295,7 @@ PyMapping_GetItemString(o, key)
}
int
-PyMapping_SetItemString(o, key, value)
- PyObject *o;
- char *key;
- PyObject *value;
+PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
{
PyObject *okey;
int r;
@@ -1394,9 +1314,7 @@ PyMapping_SetItemString(o, key, value)
}
int
-PyMapping_HasKeyString(o, key)
- PyObject *o;
- char *key;
+PyMapping_HasKeyString(PyObject *o, char *key)
{
PyObject *v;
@@ -1410,9 +1328,7 @@ PyMapping_HasKeyString(o, key)
}
int
-PyMapping_HasKey(o, key)
- PyObject *o;
- PyObject *key;
+PyMapping_HasKey(PyObject *o, PyObject *key)
{
PyObject *v;
@@ -1430,8 +1346,7 @@ PyMapping_HasKey(o, key)
/* XXX PyCallable_Check() is in object.c */
PyObject *
-PyObject_CallObject(o, a)
- PyObject *o, *a;
+PyObject_CallObject(PyObject *o, PyObject *a)
{
PyObject *r;
PyObject *args = a;
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c
index 9bce20e..67d26a1 100644
--- a/Objects/bufferobject.c
+++ b/Objects/bufferobject.c
@@ -26,11 +26,7 @@ typedef struct {
static PyObject *
-_PyBuffer_FromMemory(base, ptr, size, readonly)
- PyObject *base;
- void *ptr;
- int size;
- int readonly;
+_PyBuffer_FromMemory(PyObject *base, void *ptr, int size, int readonly)
{
PyBufferObject * b;
@@ -57,12 +53,8 @@ _PyBuffer_FromMemory(base, ptr, size, readonly)
}
static PyObject *
-_PyBuffer_FromObject(base, offset, size, proc, readonly)
- PyObject *base;
- int offset;
- int size;
- getreadbufferproc proc;
- int readonly;
+_PyBuffer_FromObject(PyObject *base, int offset, int size,
+ getreadbufferproc proc, int readonly)
{
PyBufferProcs *pb = base->ob_type->tp_as_buffer;
void *p;
@@ -100,10 +92,7 @@ _PyBuffer_FromObject(base, offset, size, proc, readonly)
PyObject *
-PyBuffer_FromObject(base, offset, size)
- PyObject *base;
- int offset;
- int size;
+PyBuffer_FromObject(PyObject *base, int offset, int size)
{
PyBufferProcs *pb = base->ob_type->tp_as_buffer;
@@ -120,10 +109,7 @@ PyBuffer_FromObject(base, offset, size)
}
PyObject *
-PyBuffer_FromReadWriteObject(base, offset, size)
- PyObject *base;
- int offset;
- int size;
+PyBuffer_FromReadWriteObject(PyObject *base, int offset, int size)
{
PyBufferProcs *pb = base->ob_type->tp_as_buffer;
@@ -141,24 +127,19 @@ PyBuffer_FromReadWriteObject(base, offset, size)
}
PyObject *
-PyBuffer_FromMemory(ptr, size)
- void *ptr;
- int size;
+PyBuffer_FromMemory(void *ptr, int size)
{
return _PyBuffer_FromMemory(NULL, ptr, size, 1);
}
PyObject *
-PyBuffer_FromReadWriteMemory(ptr, size)
- void *ptr;
- int size;
+PyBuffer_FromReadWriteMemory(void *ptr, int size)
{
return _PyBuffer_FromMemory(NULL, ptr, size, 0);
}
PyObject *
-PyBuffer_New(size)
- int size;
+PyBuffer_New(int size)
{
PyBufferObject * b;
@@ -187,17 +168,14 @@ PyBuffer_New(size)
/* Methods */
static void
-buffer_dealloc(self)
- PyBufferObject *self;
+buffer_dealloc(PyBufferObject *self)
{
Py_XDECREF(self->b_base);
PyObject_DEL(self);
}
static int
-buffer_compare(self, other)
- PyBufferObject *self;
- PyBufferObject *other;
+buffer_compare(PyBufferObject *self, PyBufferObject *other)
{
int len_self = self->b_size;
int len_other = other->b_size;
@@ -212,8 +190,7 @@ buffer_compare(self, other)
}
static PyObject *
-buffer_repr(self)
- PyBufferObject *self;
+buffer_repr(PyBufferObject *self)
{
char buf[300];
char *status = self->b_readonly ? "read-only" : "read-write";
@@ -240,8 +217,7 @@ buffer_repr(self)
}
static long
-buffer_hash(self)
- PyBufferObject *self;
+buffer_hash(PyBufferObject *self)
{
register int len;
register unsigned char *p;
@@ -274,8 +250,7 @@ buffer_hash(self)
}
static PyObject *
-buffer_str(self)
- PyBufferObject *self;
+buffer_str(PyBufferObject *self)
{
return PyString_FromStringAndSize(self->b_ptr, self->b_size);
}
@@ -283,16 +258,13 @@ buffer_str(self)
/* Sequence methods */
static int
-buffer_length(self)
- PyBufferObject *self;
+buffer_length(PyBufferObject *self)
{
return self->b_size;
}
static PyObject *
-buffer_concat(self, other)
- PyBufferObject *self;
- PyObject *other;
+buffer_concat(PyBufferObject *self, PyObject *other)
{
PyBufferProcs *pb = other->ob_type->tp_as_buffer;
char *p1;
@@ -344,9 +316,7 @@ buffer_concat(self, other)
}
static PyObject *
-buffer_repeat(self, count)
- PyBufferObject *self;
- int count;
+buffer_repeat(PyBufferObject *self, int count)
{
PyObject *ob;
register char *p;
@@ -373,9 +343,7 @@ buffer_repeat(self, count)
}
static PyObject *
-buffer_item(self, idx)
- PyBufferObject *self;
- int idx;
+buffer_item(PyBufferObject *self, int idx)
{
if ( idx < 0 || idx >= self->b_size )
{
@@ -386,10 +354,7 @@ buffer_item(self, idx)
}
static PyObject *
-buffer_slice(self, left, right)
- PyBufferObject *self;
- int left;
- int right;
+buffer_slice(PyBufferObject *self, int left, int right)
{
if ( left < 0 )
left = 0;
@@ -410,10 +375,7 @@ buffer_slice(self, left, right)
}
static int
-buffer_ass_item(self, idx, other)
- PyBufferObject *self;
- int idx;
- PyObject *other;
+buffer_ass_item(PyBufferObject *self, int idx, PyObject *other)
{
PyBufferProcs *pb;
void *p;
@@ -460,11 +422,7 @@ buffer_ass_item(self, idx, other)
}
static int
-buffer_ass_slice(self, left, right, other)
- PyBufferObject *self;
- int left;
- int right;
- PyObject *other;
+buffer_ass_slice(PyBufferObject *self, int left, int right, PyObject *other)
{
PyBufferProcs *pb;
void *p;
@@ -521,10 +479,7 @@ buffer_ass_slice(self, left, right, other)
/* Buffer methods */
static int
-buffer_getreadbuf(self, idx, pp)
- PyBufferObject *self;
- int idx;
- void ** pp;
+buffer_getreadbuf(PyBufferObject *self, int idx, void **pp)
{
if ( idx != 0 ) {
PyErr_SetString(PyExc_SystemError,
@@ -536,10 +491,7 @@ buffer_getreadbuf(self, idx, pp)
}
static int
-buffer_getwritebuf(self, idx, pp)
- PyBufferObject *self;
- int idx;
- void ** pp;
+buffer_getwritebuf(PyBufferObject *self, int idx, void **pp)
{
if ( self->b_readonly )
{
@@ -550,9 +502,7 @@ buffer_getwritebuf(self, idx, pp)
}
static int
-buffer_getsegcount(self, lenp)
- PyBufferObject *self;
- int *lenp;
+buffer_getsegcount(PyBufferObject *self, int *lenp)
{
if ( lenp )
*lenp = self->b_size;
@@ -560,10 +510,7 @@ buffer_getsegcount(self, lenp)
}
static int
-buffer_getcharbuf(self, idx, pp)
- PyBufferObject *self;
- int idx;
- const char ** pp;
+buffer_getcharbuf(PyBufferObject *self, int idx, const char **pp)
{
if ( idx != 0 ) {
PyErr_SetString(PyExc_SystemError,
@@ -616,4 +563,3 @@ PyTypeObject PyBuffer_Type = {
Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
};
-
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 3192ddd..3643ce9 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -21,11 +21,10 @@ static PyObject *instance_getattr2(PyInstanceObject *, PyObject *);
static PyObject *getattrstr, *setattrstr, *delattrstr;
+
PyObject *
-PyClass_New(bases, dict, name)
- PyObject *bases; /* NULL or tuple of classobjects! */
- PyObject *dict;
- PyObject *name;
+PyClass_New(PyObject *bases, PyObject *dict, PyObject *name)
+ /* bases is NULL or tuple of classobjects! */
{
PyClassObject *op, *dummy;
static PyObject *docstr, *modstr, *namestr;
@@ -118,8 +117,7 @@ PyClass_New(bases, dict, name)
/* Class methods */
static void
-class_dealloc(op)
- PyClassObject *op;
+class_dealloc(PyClassObject *op)
{
PyObject_GC_Fini(op);
Py_DECREF(op->cl_bases);
@@ -133,10 +131,7 @@ class_dealloc(op)
}
static PyObject *
-class_lookup(cp, name, pclass)
- PyClassObject *cp;
- PyObject *name;
- PyClassObject **pclass;
+class_lookup(PyClassObject *cp, PyObject *name, PyClassObject **pclass)
{
int i, n;
PyObject *value = PyDict_GetItem(cp->cl_dict, name);
@@ -157,9 +152,7 @@ class_lookup(cp, name, pclass)
}
static PyObject *
-class_getattr(op, name)
- register PyClassObject *op;
- PyObject *name;
+class_getattr(register PyClassObject *op, PyObject *name)
{
register PyObject *v;
register char *sname = PyString_AsString(name);
@@ -203,9 +196,7 @@ class_getattr(op, name)
}
static void
-set_slot(slot, v)
- PyObject **slot;
- PyObject *v;
+set_slot(PyObject **slot, PyObject *v)
{
PyObject *temp = *slot;
Py_XINCREF(v);
@@ -214,8 +205,7 @@ set_slot(slot, v)
}
static void
-set_attr_slots(c)
- PyClassObject *c;
+set_attr_slots(PyClassObject *c)
{
PyClassObject *dummy;
@@ -225,9 +215,7 @@ set_attr_slots(c)
}
static char *
-set_dict(c, v)
- PyClassObject *c;
- PyObject *v;
+set_dict(PyClassObject *c, PyObject *v)
{
if (v == NULL || !PyDict_Check(v))
return "__dict__ must be a dictionary object";
@@ -237,9 +225,7 @@ set_dict(c, v)
}
static char *
-set_bases(c, v)
- PyClassObject *c;
- PyObject *v;
+set_bases(PyClassObject *c, PyObject *v)
{
int i, n;
@@ -259,9 +245,7 @@ set_bases(c, v)
}
static char *
-set_name(c, v)
- PyClassObject *c;
- PyObject *v;
+set_name(PyClassObject *c, PyObject *v)
{
if (v == NULL || !PyString_Check(v))
return "__name__ must be a string object";
@@ -272,10 +256,7 @@ set_name(c, v)
}
static int
-class_setattr(op, name, v)
- PyClassObject *op;
- PyObject *name;
- PyObject *v;
+class_setattr(PyClassObject *op, PyObject *name, PyObject *v)
{
char *sname;
if (PyEval_GetRestricted()) {
@@ -322,8 +303,7 @@ class_setattr(op, name, v)
}
static PyObject *
-class_repr(op)
- PyClassObject *op;
+class_repr(PyClassObject *op)
{
PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__");
char buf[140];
@@ -342,8 +322,7 @@ class_repr(op)
}
static PyObject *
-class_str(op)
- PyClassObject *op;
+class_str(PyClassObject *op)
{
PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__");
PyObject *name = op->cl_name;
@@ -433,9 +412,7 @@ PyTypeObject PyClass_Type = {
};
int
-PyClass_IsSubclass(class, base)
- PyObject *class;
- PyObject *base;
+PyClass_IsSubclass(PyObject *class, PyObject *base)
{
int i, n;
PyClassObject *cp;
@@ -456,10 +433,7 @@ PyClass_IsSubclass(class, base)
/* Instance objects */
PyObject *
-PyInstance_New(class, arg, kw)
- PyObject *class;
- PyObject *arg;
- PyObject *kw;
+PyInstance_New(PyObject *class, PyObject *arg, PyObject *kw)
{
register PyInstanceObject *inst;
PyObject *init;
@@ -517,8 +491,7 @@ PyInstance_New(class, arg, kw)
/* Instance methods */
static void
-instance_dealloc(inst)
- register PyInstanceObject *inst;
+instance_dealloc(register PyInstanceObject *inst)
{
PyObject *error_type, *error_value, *error_traceback;
PyObject *del;
@@ -597,9 +570,7 @@ instance_dealloc(inst)
}
static PyObject *
-instance_getattr1(inst, name)
- register PyInstanceObject *inst;
- PyObject *name;
+instance_getattr1(register PyInstanceObject *inst, PyObject *name)
{
register PyObject *v;
register char *sname = PyString_AsString(name);
@@ -627,9 +598,7 @@ instance_getattr1(inst, name)
}
static PyObject *
-instance_getattr2(inst, name)
- register PyInstanceObject *inst;
- PyObject *name;
+instance_getattr2(register PyInstanceObject *inst, PyObject *name)
{
register PyObject *v;
PyClassObject *class;
@@ -664,9 +633,7 @@ instance_getattr2(inst, name)
}
static PyObject *
-instance_getattr(inst, name)
- register PyInstanceObject *inst;
- PyObject *name;
+instance_getattr(register PyInstanceObject *inst, PyObject *name)
{
register PyObject *func, *res;
res = instance_getattr1(inst, name);
@@ -683,10 +650,7 @@ instance_getattr(inst, name)
}
static int
-instance_setattr1(inst, name, v)
- PyInstanceObject *inst;
- PyObject *name;
- PyObject *v;
+instance_setattr1(PyInstanceObject *inst, PyObject *name, PyObject *v)
{
if (v == NULL) {
int rv = PyDict_DelItem(inst->in_dict, name);
@@ -700,10 +664,7 @@ instance_setattr1(inst, name, v)
}
static int
-instance_setattr(inst, name, v)
- PyInstanceObject *inst;
- PyObject *name;
- PyObject *v;
+instance_setattr(PyInstanceObject *inst, PyObject *name, PyObject *v)
{
PyObject *func, *args, *res, *tmp;
char *sname = PyString_AsString(name);
@@ -767,8 +728,7 @@ instance_setattr(inst, name, v)
}
static PyObject *
-instance_repr(inst)
- PyInstanceObject *inst;
+instance_repr(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
@@ -803,16 +763,14 @@ instance_repr(inst)
}
static PyObject *
-instance_compare1(inst, other)
- PyObject *inst, *other;
+instance_compare1(PyObject *inst, PyObject *other)
{
return PyInstance_DoBinOp(inst, other, "__cmp__", "__rcmp__",
instance_compare1);
}
static int
-instance_compare(inst, other)
- PyObject *inst, *other;
+instance_compare(PyObject *inst, PyObject *other)
{
PyObject *result;
long outcome;
@@ -835,8 +793,7 @@ instance_compare(inst, other)
}
static long
-instance_hash(inst)
- PyInstanceObject *inst;
+instance_hash(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
@@ -898,8 +855,7 @@ instance_traverse(PyInstanceObject *o, visitproc visit, void *arg)
static PyObject *getitemstr, *setitemstr, *delitemstr, *lenstr;
static int
-instance_length(inst)
- PyInstanceObject *inst;
+instance_length(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
@@ -930,9 +886,7 @@ instance_length(inst)
}
static PyObject *
-instance_subscript(inst, key)
- PyInstanceObject *inst;
- PyObject *key;
+instance_subscript(PyInstanceObject *inst, PyObject *key)
{
PyObject *func;
PyObject *arg;
@@ -955,10 +909,7 @@ instance_subscript(inst, key)
}
static int
-instance_ass_subscript(inst, key, value)
- PyInstanceObject*inst;
- PyObject *key;
- PyObject *value;
+instance_ass_subscript(PyInstanceObject *inst, PyObject *key, PyObject *value)
{
PyObject *func;
PyObject *arg;
@@ -1000,9 +951,7 @@ static PyMappingMethods instance_as_mapping = {
};
static PyObject *
-instance_item(inst, i)
- PyInstanceObject *inst;
- int i;
+instance_item(PyInstanceObject *inst, int i)
{
PyObject *func, *arg, *res;
@@ -1023,9 +972,7 @@ instance_item(inst, i)
}
static PyObject *
-instance_slice(inst, i, j)
- PyInstanceObject *inst;
- int i, j;
+instance_slice(PyInstanceObject *inst, int i, int j)
{
PyObject *func, *arg, *res;
static PyObject *getslicestr;
@@ -1047,10 +994,7 @@ instance_slice(inst, i, j)
}
static int
-instance_ass_item(inst, i, item)
- PyInstanceObject *inst;
- int i;
- PyObject *item;
+instance_ass_item(PyInstanceObject *inst, int i, PyObject *item)
{
PyObject *func, *arg, *res;
@@ -1084,10 +1028,7 @@ instance_ass_item(inst, i, item)
}
static int
-instance_ass_slice(inst, i, j, value)
- PyInstanceObject *inst;
- int i, j;
- PyObject *value;
+instance_ass_slice(PyInstanceObject *inst, int i, int j, PyObject *value)
{
PyObject *func, *arg, *res;
static PyObject *setslicestr, *delslicestr;
@@ -1176,7 +1117,8 @@ static int instance_contains(PyInstanceObject *inst, PyObject *member)
return ret;
}
-static PySequenceMethods instance_as_sequence = {
+static PySequenceMethods
+instance_as_sequence = {
(inquiry)instance_length, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -1188,9 +1130,7 @@ static PySequenceMethods instance_as_sequence = {
};
static PyObject *
-generic_unary_op(self, methodname)
- PyInstanceObject *self;
- PyObject *methodname;
+generic_unary_op(PyInstanceObject *self, PyObject *methodname)
{
PyObject *func, *res;
@@ -1203,19 +1143,16 @@ generic_unary_op(self, methodname)
/* Forward */
-static int halfbinop(PyObject *, PyObject *, char *, PyObject **,
- PyObject * (*)(PyObject *, PyObject *), int);
+static int
+halfbinop(PyObject *, PyObject *, char *, PyObject **,
+ PyObject * (*)(PyObject *, PyObject *), int);
/* Implement a binary operator involving at least one class instance. */
PyObject *
-PyInstance_DoBinOp(v, w, opname, ropname, thisfunc)
- PyObject *v;
- PyObject *w;
- char *opname;
- char *ropname;
- PyObject * (*thisfunc)(PyObject *, PyObject *);
+PyInstance_DoBinOp(PyObject *v, PyObject *w, char *opname, char *ropname,
+ PyObject * (*thisfunc)(PyObject *, PyObject *))
{
char buf[256];
PyObject *result = NULL;
@@ -1244,13 +1181,8 @@ PyInstance_DoBinOp(v, w, opname, ropname, thisfunc)
static PyObject *coerce_obj;
static int
-halfbinop(v, w, opname, r_result, thisfunc, swapped)
- PyObject *v;
- PyObject *w;
- char *opname;
- PyObject **r_result;
- PyObject * (*thisfunc)(PyObject *, PyObject *);
- int swapped;
+halfbinop(PyObject *v, PyObject *w, char *opname, PyObject **r_result,
+ PyObject * (*thisfunc)(PyObject *, PyObject *), int swapped)
{
PyObject *func;
PyObject *args;
@@ -1326,9 +1258,7 @@ halfbinop(v, w, opname, r_result, thisfunc, swapped)
}
static int
-instance_coerce(pv, pw)
- PyObject **pv;
- PyObject **pw;
+instance_coerce(PyObject **pv, PyObject **pw)
{
PyObject *v = *pv;
PyObject *w = *pw;
@@ -1395,8 +1325,7 @@ UNARY(instance_pos, "__pos__")
UNARY(instance_abs, "__abs__")
static int
-instance_nonzero(self)
- PyInstanceObject *self;
+instance_nonzero(PyInstanceObject *self)
{
PyObject *func, *res;
long outcome;
@@ -1444,10 +1373,7 @@ UNARY(instance_hex, "__hex__")
/* This version is for ternary calls only (z != None) */
static PyObject *
-instance_pow(v, w, z)
- PyObject *v;
- PyObject *w;
- PyObject *z;
+instance_pow(PyObject *v, PyObject *w, PyObject *z)
{
/* XXX Doesn't do coercions... */
PyObject *func;
@@ -1533,10 +1459,7 @@ PyTypeObject PyInstance_Type = {
static PyMethodObject *free_list;
PyObject *
-PyMethod_New(func, self, class)
- PyObject *func;
- PyObject *self;
- PyObject *class;
+PyMethod_New(PyObject *func, PyObject *self, PyObject *class)
{
register PyMethodObject *im;
if (!PyCallable_Check(func)) {
@@ -1564,8 +1487,7 @@ PyMethod_New(func, self, class)
}
PyObject *
-PyMethod_Function(im)
- register PyObject *im;
+PyMethod_Function(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
@@ -1575,8 +1497,7 @@ PyMethod_Function(im)
}
PyObject *
-PyMethod_Self(im)
- register PyObject *im;
+PyMethod_Self(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
@@ -1586,8 +1507,7 @@ PyMethod_Self(im)
}
PyObject *
-PyMethod_Class(im)
- register PyObject *im;
+PyMethod_Class(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
@@ -1611,9 +1531,7 @@ static struct memberlist instancemethod_memberlist[] = {
};
static PyObject *
-instancemethod_getattr(im, name)
- register PyMethodObject *im;
- PyObject *name;
+instancemethod_getattr(register PyMethodObject *im, PyObject *name)
{
char *sname = PyString_AsString(name);
if (sname[0] == '_') {
@@ -1632,8 +1550,7 @@ instancemethod_getattr(im, name)
}
static void
-instancemethod_dealloc(im)
- register PyMethodObject *im;
+instancemethod_dealloc(register PyMethodObject *im)
{
PyObject_GC_Fini(im);
Py_DECREF(im->im_func);
@@ -1644,8 +1561,7 @@ instancemethod_dealloc(im)
}
static int
-instancemethod_compare(a, b)
- PyMethodObject *a, *b;
+instancemethod_compare(PyMethodObject *a, PyMethodObject *b)
{
if (a->im_self != b->im_self)
return (a->im_self < b->im_self) ? -1 : 1;
@@ -1653,8 +1569,7 @@ instancemethod_compare(a, b)
}
static PyObject *
-instancemethod_repr(a)
- PyMethodObject *a;
+instancemethod_repr(PyMethodObject *a)
{
char buf[240];
PyInstanceObject *self = (PyInstanceObject *)(a->im_self);
@@ -1696,8 +1611,7 @@ instancemethod_repr(a)
}
static long
-instancemethod_hash(a)
- PyMethodObject *a;
+instancemethod_hash(PyMethodObject *a)
{
long x, y;
if (a->im_self == NULL)
@@ -1763,7 +1677,7 @@ PyTypeObject PyMethod_Type = {
/* Clear out the free list */
void
-PyMethod_Fini()
+PyMethod_Fini(void)
{
while (free_list) {
PyMethodObject *im = free_list;