#endif
long
-PyInt_GetMax()
+PyInt_GetMax(void)
{
return LONG_MAX; /* To initialize sys.maxint */
}
};
static PyObject *
-err_ovf(msg)
- char *msg;
+err_ovf(char *msg)
{
PyErr_SetString(PyExc_OverflowError, msg);
return NULL;
static PyIntObject *free_list = NULL;
static PyIntObject *
-fill_free_list()
+fill_free_list(void)
{
PyIntObject *p, *q;
/* XXX Int blocks escape the object heap. Use PyObject_MALLOC ??? */
#endif
PyObject *
-PyInt_FromLong(ival)
- long ival;
+PyInt_FromLong(long ival)
{
register PyIntObject *v;
#if NSMALLNEGINTS + NSMALLPOSINTS > 0
}
static void
-int_dealloc(v)
- PyIntObject *v;
+int_dealloc(PyIntObject *v)
{
v->ob_type = (struct _typeobject *)free_list;
free_list = v;
}
long
-PyInt_AsLong(op)
- register PyObject *op;
+PyInt_AsLong(register PyObject *op)
{
PyNumberMethods *nb;
PyIntObject *io;
}
PyObject *
-PyInt_FromString(s, pend, base)
- char *s;
- char **pend;
- int base;
+PyInt_FromString(char *s, char **pend, int base)
{
char *end;
long x;
}
PyObject *
-PyInt_FromUnicode(s, length, base)
- Py_UNICODE *s;
- int length;
- int base;
+PyInt_FromUnicode(Py_UNICODE *s, int length, int base)
{
char buffer[256];
/* ARGSUSED */
static int
-int_print(v, fp, flags)
- PyIntObject *v;
- FILE *fp;
- int flags; /* Not used but required by interface */
+int_print(PyIntObject *v, FILE *fp, int flags)
+ /* flags -- not used but required by interface */
{
fprintf(fp, "%ld", v->ob_ival);
return 0;
}
static PyObject *
-int_repr(v)
- PyIntObject *v;
+int_repr(PyIntObject *v)
{
char buf[20];
sprintf(buf, "%ld", v->ob_ival);
}
static int
-int_compare(v, w)
- PyIntObject *v, *w;
+int_compare(PyIntObject *v, PyIntObject *w)
{
register long i = v->ob_ival;
register long j = w->ob_ival;
}
static long
-int_hash(v)
- PyIntObject *v;
+int_hash(PyIntObject *v)
{
/* XXX If this is changed, you also need to change the way
Python's long, float and complex types are hashed. */
}
static PyObject *
-int_add(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_add(PyIntObject *v, PyIntObject *w)
{
register long a, b, x;
a = v->ob_ival;
}
static PyObject *
-int_sub(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_sub(PyIntObject *v, PyIntObject *w)
{
register long a, b, x;
a = v->ob_ival;
*/
static PyObject *
-int_mul(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_mul(PyIntObject *v, PyIntObject *w)
{
long a, b, ah, bh, x, y;
int s = 1;
}
static int
-i_divmod(x, y, p_xdivy, p_xmody)
- register PyIntObject *x, *y;
- long *p_xdivy, *p_xmody;
+i_divmod(register PyIntObject *x, register PyIntObject *y,
+ long *p_xdivy, long *p_xmody)
{
long xi = x->ob_ival;
long yi = y->ob_ival;
}
static PyObject *
-int_div(x, y)
- PyIntObject *x;
- PyIntObject *y;
+int_div(PyIntObject *x, PyIntObject *y)
{
long d, m;
if (i_divmod(x, y, &d, &m) < 0)
}
static PyObject *
-int_mod(x, y)
- PyIntObject *x;
- PyIntObject *y;
+int_mod(PyIntObject *x, PyIntObject *y)
{
long d, m;
if (i_divmod(x, y, &d, &m) < 0)
}
static PyObject *
-int_divmod(x, y)
- PyIntObject *x;
- PyIntObject *y;
+int_divmod(PyIntObject *x, PyIntObject *y)
{
long d, m;
if (i_divmod(x, y, &d, &m) < 0)
}
static PyObject *
-int_pow(v, w, z)
- PyIntObject *v;
- PyIntObject *w;
- PyIntObject *z;
+int_pow(PyIntObject *v, PyIntObject *w, PyIntObject *z)
{
#if 1
register long iv, iw, iz=0, ix, temp, prev;
}
static PyObject *
-int_neg(v)
- PyIntObject *v;
+int_neg(PyIntObject *v)
{
register long a, x;
a = v->ob_ival;
}
static PyObject *
-int_pos(v)
- PyIntObject *v;
+int_pos(PyIntObject *v)
{
Py_INCREF(v);
return (PyObject *)v;
}
static PyObject *
-int_abs(v)
- PyIntObject *v;
+int_abs(PyIntObject *v)
{
if (v->ob_ival >= 0)
return int_pos(v);
}
static int
-int_nonzero(v)
- PyIntObject *v;
+int_nonzero(PyIntObject *v)
{
return v->ob_ival != 0;
}
static PyObject *
-int_invert(v)
- PyIntObject *v;
+int_invert(PyIntObject *v)
{
return PyInt_FromLong(~v->ob_ival);
}
static PyObject *
-int_lshift(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_lshift(PyIntObject *v, PyIntObject *w)
{
register long a, b;
a = v->ob_ival;
}
static PyObject *
-int_rshift(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_rshift(PyIntObject *v, PyIntObject *w)
{
register long a, b;
a = v->ob_ival;
}
static PyObject *
-int_and(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_and(PyIntObject *v, PyIntObject *w)
{
register long a, b;
a = v->ob_ival;
}
static PyObject *
-int_xor(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_xor(PyIntObject *v, PyIntObject *w)
{
register long a, b;
a = v->ob_ival;
}
static PyObject *
-int_or(v, w)
- PyIntObject *v;
- PyIntObject *w;
+int_or(PyIntObject *v, PyIntObject *w)
{
register long a, b;
a = v->ob_ival;
}
static PyObject *
-int_int(v)
- PyIntObject *v;
+int_int(PyIntObject *v)
{
Py_INCREF(v);
return (PyObject *)v;
}
static PyObject *
-int_long(v)
- PyIntObject *v;
+int_long(PyIntObject *v)
{
return PyLong_FromLong((v -> ob_ival));
}
static PyObject *
-int_float(v)
- PyIntObject *v;
+int_float(PyIntObject *v)
{
return PyFloat_FromDouble((double)(v -> ob_ival));
}
static PyObject *
-int_oct(v)
- PyIntObject *v;
+int_oct(PyIntObject *v)
{
char buf[100];
long x = v -> ob_ival;
}
static PyObject *
-int_hex(v)
- PyIntObject *v;
+int_hex(PyIntObject *v)
{
char buf[100];
long x = v -> ob_ival;
};
void
-PyInt_Fini()
+PyInt_Fini(void)
{
PyIntObject *p;
PyIntBlock *list, *next;
((((n)+(PyTryBlock)-1)/(PyTryBlock))*(PyTryBlock))
static int
-roundupsize(n)
- int n;
+roundupsize(int n)
{
if (n < 500)
return ROUNDUP(n, 10);
#define NRESIZE(var, type, nitems) PyMem_RESIZE(var, type, roundupsize(nitems))
PyObject *
-PyList_New(size)
- int size;
+PyList_New(int size)
{
int i;
PyListObject *op;
}
int
-PyList_Size(op)
- PyObject *op;
+PyList_Size(PyObject *op)
{
if (!PyList_Check(op)) {
PyErr_BadInternalCall();
static PyObject *indexerr;
PyObject *
-PyList_GetItem(op, i)
- PyObject *op;
- int i;
+PyList_GetItem(PyObject *op, int i)
{
if (!PyList_Check(op)) {
PyErr_BadInternalCall();
}
int
-PyList_SetItem(op, i, newitem)
- register PyObject *op;
- register int i;
- register PyObject *newitem;
+PyList_SetItem(register PyObject *op, register int i,
+ register PyObject *newitem)
{
register PyObject *olditem;
register PyObject **p;
}
static int
-ins1(self, where, v)
- PyListObject *self;
- int where;
- PyObject *v;
+ins1(PyListObject *self, int where, PyObject *v)
{
int i;
PyObject **items;
}
int
-PyList_Insert(op, where, newitem)
- PyObject *op;
- int where;
- PyObject *newitem;
+PyList_Insert(PyObject *op, int where, PyObject *newitem)
{
if (!PyList_Check(op)) {
PyErr_BadInternalCall();
}
int
-PyList_Append(op, newitem)
- PyObject *op;
- PyObject *newitem;
+PyList_Append(PyObject *op, PyObject *newitem)
{
if (!PyList_Check(op)) {
PyErr_BadInternalCall();
/* Methods */
static void
-list_dealloc(op)
- PyListObject *op;
+list_dealloc(PyListObject *op)
{
int i;
Py_TRASHCAN_SAFE_BEGIN(op)
}
static int
-list_print(op, fp, flags)
- PyListObject *op;
- FILE *fp;
- int flags;
+list_print(PyListObject *op, FILE *fp, int flags)
{
int i;
}
static PyObject *
-list_repr(v)
- PyListObject *v;
+list_repr(PyListObject *v)
{
PyObject *s, *comma;
int i;
}
static int
-list_compare(v, w)
- PyListObject *v, *w;
+list_compare(PyListObject *v, PyListObject *w)
{
int i;
for (i = 0; i < v->ob_size && i < w->ob_size; i++) {
}
static int
-list_length(a)
- PyListObject *a;
+list_length(PyListObject *a)
{
return a->ob_size;
}
static int
-list_contains(a, el)
- PyListObject *a;
- PyObject *el;
+list_contains(PyListObject *a, PyObject *el)
{
int i, cmp;
static PyObject *
-list_item(a, i)
- PyListObject *a;
- int i;
+list_item(PyListObject *a, int i)
{
if (i < 0 || i >= a->ob_size) {
if (indexerr == NULL)
}
static PyObject *
-list_slice(a, ilow, ihigh)
- PyListObject *a;
- int ilow, ihigh;
+list_slice(PyListObject *a, int ilow, int ihigh)
{
PyListObject *np;
int i;
}
PyObject *
-PyList_GetSlice(a, ilow, ihigh)
- PyObject *a;
- int ilow, ihigh;
+PyList_GetSlice(PyObject *a, int ilow, int ihigh)
{
if (!PyList_Check(a)) {
PyErr_BadInternalCall();
}
static PyObject *
-list_concat(a, bb)
- PyListObject *a;
- PyObject *bb;
+list_concat(PyListObject *a, PyObject *bb)
{
int size;
int i;
}
static PyObject *
-list_repeat(a, n)
- PyListObject *a;
- int n;
+list_repeat(PyListObject *a, int n)
{
int i, j;
int size;
}
static int
-list_ass_slice(a, ilow, ihigh, v)
- PyListObject *a;
- int ilow, ihigh;
- PyObject *v;
+list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
{
/* Because [X]DECREF can recursively invoke list operations on
this list, we must postpone all [X]DECREF activity until
}
int
-PyList_SetSlice(a, ilow, ihigh, v)
- PyObject *a;
- int ilow, ihigh;
- PyObject *v;
+PyList_SetSlice(PyObject *a, int ilow, int ihigh, PyObject *v)
{
if (!PyList_Check(a)) {
PyErr_BadInternalCall();
}
static int
-list_ass_item(a, i, v)
- PyListObject *a;
- int i;
- PyObject *v;
+list_ass_item(PyListObject *a, int i, PyObject *v)
{
PyObject *old_value;
if (i < 0 || i >= a->ob_size) {
}
static PyObject *
-ins(self, where, v)
- PyListObject *self;
- int where;
- PyObject *v;
+ins(PyListObject *self, int where, PyObject *v)
{
if (ins1(self, where, v) != 0)
return NULL;
}
static PyObject *
-listinsert(self, args)
- PyListObject *self;
- PyObject *args;
+listinsert(PyListObject *self, PyObject *args)
{
int i;
PyObject *v;
static PyObject *
-listappend(self, args)
- PyListObject *self;
- PyObject *args;
+listappend(PyListObject *self, PyObject *args)
{
PyObject *v;
if (!PyArg_ParseTuple_Compat1(args, "O:append", &v))
}
static PyObject *
-listextend(self, args)
- PyListObject *self;
- PyObject *args;
+listextend(PyListObject *self, PyObject *args)
{
PyObject *b = NULL, *res = NULL;
PyObject **items;
static PyObject *
-listpop(self, args)
- PyListObject *self;
- PyObject *args;
+listpop(PyListObject *self, PyObject *args)
{
int i = -1;
PyObject *v;
supplied function is NULL. */
static int
-docompare(x, y, compare)
- PyObject *x;
- PyObject *y;
- PyObject *compare;
+docompare(PyObject *x, PyObject *y, PyObject *compare)
{
PyObject *args, *res;
int i;
*/
static int
-binarysort(lo, hi, start, compare)
- PyObject **lo;
- PyObject **hi;
- PyObject **start;
- PyObject *compare;/* Comparison function object, or NULL for default */
+binarysort(PyObject **lo, PyObject **hi, PyObject **start, PyObject *compare)
+ /* compare -- comparison function object, or NULL for default */
{
/* assert lo <= start <= hi
assert [lo, start) is sorted */
};
static int
-samplesortslice(lo, hi, compare)
- PyObject **lo;
- PyObject **hi;
- PyObject *compare;/* Comparison function object, or NULL for default */
+samplesortslice(PyObject **lo, PyObject **hi, PyObject *compare)
+ /* compare -- comparison function object, or NULL for default */
{
register PyObject **l, **r;
register PyObject *tmp, *pivot;
staticforward PyTypeObject immutable_list_type;
static PyObject *
-listsort(self, args)
- PyListObject *self;
- PyObject *args;
+listsort(PyListObject *self, PyObject *args)
{
int err;
PyObject *compare = NULL;
}
int
-PyList_Sort(v)
- PyObject *v;
+PyList_Sort(PyObject *v)
{
if (v == NULL || !PyList_Check(v)) {
PyErr_BadInternalCall();
}
static PyObject *
-listreverse(self, args)
- PyListObject *self;
- PyObject *args;
+listreverse(PyListObject *self, PyObject *args)
{
register PyObject **p, **q;
register PyObject *tmp;
}
int
-PyList_Reverse(v)
- PyObject *v;
+PyList_Reverse(PyObject *v)
{
if (v == NULL || !PyList_Check(v)) {
PyErr_BadInternalCall();
}
PyObject *
-PyList_AsTuple(v)
- PyObject *v;
+PyList_AsTuple(PyObject *v)
{
PyObject *w;
PyObject **p;
}
static PyObject *
-listindex(self, args)
- PyListObject *self;
- PyObject *args;
+listindex(PyListObject *self, PyObject *args)
{
int i;
PyObject *v;
}
static PyObject *
-listcount(self, args)
- PyListObject *self;
- PyObject *args;
+listcount(PyListObject *self, PyObject *args)
{
int count = 0;
int i;
}
static PyObject *
-listremove(self, args)
- PyListObject *self;
- PyObject *args;
+listremove(PyListObject *self, PyObject *args)
{
int i;
PyObject *v;
};
static PyObject *
-list_getattr(f, name)
- PyListObject *f;
- char *name;
+list_getattr(PyListObject *f, char *name)
{
return Py_FindMethod(list_methods, (PyObject *)f, name);
}
compare a list that's being sorted... */
static PyObject *
-immutable_list_op(/*No args!*/)
+immutable_list_op(void)
{
PyErr_SetString(PyExc_TypeError,
"a list cannot be modified while it is being sorted");
};
static PyObject *
-immutable_list_getattr(f, name)
- PyListObject *f;
- char *name;
+immutable_list_getattr(PyListObject *f, char *name)
{
return Py_FindMethod(immutable_list_methods, (PyObject *)f, name);
}
static int
-immutable_list_ass(/*No args!*/)
+immutable_list_ass(void)
{
immutable_list_op();
return -1;
0, /* tp_doc */
(traverseproc)list_traverse, /* tp_traverse */
};
-