/* 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,
/* 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;
}
PyObject *
-PyObject_Type(o)
- PyObject *o;
+PyObject_Type(PyObject *o)
{
PyObject *v;
}
int
-PyObject_Length(o)
- PyObject *o;
+PyObject_Length(PyObject *o)
{
PySequenceMethods *m;
}
PyObject *
-PyObject_GetItem(o, key)
- PyObject *o;
- PyObject *key;
+PyObject_GetItem(PyObject *o, PyObject *key)
{
PyMappingMethods *m;
}
int
-PyObject_SetItem(o, key, value)
- PyObject *o;
- PyObject *key;
- PyObject *value;
+PyObject_SetItem(PyObject *o, PyObject *key, PyObject *value)
{
PyMappingMethods *m;
}
int
-PyObject_DelItem(o, key)
- PyObject *o;
- PyObject *key;
+PyObject_DelItem(PyObject *o, PyObject *key)
{
PyMappingMethods *m;
/* Operations on numbers */
int
-PyNumber_Check(o)
- PyObject *o;
+PyNumber_Check(PyObject *o)
{
return o && o->ob_type->tp_as_number;
}
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();
}
PyObject *
-PyNumber_Xor(v, w)
- PyObject *v, *w;
+PyNumber_Xor(PyObject *v, PyObject *w)
{
extern int PyNumber_Coerce();
}
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) {
}
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) {
}
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) {
}
PyObject *
-PyNumber_Add(v, w)
- PyObject *v, *w;
+PyNumber_Add(PyObject *v, PyObject *w)
{
PySequenceMethods *m;
}
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) {
}
PyObject *
-PyNumber_Multiply(v, w)
- PyObject *v, *w;
+PyNumber_Multiply(PyObject *v, PyObject *w)
{
PyTypeObject *tp = v->ob_type;
PySequenceMethods *m;
}
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) {
}
PyObject *
-PyNumber_Remainder(v, w)
- PyObject *v, *w;
+PyNumber_Remainder(PyObject *v, PyObject *w)
{
if (PyString_Check(v))
return PyString_Format(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) {
/* 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 *);
}
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;
/* Unary operators and functions */
PyObject *
-PyNumber_Negative(o)
- PyObject *o;
+PyNumber_Negative(PyObject *o)
{
PyNumberMethods *m;
}
PyObject *
-PyNumber_Positive(o)
- PyObject *o;
+PyNumber_Positive(PyObject *o)
{
PyNumberMethods *m;
}
PyObject *
-PyNumber_Invert(o)
- PyObject *o;
+PyNumber_Invert(PyObject *o)
{
PyNumberMethods *m;
}
PyObject *
-PyNumber_Absolute(o)
- PyObject *o;
+PyNumber_Absolute(PyObject *o)
{
PyNumberMethods *m;
/* 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;
}
PyObject *
-PyNumber_Int(o)
- PyObject *o;
+PyNumber_Int(PyObject *o)
{
PyNumberMethods *m;
const char *buffer;
/* 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;
}
PyObject *
-PyNumber_Long(o)
- PyObject *o;
+PyNumber_Long(PyObject *o)
{
PyNumberMethods *m;
const char *buffer;
}
PyObject *
-PyNumber_Float(o)
- PyObject *o;
+PyNumber_Float(PyObject *o)
{
PyNumberMethods *m;
/* 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;
}
PyObject *
-PySequence_Concat(s, o)
- PyObject *s;
- PyObject *o;
+PySequence_Concat(PyObject *s, PyObject *o)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_Repeat(o, count)
- PyObject *o;
- int count;
+PySequence_Repeat(PyObject *o, int count)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_GetItem(s, i)
- PyObject *s;
- int i;
+PySequence_GetItem(PyObject *s, int i)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_GetSlice(s, i1, i2)
- PyObject *s;
- int i1;
- int i2;
+PySequence_GetSlice(PyObject *s, int i1, int i2)
{
PySequenceMethods *m;
}
int
-PySequence_SetItem(s, i, o)
- PyObject *s;
- int i;
- PyObject *o;
+PySequence_SetItem(PyObject *s, int i, PyObject *o)
{
PySequenceMethods *m;
}
int
-PySequence_DelItem(s, i)
- PyObject *s;
- int i;
+PySequence_DelItem(PyObject *s, int i)
{
PySequenceMethods *m;
}
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;
}
int
-PySequence_DelSlice(s, i1, i2)
- PyObject *s;
- int i1;
- int i2;
+PySequence_DelSlice(PyObject *s, int i1, int i2)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_Tuple(v)
- PyObject *v;
+PySequence_Tuple(PyObject *v)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_List(v)
- PyObject *v;
+PySequence_List(PyObject *v)
{
PySequenceMethods *m;
}
PyObject *
-PySequence_Fast(v, m)
- PyObject *v;
- const char* m;
+PySequence_Fast(PyObject *v, const char *m)
{
if (v == NULL)
return null_error();
}
int
-PySequence_Count(s, o)
- PyObject *s;
- PyObject *o;
+PySequence_Count(PyObject *s, PyObject *o)
{
int l, i, n, cmp, err;
PyObject *item;
}
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;
/* 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;
/* 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;
}
PyObject *
-PyMapping_GetItemString(o, key)
- PyObject *o;
- char *key;
+PyMapping_GetItemString(PyObject *o, char *key)
{
PyObject *okey, *r;
}
int
-PyMapping_SetItemString(o, key, value)
- PyObject *o;
- char *key;
- PyObject *value;
+PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
{
PyObject *okey;
int r;
}
int
-PyMapping_HasKeyString(o, key)
- PyObject *o;
- char *key;
+PyMapping_HasKeyString(PyObject *o, char *key)
{
PyObject *v;
}
int
-PyMapping_HasKey(o, key)
- PyObject *o;
- PyObject *key;
+PyMapping_HasKey(PyObject *o, PyObject *key)
{
PyObject *v;
/* 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;
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;
}
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;
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;
}
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;
}
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;
/* 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;
}
static PyObject *
-buffer_repr(self)
- PyBufferObject *self;
+buffer_repr(PyBufferObject *self)
{
char buf[300];
char *status = self->b_readonly ? "read-only" : "read-write";
}
static long
-buffer_hash(self)
- PyBufferObject *self;
+buffer_hash(PyBufferObject *self)
{
register int len;
register unsigned char *p;
}
static PyObject *
-buffer_str(self)
- PyBufferObject *self;
+buffer_str(PyBufferObject *self)
{
return PyString_FromStringAndSize(self->b_ptr, self->b_size);
}
/* 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;
}
static PyObject *
-buffer_repeat(self, count)
- PyBufferObject *self;
- int count;
+buffer_repeat(PyBufferObject *self, int count)
{
PyObject *ob;
register char *p;
}
static PyObject *
-buffer_item(self, idx)
- PyBufferObject *self;
- int idx;
+buffer_item(PyBufferObject *self, int idx)
{
if ( idx < 0 || idx >= self->b_size )
{
}
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;
}
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;
}
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;
/* 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,
}
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 )
{
}
static int
-buffer_getsegcount(self, lenp)
- PyBufferObject *self;
- int *lenp;
+buffer_getsegcount(PyBufferObject *self, int *lenp)
{
if ( lenp )
*lenp = self->b_size;
}
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,
Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
};
-
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;
/* Class methods */
static void
-class_dealloc(op)
- PyClassObject *op;
+class_dealloc(PyClassObject *op)
{
PyObject_GC_Fini(op);
Py_DECREF(op->cl_bases);
}
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);
}
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);
}
static void
-set_slot(slot, v)
- PyObject **slot;
- PyObject *v;
+set_slot(PyObject **slot, PyObject *v)
{
PyObject *temp = *slot;
Py_XINCREF(v);
}
static void
-set_attr_slots(c)
- PyClassObject *c;
+set_attr_slots(PyClassObject *c)
{
PyClassObject *dummy;
}
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";
}
static char *
-set_bases(c, v)
- PyClassObject *c;
- PyObject *v;
+set_bases(PyClassObject *c, PyObject *v)
{
int i, n;
}
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";
}
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()) {
}
static PyObject *
-class_repr(op)
- PyClassObject *op;
+class_repr(PyClassObject *op)
{
PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__");
char buf[140];
}
static PyObject *
-class_str(op)
- PyClassObject *op;
+class_str(PyClassObject *op)
{
PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__");
PyObject *name = op->cl_name;
};
int
-PyClass_IsSubclass(class, base)
- PyObject *class;
- PyObject *base;
+PyClass_IsSubclass(PyObject *class, PyObject *base)
{
int i, n;
PyClassObject *cp;
/* 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;
/* Instance methods */
static void
-instance_dealloc(inst)
- register PyInstanceObject *inst;
+instance_dealloc(register PyInstanceObject *inst)
{
PyObject *error_type, *error_value, *error_traceback;
PyObject *del;
}
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);
}
static PyObject *
-instance_getattr2(inst, name)
- register PyInstanceObject *inst;
- PyObject *name;
+instance_getattr2(register PyInstanceObject *inst, PyObject *name)
{
register PyObject *v;
PyClassObject *class;
}
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);
}
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);
}
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);
}
static PyObject *
-instance_repr(inst)
- PyInstanceObject *inst;
+instance_repr(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
}
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;
}
static long
-instance_hash(inst)
- PyInstanceObject *inst;
+instance_hash(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
static PyObject *getitemstr, *setitemstr, *delitemstr, *lenstr;
static int
-instance_length(inst)
- PyInstanceObject *inst;
+instance_length(PyInstanceObject *inst)
{
PyObject *func;
PyObject *res;
}
static PyObject *
-instance_subscript(inst, key)
- PyInstanceObject *inst;
- PyObject *key;
+instance_subscript(PyInstanceObject *inst, PyObject *key)
{
PyObject *func;
PyObject *arg;
}
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;
};
static PyObject *
-instance_item(inst, i)
- PyInstanceObject *inst;
- int i;
+instance_item(PyInstanceObject *inst, int i)
{
PyObject *func, *arg, *res;
}
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;
}
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;
}
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;
return ret;
}
-static PySequenceMethods instance_as_sequence = {
+static PySequenceMethods
+instance_as_sequence = {
(inquiry)instance_length, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
};
static PyObject *
-generic_unary_op(self, methodname)
- PyInstanceObject *self;
- PyObject *methodname;
+generic_unary_op(PyInstanceObject *self, PyObject *methodname)
{
PyObject *func, *res;
/* 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;
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;
}
static int
-instance_coerce(pv, pw)
- PyObject **pv;
- PyObject **pw;
+instance_coerce(PyObject **pv, PyObject **pw)
{
PyObject *v = *pv;
PyObject *w = *pw;
UNARY(instance_abs, "__abs__")
static int
-instance_nonzero(self)
- PyInstanceObject *self;
+instance_nonzero(PyInstanceObject *self)
{
PyObject *func, *res;
long outcome;
/* 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;
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)) {
}
PyObject *
-PyMethod_Function(im)
- register PyObject *im;
+PyMethod_Function(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
}
PyObject *
-PyMethod_Self(im)
- register PyObject *im;
+PyMethod_Self(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
}
PyObject *
-PyMethod_Class(im)
- register PyObject *im;
+PyMethod_Class(register PyObject *im)
{
if (!PyMethod_Check(im)) {
PyErr_BadInternalCall();
};
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] == '_') {
}
static void
-instancemethod_dealloc(im)
- register PyMethodObject *im;
+instancemethod_dealloc(register PyMethodObject *im)
{
PyObject_GC_Fini(im);
Py_DECREF(im->im_func);
}
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;
}
static PyObject *
-instancemethod_repr(a)
- PyMethodObject *a;
+instancemethod_repr(PyMethodObject *a)
{
char buf[240];
PyInstanceObject *self = (PyInstanceObject *)(a->im_self);
}
static long
-instancemethod_hash(a)
- PyMethodObject *a;
+instancemethod_hash(PyMethodObject *a)
{
long x, y;
if (a->im_self == NULL)
/* Clear out the free list */
void
-PyMethod_Fini()
+PyMethod_Fini(void)
{
while (free_list) {
PyMethodObject *im = free_list;