[Python-checkins] r45261 - python/trunk/Objects/bufferobject.c python/trunk/Objects/classobject.c python/trunk/Objects/enumobject.c python/trunk/Objects/fileobject.c python/trunk/Objects/floatobject.c python/trunk/Objects/intobject.c python/trunk/Objects/listobject.c python/trunk/Objects/longobject.c

anthony.baxter python-checkins at python.org
Tue Apr 11 08:54:32 CEST 2006


Author: anthony.baxter
Date: Tue Apr 11 08:54:30 2006
New Revision: 45261

Modified:
   python/trunk/Objects/bufferobject.c
   python/trunk/Objects/classobject.c
   python/trunk/Objects/enumobject.c
   python/trunk/Objects/fileobject.c
   python/trunk/Objects/floatobject.c
   python/trunk/Objects/intobject.c
   python/trunk/Objects/listobject.c
   python/trunk/Objects/longobject.c
Log:
More C++-compliance. Note especially listobject.c - to get C++ to accept the
PyTypeObject structures, I had to make prototypes for the functions, and 
move the structure definition ahead of the functions. I'd dearly like a better
way to do this - to change this would make for a massive set of changes to
the codebase. 

There's still some warnings - this is purely to get rid of errors first.


Modified: python/trunk/Objects/bufferobject.c
==============================================================================
--- python/trunk/Objects/bufferobject.c	(original)
+++ python/trunk/Objects/bufferobject.c	Tue Apr 11 08:54:30 2006
@@ -169,7 +169,7 @@
 	}
 	/* XXX: check for overflow in multiply */
 	/* Inline PyObject_New */
-	o = PyObject_MALLOC(sizeof(*b) + size);
+	o = (PyObject *)PyObject_MALLOC(sizeof(*b) + size);
 	if ( o == NULL )
 		return PyErr_NoMemory();
 	b = (PyBufferObject *) PyObject_INIT(o, &PyBuffer_Type);
@@ -305,7 +305,7 @@
 	Py_ssize_t size;
 	if (!get_buf(self, &ptr, &size))
 		return NULL;
-	return PyString_FromStringAndSize(ptr, size);
+	return PyString_FromStringAndSize((const char *)ptr, size);
 }
 
 /* Sequence methods */

Modified: python/trunk/Objects/classobject.c
==============================================================================
--- python/trunk/Objects/classobject.c	(original)
+++ python/trunk/Objects/classobject.c	Tue Apr 11 08:54:30 2006
@@ -208,7 +208,7 @@
 {
 	register PyObject *v;
 	register char *sname = PyString_AsString(name);
-	PyClassObject *class;
+	PyClassObject *klass;
 	descrgetfunc f;
 
 	if (sname[0] == '_' && sname[1] == '_') {
@@ -234,7 +234,7 @@
 			return v;
 		}
 	}
-	v = class_lookup(op, name, &class);
+	v = class_lookup(op, name, &klass);
 	if (v == NULL) {
 		PyErr_Format(PyExc_AttributeError,
 			     "class %.50s has no attribute '%.400s'",
@@ -481,23 +481,23 @@
 };
 
 int
-PyClass_IsSubclass(PyObject *class, PyObject *base)
+PyClass_IsSubclass(PyObject *klass, PyObject *base)
 {
 	Py_ssize_t i, n;
 	PyClassObject *cp;
-	if (class == base)
+	if (klass == base)
 		return 1;
 	if (PyTuple_Check(base)) {
 		n = PyTuple_GET_SIZE(base);
 		for (i = 0; i < n; i++) {
-			if (PyClass_IsSubclass(class, PyTuple_GET_ITEM(base, i)))
+			if (PyClass_IsSubclass(klass, PyTuple_GET_ITEM(base, i)))
 				return 1;
 		}
 		return 0;
 	}
-	if (class == NULL || !PyClass_Check(class))
+	if (klass == NULL || !PyClass_Check(klass))
 		return 0;
-	cp = (PyClassObject *)class;
+	cp = (PyClassObject *)klass;
 	n = PyTuple_Size(cp->cl_bases);
 	for (i = 0; i < n; i++) {
 		if (PyClass_IsSubclass(PyTuple_GetItem(cp->cl_bases, i), base))
@@ -719,7 +719,7 @@
 instance_getattr2(register PyInstanceObject *inst, PyObject *name)
 {
 	register PyObject *v;
-	PyClassObject *class;
+	PyClassObject *klass;
 	descrgetfunc f;
 
 	v = PyDict_GetItem(inst->in_dict, name);
@@ -727,7 +727,7 @@
 		Py_INCREF(v);
 		return v;
 	}
-	v = class_lookup(inst->in_class, name, &class);
+	v = class_lookup(inst->in_class, name, &klass);
 	if (v != NULL) {
 		Py_INCREF(v);
 		f = TP_DESCR_GET(v->ob_type);
@@ -767,7 +767,7 @@
 _PyInstance_Lookup(PyObject *pinst, PyObject *name)
 {
 	PyObject *v;
-	PyClassObject *class;
+	PyClassObject *klass;
 	PyInstanceObject *inst;	/* pinst cast to the right type */
 
 	assert(PyInstance_Check(pinst));
@@ -777,7 +777,7 @@
 
  	v = PyDict_GetItem(inst->in_dict, name);
 	if (v == NULL)
-		v = class_lookup(inst->in_class, name, &class);
+		v = class_lookup(inst->in_class, name, &klass);
 	return v;
 }
 
@@ -2123,7 +2123,7 @@
 static PyMethodObject *free_list;
 
 PyObject *
-PyMethod_New(PyObject *func, PyObject *self, PyObject *class)
+PyMethod_New(PyObject *func, PyObject *self, PyObject *klass)
 {
 	register PyMethodObject *im;
 	if (!PyCallable_Check(func)) {
@@ -2145,8 +2145,8 @@
 	im->im_func = func;
 	Py_XINCREF(self);
 	im->im_self = self;
-	Py_XINCREF(class);
-	im->im_class = class;
+	Py_XINCREF(klass);
+	im->im_class = klass;
 	_PyObject_GC_TRACK(im);
 	return (PyObject *)im;
 }
@@ -2368,15 +2368,15 @@
 }
 
 static void
-getclassname(PyObject *class, char *buf, int bufsize)
+getclassname(PyObject *klass, char *buf, int bufsize)
 {
 	PyObject *name;
 
 	assert(bufsize > 1);
 	strcpy(buf, "?"); /* Default outcome */
-	if (class == NULL)
+	if (klass == NULL)
 		return;
-	name = PyObject_GetAttrString(class, "__name__");
+	name = PyObject_GetAttrString(klass, "__name__");
 	if (name == NULL) {
 		/* This function cannot return an exception */
 		PyErr_Clear();
@@ -2392,7 +2392,7 @@
 static void
 getinstclassname(PyObject *inst, char *buf, int bufsize)
 {
-	PyObject *class;
+	PyObject *klass;
 
 	if (inst == NULL) {
 		assert(bufsize > 0 && (size_t)bufsize > strlen("nothing"));
@@ -2400,22 +2400,22 @@
 		return;
 	}
 
-	class = PyObject_GetAttrString(inst, "__class__");
-	if (class == NULL) {
+	klass = PyObject_GetAttrString(inst, "__class__");
+	if (klass == NULL) {
 		/* This function cannot return an exception */
 		PyErr_Clear();
-		class = (PyObject *)(inst->ob_type);
-		Py_INCREF(class);
+		klass = (PyObject *)(inst->ob_type);
+		Py_INCREF(klass);
 	}
-	getclassname(class, buf, bufsize);
-	Py_XDECREF(class);
+	getclassname(klass, buf, bufsize);
+	Py_XDECREF(klass);
 }
 
 static PyObject *
 instancemethod_call(PyObject *func, PyObject *arg, PyObject *kw)
 {
 	PyObject *self = PyMethod_GET_SELF(func);
-	PyObject *class = PyMethod_GET_CLASS(func);
+	PyObject *klass = PyMethod_GET_CLASS(func);
 	PyObject *result;
 
 	func = PyMethod_GET_FUNCTION(func);
@@ -2428,14 +2428,14 @@
 		if (self == NULL)
 			ok = 0;
 		else {
-			ok = PyObject_IsInstance(self, class);
+			ok = PyObject_IsInstance(self, klass);
 			if (ok < 0)
 				return NULL;
 		}
 		if (!ok) {
 			char clsbuf[256];
 			char instbuf[256];
-			getclassname(class, clsbuf, sizeof(clsbuf));
+			getclassname(klass, clsbuf, sizeof(clsbuf));
 			getinstclassname(self, instbuf, sizeof(instbuf));
 			PyErr_Format(PyExc_TypeError,
 				     "unbound method %s%s must be called with "

Modified: python/trunk/Objects/enumobject.c
==============================================================================
--- python/trunk/Objects/enumobject.c	(original)
+++ python/trunk/Objects/enumobject.c	Tue Apr 11 08:54:30 2006
@@ -9,8 +9,6 @@
 	PyObject* en_result;	   /* result tuple  */
 } enumobject;
 
-PyTypeObject PyEnum_Type;
-
 static PyObject *
 enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {

Modified: python/trunk/Objects/fileobject.c
==============================================================================
--- python/trunk/Objects/fileobject.c	(original)
+++ python/trunk/Objects/fileobject.c	Tue Apr 11 08:54:30 2006
@@ -313,7 +313,8 @@
 			PyMem_Free(file->f_setbuf);
 			file->f_setbuf = NULL;
 		} else {
-			file->f_setbuf = PyMem_Realloc(file->f_setbuf, bufsize);
+			file->f_setbuf = (char *)PyMem_Realloc(file->f_setbuf, 
+                                                                bufsize);
 		}
 #ifdef HAVE_SETVBUF
 		setvbuf(file->f_fp, file->f_setbuf, type, bufsize);
@@ -1391,7 +1392,7 @@
 			goto cleanup;
 		}
 		totalread += nread;
-		p = memchr(buffer+nfilled, '\n', nread);
+		p = (char *)memchr(buffer+nfilled, '\n', nread);
 		if (p == NULL) {
 			/* Need a larger buffer to fit this line */
 			nfilled += nread;
@@ -1431,7 +1432,7 @@
 			if (err != 0)
 				goto error;
 			q = p;
-			p = memchr(q, '\n', end-q);
+			p = (char *)memchr(q, '\n', end-q);
 		} while (p != NULL);
 		/* Move the remaining incomplete line to the start */
 		nfilled = end-q;
@@ -1809,7 +1810,7 @@
 		else
 			drop_readahead(f);
 	}
-	if ((f->f_buf = PyMem_Malloc(bufsize)) == NULL) {
+	if ((f->f_buf = (char *)PyMem_Malloc(bufsize)) == NULL) {
 		PyErr_NoMemory();
 		return -1;
 	}
@@ -1852,7 +1853,7 @@
 	if (len == 0)
 		return (PyStringObject *)
 			PyString_FromStringAndSize(NULL, skip);
-	bufptr = memchr(f->f_bufptr, '\n', len);
+	bufptr = (char *)memchr(f->f_bufptr, '\n', len);
 	if (bufptr != NULL) {
 		bufptr++;			/* Count the '\n' */
 		len = bufptr - f->f_bufptr;

Modified: python/trunk/Objects/floatobject.c
==============================================================================
--- python/trunk/Objects/floatobject.c	(original)
+++ python/trunk/Objects/floatobject.c	Tue Apr 11 08:54:30 2006
@@ -959,21 +959,21 @@
 static PyObject *
 float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-	PyObject *tmp, *new;
+	PyObject *tmp, *newobj;
 
 	assert(PyType_IsSubtype(type, &PyFloat_Type));
 	tmp = float_new(&PyFloat_Type, args, kwds);
 	if (tmp == NULL)
 		return NULL;
 	assert(PyFloat_CheckExact(tmp));
-	new = type->tp_alloc(type, 0);
-	if (new == NULL) {
+	newobj = type->tp_alloc(type, 0);
+	if (newobj == NULL) {
 		Py_DECREF(tmp);
 		return NULL;
 	}
-	((PyFloatObject *)new)->ob_fval = ((PyFloatObject *)tmp)->ob_fval;
+	((PyFloatObject *)newobj)->ob_fval = ((PyFloatObject *)tmp)->ob_fval;
 	Py_DECREF(tmp);
-	return new;
+	return newobj;
 }
 
 static PyObject *

Modified: python/trunk/Objects/intobject.c
==============================================================================
--- python/trunk/Objects/intobject.c	(original)
+++ python/trunk/Objects/intobject.c	Tue Apr 11 08:54:30 2006
@@ -376,7 +376,7 @@
 PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
 {
 	PyObject *result;
-	char *buffer = PyMem_MALLOC(length+1);
+	char *buffer = (char *)PyMem_MALLOC(length+1);
 
 	if (buffer == NULL)
 		return NULL;
@@ -982,7 +982,7 @@
 static PyObject *
 int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-	PyObject *tmp, *new;
+	PyObject *tmp, *newobj;
 	long ival;
 
 	assert(PyType_IsSubtype(type, &PyInt_Type));
@@ -999,14 +999,14 @@
 		ival = ((PyIntObject *)tmp)->ob_ival;
 	}
 
-	new = type->tp_alloc(type, 0);
-	if (new == NULL) {
+	newobj = type->tp_alloc(type, 0);
+	if (newobj == NULL) {
 		Py_DECREF(tmp);
 		return NULL;
 	}
-	((PyIntObject *)new)->ob_ival = ival;
+	((PyIntObject *)newobj)->ob_ival = ival;
 	Py_DECREF(tmp);
-	return new;
+	return newobj;
 }
 
 static PyObject *

Modified: python/trunk/Objects/listobject.c
==============================================================================
--- python/trunk/Objects/listobject.c	(original)
+++ python/trunk/Objects/listobject.c	Tue Apr 11 08:54:30 2006
@@ -1805,28 +1805,11 @@
 	PyObject *value;
 } sortwrapperobject;
 
-static PyTypeObject sortwrapper_type;
-
+PyDoc_STRVAR(sortwrapper_doc, "Object wrapper with a custom sort key.");
 static PyObject *
-sortwrapper_richcompare(sortwrapperobject *a, sortwrapperobject *b, int op)
-{
-	if (!PyObject_TypeCheck(b, &sortwrapper_type)) {
-		PyErr_SetString(PyExc_TypeError,
-			"expected a sortwrapperobject");
-		return NULL;
-	}
-	return PyObject_RichCompare(a->key, b->key, op);
-}
-
+sortwrapper_richcompare(sortwrapperobject *, sortwrapperobject *, int);
 static void
-sortwrapper_dealloc(sortwrapperobject *so)
-{
-	Py_XDECREF(so->key);
-	Py_XDECREF(so->value);
-	PyObject_Del(so);
-}
-
-PyDoc_STRVAR(sortwrapper_doc, "Object wrapper with a custom sort key.");
+sortwrapper_dealloc(sortwrapperobject *);
 
 static PyTypeObject sortwrapper_type = {
 	PyObject_HEAD_INIT(&PyType_Type)
@@ -1858,6 +1841,26 @@
 	(richcmpfunc)sortwrapper_richcompare,	/* tp_richcompare */
 };
 
+
+static PyObject *
+sortwrapper_richcompare(sortwrapperobject *a, sortwrapperobject *b, int op)
+{
+	if (!PyObject_TypeCheck(b, &sortwrapper_type)) {
+		PyErr_SetString(PyExc_TypeError,
+			"expected a sortwrapperobject");
+		return NULL;
+	}
+	return PyObject_RichCompare(a->key, b->key, op);
+}
+
+static void
+sortwrapper_dealloc(sortwrapperobject *so)
+{
+	Py_XDECREF(so->key);
+	Py_XDECREF(so->value);
+	PyObject_Del(so);
+}
+
 /* Returns a new reference to a sortwrapper.
    Consumes the references to the two underlying objects. */
 
@@ -2698,7 +2701,53 @@
 	PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
 } listiterobject;
 
-PyTypeObject PyListIter_Type;
+static PyObject *list_iter(PyObject *);
+static void listiter_dealloc(listiterobject *);
+static int listiter_traverse(listiterobject *, visitproc, void *);
+static PyObject *listiter_next(listiterobject *);
+static PyObject *listiter_len(listiterobject *);
+
+PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
+
+static PyMethodDef listiter_methods[] = {
+	{"__length_hint__", (PyCFunction)listiter_len, METH_NOARGS, length_hint_doc},
+ 	{NULL,		NULL}		/* sentinel */
+};
+
+PyTypeObject PyListIter_Type = {
+	PyObject_HEAD_INIT(&PyType_Type)
+	0,					/* ob_size */
+	"listiterator",				/* tp_name */
+	sizeof(listiterobject),			/* tp_basicsize */
+	0,					/* tp_itemsize */
+	/* methods */
+	(destructor)listiter_dealloc,		/* tp_dealloc */
+	0,					/* tp_print */
+	0,					/* tp_getattr */
+	0,					/* tp_setattr */
+	0,					/* tp_compare */
+	0,					/* tp_repr */
+	0,					/* tp_as_number */
+	0,					/* tp_as_sequence */
+	0,					/* tp_as_mapping */
+	0,					/* tp_hash */
+	0,					/* tp_call */
+	0,					/* tp_str */
+	PyObject_GenericGetAttr,		/* tp_getattro */
+	0,					/* tp_setattro */
+	0,					/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
+	0,					/* tp_doc */
+	(traverseproc)listiter_traverse,	/* tp_traverse */
+	0,					/* tp_clear */
+	0,					/* tp_richcompare */
+	0,					/* tp_weaklistoffset */
+	PyObject_SelfIter,			/* tp_iter */
+	(iternextfunc)listiter_next,		/* tp_iternext */
+	listiter_methods,			/* tp_methods */
+	0,					/* tp_members */
+};
+
 
 static PyObject *
 list_iter(PyObject *seq)
@@ -2770,29 +2819,40 @@
 	}
 	return PyInt_FromLong(0);
 }
+/*********************** List Reverse Iterator **************************/
 
-PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
+typedef struct {
+	PyObject_HEAD
+	Py_ssize_t it_index;
+	PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
+} listreviterobject;
 
-static PyMethodDef listiter_methods[] = {
-	{"__length_hint__", (PyCFunction)listiter_len, METH_NOARGS, length_hint_doc},
- 	{NULL,		NULL}		/* sentinel */
+static PyObject *list_reversed(PyListObject *, PyObject *);
+static void listreviter_dealloc(listreviterobject *);
+static int listreviter_traverse(listreviterobject *, visitproc, void *);
+static PyObject *listreviter_next(listreviterobject *);
+static Py_ssize_t listreviter_len(listreviterobject *);
+
+static PySequenceMethods listreviter_as_sequence = {
+	(lenfunc)listreviter_len,	/* sq_length */
+	0,				/* sq_concat */
 };
 
-PyTypeObject PyListIter_Type = {
+PyTypeObject PyListRevIter_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,					/* ob_size */
-	"listiterator",				/* tp_name */
-	sizeof(listiterobject),			/* tp_basicsize */
+	"listreverseiterator",			/* tp_name */
+	sizeof(listreviterobject),		/* tp_basicsize */
 	0,					/* tp_itemsize */
 	/* methods */
-	(destructor)listiter_dealloc,		/* tp_dealloc */
+	(destructor)listreviter_dealloc,	/* tp_dealloc */
 	0,					/* tp_print */
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
 	0,					/* tp_compare */
 	0,					/* tp_repr */
 	0,					/* tp_as_number */
-	0,					/* tp_as_sequence */
+	&listreviter_as_sequence,		/* tp_as_sequence */
 	0,					/* tp_as_mapping */
 	0,					/* tp_hash */
 	0,					/* tp_call */
@@ -2802,26 +2862,15 @@
 	0,					/* tp_as_buffer */
 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
 	0,					/* tp_doc */
-	(traverseproc)listiter_traverse,	/* tp_traverse */
+	(traverseproc)listreviter_traverse,	/* tp_traverse */
 	0,					/* tp_clear */
 	0,					/* tp_richcompare */
 	0,					/* tp_weaklistoffset */
 	PyObject_SelfIter,			/* tp_iter */
-	(iternextfunc)listiter_next,		/* tp_iternext */
-	listiter_methods,			/* tp_methods */
-	0,					/* tp_members */
+	(iternextfunc)listreviter_next,		/* tp_iternext */
+	0,
 };
 
-/*********************** List Reverse Iterator **************************/
-
-typedef struct {
-	PyObject_HEAD
-	Py_ssize_t it_index;
-	PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
-} listreviterobject;
-
-PyTypeObject PyListRevIter_Type;
-
 static PyObject *
 list_reversed(PyListObject *seq, PyObject *unused)
 {
@@ -2884,40 +2933,3 @@
 	return len;
 }
 
-static PySequenceMethods listreviter_as_sequence = {
-	(lenfunc)listreviter_len,	/* sq_length */
-	0,				/* sq_concat */
-};
-
-PyTypeObject PyListRevIter_Type = {
-	PyObject_HEAD_INIT(&PyType_Type)
-	0,					/* ob_size */
-	"listreverseiterator",			/* tp_name */
-	sizeof(listreviterobject),		/* tp_basicsize */
-	0,					/* tp_itemsize */
-	/* methods */
-	(destructor)listreviter_dealloc,	/* tp_dealloc */
-	0,					/* tp_print */
-	0,					/* tp_getattr */
-	0,					/* tp_setattr */
-	0,					/* tp_compare */
-	0,					/* tp_repr */
-	0,					/* tp_as_number */
-	&listreviter_as_sequence,		/* tp_as_sequence */
-	0,					/* tp_as_mapping */
-	0,					/* tp_hash */
-	0,					/* tp_call */
-	0,					/* tp_str */
-	PyObject_GenericGetAttr,		/* tp_getattro */
-	0,					/* tp_setattro */
-	0,					/* tp_as_buffer */
-	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
-	0,					/* tp_doc */
-	(traverseproc)listreviter_traverse,	/* tp_traverse */
-	0,					/* tp_clear */
-	0,					/* tp_richcompare */
-	0,					/* tp_weaklistoffset */
-	PyObject_SelfIter,			/* tp_iter */
-	(iternextfunc)listreviter_next,		/* tp_iternext */
-	0,
-};

Modified: python/trunk/Objects/longobject.c
==============================================================================
--- python/trunk/Objects/longobject.c	(original)
+++ python/trunk/Objects/longobject.c	Tue Apr 11 08:54:30 2006
@@ -1476,7 +1476,7 @@
 PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
 {
 	PyObject *result;
-	char *buffer = PyMem_MALLOC(length+1);
+	char *buffer = (char *)PyMem_MALLOC(length+1);
 
 	if (buffer == NULL)
 		return NULL;
@@ -3088,7 +3088,7 @@
 static PyObject *
 long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-	PyLongObject *tmp, *new;
+	PyLongObject *tmp, *newobj;
 	Py_ssize_t i, n;
 
 	assert(PyType_IsSubtype(type, &PyLong_Type));
@@ -3099,17 +3099,17 @@
 	n = tmp->ob_size;
 	if (n < 0)
 		n = -n;
-	new = (PyLongObject *)type->tp_alloc(type, n);
-	if (new == NULL) {
+	newobj = (PyLongObject *)type->tp_alloc(type, n);
+	if (newobj == NULL) {
 		Py_DECREF(tmp);
 		return NULL;
 	}
-	assert(PyLong_Check(new));
-	new->ob_size = tmp->ob_size;
+	assert(PyLong_Check(newobj));
+	newobj->ob_size = tmp->ob_size;
 	for (i = 0; i < n; i++)
-		new->ob_digit[i] = tmp->ob_digit[i];
+		newobj->ob_digit[i] = tmp->ob_digit[i];
 	Py_DECREF(tmp);
-	return (PyObject *)new;
+	return (PyObject *)newobj;
 }
 
 static PyObject *


More information about the Python-checkins mailing list