[Python-checkins] CVS: python/dist/src/Objects intobject.c,2.46,2.47 listobject.c,2.79,2.80
Fred L. Drake
python-dev@python.org
Sun, 9 Jul 2000 08:16:53 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv14927
Modified Files:
intobject.c listobject.c
Log Message:
ANSI-fication of the sources.
Index: intobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v
retrieving revision 2.46
retrieving revision 2.47
diff -C2 -r2.46 -r2.47
*** intobject.c 2000年07月08日 04:17:21 2.46
--- intobject.c 2000年07月09日 15:16:51 2.47
***************
*** 35,39 ****
long
! PyInt_GetMax()
{
return LONG_MAX; /* To initialize sys.maxint */
--- 35,39 ----
long
! PyInt_GetMax(void)
{
return LONG_MAX; /* To initialize sys.maxint */
***************
*** 53,58 ****
static PyObject *
! err_ovf(msg)
! char *msg;
{
PyErr_SetString(PyExc_OverflowError, msg);
--- 53,57 ----
static PyObject *
! err_ovf(char *msg)
{
PyErr_SetString(PyExc_OverflowError, msg);
***************
*** 85,89 ****
static PyIntObject *
! fill_free_list()
{
PyIntObject *p, *q;
--- 84,88 ----
static PyIntObject *
! fill_free_list(void)
{
PyIntObject *p, *q;
***************
*** 121,126 ****
PyObject *
! PyInt_FromLong(ival)
! long ival;
{
register PyIntObject *v;
--- 120,124 ----
PyObject *
! PyInt_FromLong(long ival)
{
register PyIntObject *v;
***************
*** 158,163 ****
static void
! int_dealloc(v)
! PyIntObject *v;
{
v->ob_type = (struct _typeobject *)free_list;
--- 156,160 ----
static void
! int_dealloc(PyIntObject *v)
{
v->ob_type = (struct _typeobject *)free_list;
***************
*** 166,171 ****
long
! PyInt_AsLong(op)
! register PyObject *op;
{
PyNumberMethods *nb;
--- 163,167 ----
long
! PyInt_AsLong(register PyObject *op)
{
PyNumberMethods *nb;
***************
*** 198,205 ****
PyObject *
! PyInt_FromString(s, pend, base)
! char *s;
! char **pend;
! int base;
{
char *end;
--- 194,198 ----
PyObject *
! PyInt_FromString(char *s, char **pend, int base)
{
char *end;
***************
*** 240,247 ****
PyObject *
! PyInt_FromUnicode(s, length, base)
! Py_UNICODE *s;
! int length;
! int base;
{
char buffer[256];
--- 233,237 ----
PyObject *
! PyInt_FromUnicode(Py_UNICODE *s, int length, int base)
{
char buffer[256];
***************
*** 261,268 ****
/* ARGSUSED */
static int
! int_print(v, fp, flags)
! PyIntObject *v;
! FILE *fp;
! int flags; /* Not used but required by interface */
{
fprintf(fp, "%ld", v->ob_ival);
--- 251,256 ----
/* ARGSUSED */
static int
! int_print(PyIntObject *v, FILE *fp, int flags)
! /* flags -- not used but required by interface */
{
fprintf(fp, "%ld", v->ob_ival);
***************
*** 271,276 ****
static PyObject *
! int_repr(v)
! PyIntObject *v;
{
char buf[20];
--- 259,263 ----
static PyObject *
! int_repr(PyIntObject *v)
{
char buf[20];
***************
*** 280,285 ****
static int
! int_compare(v, w)
! PyIntObject *v, *w;
{
register long i = v->ob_ival;
--- 267,271 ----
static int
! int_compare(PyIntObject *v, PyIntObject *w)
{
register long i = v->ob_ival;
***************
*** 289,294 ****
static long
! int_hash(v)
! PyIntObject *v;
{
/* XXX If this is changed, you also need to change the way
--- 275,279 ----
static long
! int_hash(PyIntObject *v)
{
/* XXX If this is changed, you also need to change the way
***************
*** 301,307 ****
static PyObject *
! int_add(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b, x;
--- 286,290 ----
static PyObject *
! int_add(PyIntObject *v, PyIntObject *w)
{
register long a, b, x;
***************
*** 315,321 ****
static PyObject *
! int_sub(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b, x;
--- 298,302 ----
static PyObject *
! int_sub(PyIntObject *v, PyIntObject *w)
{
register long a, b, x;
***************
*** 358,364 ****
static PyObject *
! int_mul(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
long a, b, ah, bh, x, y;
--- 339,343 ----
static PyObject *
! int_mul(PyIntObject *v, PyIntObject *w)
{
long a, b, ah, bh, x, y;
***************
*** 459,465 ****
static int
! i_divmod(x, y, p_xdivy, p_xmody)
! register PyIntObject *x, *y;
! long *p_xdivy, *p_xmody;
{
long xi = x->ob_ival;
--- 438,443 ----
static int
! i_divmod(register PyIntObject *x, register PyIntObject *y,
! long *p_xdivy, long *p_xmody)
{
long xi = x->ob_ival;
***************
*** 501,507 ****
static PyObject *
! int_div(x, y)
! PyIntObject *x;
! PyIntObject *y;
{
long d, m;
--- 479,483 ----
static PyObject *
! int_div(PyIntObject *x, PyIntObject *y)
{
long d, m;
***************
*** 512,518 ****
static PyObject *
! int_mod(x, y)
! PyIntObject *x;
! PyIntObject *y;
{
long d, m;
--- 488,492 ----
static PyObject *
! int_mod(PyIntObject *x, PyIntObject *y)
{
long d, m;
***************
*** 523,529 ****
static PyObject *
! int_divmod(x, y)
! PyIntObject *x;
! PyIntObject *y;
{
long d, m;
--- 497,501 ----
static PyObject *
! int_divmod(PyIntObject *x, PyIntObject *y)
{
long d, m;
***************
*** 534,541 ****
static PyObject *
! int_pow(v, w, z)
! PyIntObject *v;
! PyIntObject *w;
! PyIntObject *z;
{
#if 1
--- 506,510 ----
static PyObject *
! int_pow(PyIntObject *v, PyIntObject *w, PyIntObject *z)
{
#if 1
***************
*** 633,638 ****
static PyObject *
! int_neg(v)
! PyIntObject *v;
{
register long a, x;
--- 602,606 ----
static PyObject *
! int_neg(PyIntObject *v)
{
register long a, x;
***************
*** 645,650 ****
static PyObject *
! int_pos(v)
! PyIntObject *v;
{
Py_INCREF(v);
--- 613,617 ----
static PyObject *
! int_pos(PyIntObject *v)
{
Py_INCREF(v);
***************
*** 653,658 ****
static PyObject *
! int_abs(v)
! PyIntObject *v;
{
if (v->ob_ival >= 0)
--- 620,624 ----
static PyObject *
! int_abs(PyIntObject *v)
{
if (v->ob_ival >= 0)
***************
*** 663,668 ****
static int
! int_nonzero(v)
! PyIntObject *v;
{
return v->ob_ival != 0;
--- 629,633 ----
static int
! int_nonzero(PyIntObject *v)
{
return v->ob_ival != 0;
***************
*** 670,675 ****
static PyObject *
! int_invert(v)
! PyIntObject *v;
{
return PyInt_FromLong(~v->ob_ival);
--- 635,639 ----
static PyObject *
! int_invert(PyIntObject *v)
{
return PyInt_FromLong(~v->ob_ival);
***************
*** 677,683 ****
static PyObject *
! int_lshift(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b;
--- 641,645 ----
static PyObject *
! int_lshift(PyIntObject *v, PyIntObject *w)
{
register long a, b;
***************
*** 700,706 ****
static PyObject *
! int_rshift(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b;
--- 662,666 ----
static PyObject *
! int_rshift(PyIntObject *v, PyIntObject *w)
{
register long a, b;
***************
*** 728,734 ****
static PyObject *
! int_and(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b;
--- 688,692 ----
static PyObject *
! int_and(PyIntObject *v, PyIntObject *w)
{
register long a, b;
***************
*** 739,745 ****
static PyObject *
! int_xor(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b;
--- 697,701 ----
static PyObject *
! int_xor(PyIntObject *v, PyIntObject *w)
{
register long a, b;
***************
*** 750,756 ****
static PyObject *
! int_or(v, w)
! PyIntObject *v;
! PyIntObject *w;
{
register long a, b;
--- 706,710 ----
static PyObject *
! int_or(PyIntObject *v, PyIntObject *w)
{
register long a, b;
***************
*** 761,766 ****
static PyObject *
! int_int(v)
! PyIntObject *v;
{
Py_INCREF(v);
--- 715,719 ----
static PyObject *
! int_int(PyIntObject *v)
{
Py_INCREF(v);
***************
*** 769,774 ****
static PyObject *
! int_long(v)
! PyIntObject *v;
{
return PyLong_FromLong((v -> ob_ival));
--- 722,726 ----
static PyObject *
! int_long(PyIntObject *v)
{
return PyLong_FromLong((v -> ob_ival));
***************
*** 776,781 ****
static PyObject *
! int_float(v)
! PyIntObject *v;
{
return PyFloat_FromDouble((double)(v -> ob_ival));
--- 728,732 ----
static PyObject *
! int_float(PyIntObject *v)
{
return PyFloat_FromDouble((double)(v -> ob_ival));
***************
*** 783,788 ****
static PyObject *
! int_oct(v)
! PyIntObject *v;
{
char buf[100];
--- 734,738 ----
static PyObject *
! int_oct(PyIntObject *v)
{
char buf[100];
***************
*** 796,801 ****
static PyObject *
! int_hex(v)
! PyIntObject *v;
{
char buf[100];
--- 746,750 ----
static PyObject *
! int_hex(PyIntObject *v)
{
char buf[100];
***************
*** 850,854 ****
void
! PyInt_Fini()
{
PyIntObject *p;
--- 799,803 ----
void
! PyInt_Fini(void)
{
PyIntObject *p;
Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.79
retrieving revision 2.80
diff -C2 -r2.79 -r2.80
*** listobject.c 2000年07月01日 01:00:38 2.79
--- listobject.c 2000年07月09日 15:16:51 2.80
***************
*** 23,28 ****
static int
! roundupsize(n)
! int n;
{
if (n < 500)
--- 23,27 ----
static int
! roundupsize(int n)
{
if (n < 500)
***************
*** 35,40 ****
PyObject *
! PyList_New(size)
! int size;
{
int i;
--- 34,38 ----
PyObject *
! PyList_New(int size)
{
int i;
***************
*** 75,80 ****
int
! PyList_Size(op)
! PyObject *op;
{
if (!PyList_Check(op)) {
--- 73,77 ----
int
! PyList_Size(PyObject *op)
{
if (!PyList_Check(op)) {
***************
*** 89,95 ****
PyObject *
! PyList_GetItem(op, i)
! PyObject *op;
! int i;
{
if (!PyList_Check(op)) {
--- 86,90 ----
PyObject *
! PyList_GetItem(PyObject *op, int i)
{
if (!PyList_Check(op)) {
***************
*** 108,115 ****
int
! PyList_SetItem(op, i, newitem)
! register PyObject *op;
! register int i;
! register PyObject *newitem;
{
register PyObject *olditem;
--- 103,108 ----
int
! PyList_SetItem(register PyObject *op, register int i,
! register PyObject *newitem)
{
register PyObject *olditem;
***************
*** 134,141 ****
static int
! ins1(self, where, v)
! PyListObject *self;
! int where;
! PyObject *v;
{
int i;
--- 127,131 ----
static int
! ins1(PyListObject *self, int where, PyObject *v)
{
int i;
***************
*** 165,172 ****
int
! PyList_Insert(op, where, newitem)
! PyObject *op;
! int where;
! PyObject *newitem;
{
if (!PyList_Check(op)) {
--- 155,159 ----
int
! PyList_Insert(PyObject *op, int where, PyObject *newitem)
{
if (!PyList_Check(op)) {
***************
*** 178,184 ****
int
! PyList_Append(op, newitem)
! PyObject *op;
! PyObject *newitem;
{
if (!PyList_Check(op)) {
--- 165,169 ----
int
! PyList_Append(PyObject *op, PyObject *newitem)
{
if (!PyList_Check(op)) {
***************
*** 193,198 ****
static void
! list_dealloc(op)
! PyListObject *op;
{
int i;
--- 178,182 ----
static void
! list_dealloc(PyListObject *op)
{
int i;
***************
*** 216,223 ****
static int
! list_print(op, fp, flags)
! PyListObject *op;
! FILE *fp;
! int flags;
{
int i;
--- 200,204 ----
static int
! list_print(PyListObject *op, FILE *fp, int flags)
{
int i;
***************
*** 245,250 ****
static PyObject *
! list_repr(v)
! PyListObject *v;
{
PyObject *s, *comma;
--- 226,230 ----
static PyObject *
! list_repr(PyListObject *v)
{
PyObject *s, *comma;
***************
*** 271,276 ****
static int
! list_compare(v, w)
! PyListObject *v, *w;
{
int i;
--- 251,255 ----
static int
! list_compare(PyListObject *v, PyListObject *w)
{
int i;
***************
*** 284,289 ****
static int
! list_length(a)
! PyListObject *a;
{
return a->ob_size;
--- 263,267 ----
static int
! list_length(PyListObject *a)
{
return a->ob_size;
***************
*** 293,299 ****
static int
! list_contains(a, el)
! PyListObject *a;
! PyObject *el;
{
int i, cmp;
--- 271,275 ----
static int
! list_contains(PyListObject *a, PyObject *el)
{
int i, cmp;
***************
*** 311,317 ****
static PyObject *
! list_item(a, i)
! PyListObject *a;
! int i;
{
if (i < 0 || i >= a->ob_size) {
--- 287,291 ----
static PyObject *
! list_item(PyListObject *a, int i)
{
if (i < 0 || i >= a->ob_size) {
***************
*** 327,333 ****
static PyObject *
! list_slice(a, ilow, ihigh)
! PyListObject *a;
! int ilow, ihigh;
{
PyListObject *np;
--- 301,305 ----
static PyObject *
! list_slice(PyListObject *a, int ilow, int ihigh)
{
PyListObject *np;
***************
*** 353,359 ****
PyObject *
! PyList_GetSlice(a, ilow, ihigh)
! PyObject *a;
! int ilow, ihigh;
{
if (!PyList_Check(a)) {
--- 325,329 ----
PyObject *
! PyList_GetSlice(PyObject *a, int ilow, int ihigh)
{
if (!PyList_Check(a)) {
***************
*** 365,371 ****
static PyObject *
! list_concat(a, bb)
! PyListObject *a;
! PyObject *bb;
{
int size;
--- 335,339 ----
static PyObject *
! list_concat(PyListObject *a, PyObject *bb)
{
int size;
***************
*** 399,405 ****
static PyObject *
! list_repeat(a, n)
! PyListObject *a;
! int n;
{
int i, j;
--- 367,371 ----
static PyObject *
! list_repeat(PyListObject *a, int n)
{
int i, j;
***************
*** 425,432 ****
static int
! list_ass_slice(a, ilow, ihigh, v)
! PyListObject *a;
! int ilow, ihigh;
! PyObject *v;
{
/* Because [X]DECREF can recursively invoke list operations on
--- 391,395 ----
static int
! list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
{
/* Because [X]DECREF can recursively invoke list operations on
***************
*** 516,523 ****
int
! PyList_SetSlice(a, ilow, ihigh, v)
! PyObject *a;
! int ilow, ihigh;
! PyObject *v;
{
if (!PyList_Check(a)) {
--- 479,483 ----
int
! PyList_SetSlice(PyObject *a, int ilow, int ihigh, PyObject *v)
{
if (!PyList_Check(a)) {
***************
*** 529,536 ****
static int
! list_ass_item(a, i, v)
! PyListObject *a;
! int i;
! PyObject *v;
{
PyObject *old_value;
--- 489,493 ----
static int
! list_ass_item(PyListObject *a, int i, PyObject *v)
{
PyObject *old_value;
***************
*** 550,557 ****
static PyObject *
! ins(self, where, v)
! PyListObject *self;
! int where;
! PyObject *v;
{
if (ins1(self, where, v) != 0)
--- 507,511 ----
static PyObject *
! ins(PyListObject *self, int where, PyObject *v)
{
if (ins1(self, where, v) != 0)
***************
*** 562,568 ****
static PyObject *
! listinsert(self, args)
! PyListObject *self;
! PyObject *args;
{
int i;
--- 516,520 ----
static PyObject *
! listinsert(PyListObject *self, PyObject *args)
{
int i;
***************
*** 588,594 ****
static PyObject *
! listappend(self, args)
! PyListObject *self;
! PyObject *args;
{
PyObject *v;
--- 540,544 ----
static PyObject *
! listappend(PyListObject *self, PyObject *args)
{
PyObject *v;
***************
*** 599,605 ****
static PyObject *
! listextend(self, args)
! PyListObject *self;
! PyObject *args;
{
PyObject *b = NULL, *res = NULL;
--- 549,553 ----
static PyObject *
! listextend(PyListObject *self, PyObject *args)
{
PyObject *b = NULL, *res = NULL;
***************
*** 665,671 ****
static PyObject *
! listpop(self, args)
! PyListObject *self;
! PyObject *args;
{
int i = -1;
--- 613,617 ----
static PyObject *
! listpop(PyListObject *self, PyObject *args)
{
int i = -1;
***************
*** 707,714 ****
static int
! docompare(x, y, compare)
! PyObject *x;
! PyObject *y;
! PyObject *compare;
{
PyObject *args, *res;
--- 653,657 ----
static int
! docompare(PyObject *x, PyObject *y, PyObject *compare)
{
PyObject *args, *res;
***************
*** 796,804 ****
static int
! binarysort(lo, hi, start, compare)
! PyObject **lo;
! PyObject **hi;
! PyObject **start;
! PyObject *compare;/* Comparison function object, or NULL for default */
{
/* assert lo <= start <= hi
--- 739,744 ----
static int
! binarysort(PyObject **lo, PyObject **hi, PyObject **start, PyObject *compare)
! /* compare -- comparison function object, or NULL for default */
{
/* assert lo <= start <= hi
***************
*** 930,937 ****
static int
! samplesortslice(lo, hi, compare)
! PyObject **lo;
! PyObject **hi;
! PyObject *compare;/* Comparison function object, or NULL for default */
{
register PyObject **l, **r;
--- 870,875 ----
static int
! samplesortslice(PyObject **lo, PyObject **hi, PyObject *compare)
! /* compare -- comparison function object, or NULL for default */
{
register PyObject **l, **r;
***************
*** 1236,1242 ****
static PyObject *
! listsort(self, args)
! PyListObject *self;
! PyObject *args;
{
int err;
--- 1174,1178 ----
static PyObject *
! listsort(PyListObject *self, PyObject *args)
{
int err;
***************
*** 1259,1264 ****
int
! PyList_Sort(v)
! PyObject *v;
{
if (v == NULL || !PyList_Check(v)) {
--- 1195,1199 ----
int
! PyList_Sort(PyObject *v)
{
if (v == NULL || !PyList_Check(v)) {
***************
*** 1274,1280 ****
static PyObject *
! listreverse(self, args)
! PyListObject *self;
! PyObject *args;
{
register PyObject **p, **q;
--- 1209,1213 ----
static PyObject *
! listreverse(PyListObject *self, PyObject *args)
{
register PyObject **p, **q;
***************
*** 1298,1303 ****
int
! PyList_Reverse(v)
! PyObject *v;
{
if (v == NULL || !PyList_Check(v)) {
--- 1231,1235 ----
int
! PyList_Reverse(PyObject *v)
{
if (v == NULL || !PyList_Check(v)) {
***************
*** 1313,1318 ****
PyObject *
! PyList_AsTuple(v)
! PyObject *v;
{
PyObject *w;
--- 1245,1249 ----
PyObject *
! PyList_AsTuple(PyObject *v)
{
PyObject *w;
***************
*** 1339,1345 ****
static PyObject *
! listindex(self, args)
! PyListObject *self;
! PyObject *args;
{
int i;
--- 1270,1274 ----
static PyObject *
! listindex(PyListObject *self, PyObject *args)
{
int i;
***************
*** 1359,1365 ****
static PyObject *
! listcount(self, args)
! PyListObject *self;
! PyObject *args;
{
int count = 0;
--- 1288,1292 ----
static PyObject *
! listcount(PyListObject *self, PyObject *args)
{
int count = 0;
***************
*** 1379,1385 ****
static PyObject *
! listremove(self, args)
! PyListObject *self;
! PyObject *args;
{
int i;
--- 1306,1310 ----
static PyObject *
! listremove(PyListObject *self, PyObject *args)
{
int i;
***************
*** 1460,1466 ****
static PyObject *
! list_getattr(f, name)
! PyListObject *f;
! char *name;
{
return Py_FindMethod(list_methods, (PyObject *)f, name);
--- 1385,1389 ----
static PyObject *
! list_getattr(PyListObject *f, char *name)
{
return Py_FindMethod(list_methods, (PyObject *)f, name);
***************
*** 1513,1517 ****
static PyObject *
! immutable_list_op(/*No args!*/)
{
PyErr_SetString(PyExc_TypeError,
--- 1436,1440 ----
static PyObject *
! immutable_list_op(void)
{
PyErr_SetString(PyExc_TypeError,
***************
*** 1532,1538 ****
static PyObject *
! immutable_list_getattr(f, name)
! PyListObject *f;
! char *name;
{
return Py_FindMethod(immutable_list_methods, (PyObject *)f, name);
--- 1455,1459 ----
static PyObject *
! immutable_list_getattr(PyListObject *f, char *name)
{
return Py_FindMethod(immutable_list_methods, (PyObject *)f, name);
***************
*** 1540,1544 ****
static int
! immutable_list_ass(/*No args!*/)
{
immutable_list_op();
--- 1461,1465 ----
static int
! immutable_list_ass(void)
{
immutable_list_op();
***************
*** 1582,1584 ****
(traverseproc)list_traverse, /* tp_traverse */
};
-
--- 1503,1504 ----