diff Objects/enumobject.c @ 36519:d6d415df0df0 legacy-trunk

Use Py_ssize_t for counts and sizes. Convert Py_ssize_t using PyInt_FromSsize_t
author Martin v. Löwis <martin@v.loewis.de>
date Thu, 16 Feb 2006 14:32:27 +0000
parents 7fdc639bc5b4
children dba6494735d0
line wrap: on
line diff
--- a/Objects/enumobject.c	Thu Feb 16 14:30:23 2006 +0000
+++ b/Objects/enumobject.c	Thu Feb 16 14:32:27 2006 +0000
@@ -159,14 +159,14 @@
 
 typedef struct {
 	PyObject_HEAD
-	long      index;
+	Py_ssize_t      index;
 	PyObject* seq;
 } reversedobject;
 
 static PyObject *
 reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-	long n;
+	Py_ssize_t n;
 	PyObject *seq;
 	reversedobject *ro;
 
@@ -249,7 +249,7 @@
 	if (seqsize == -1)
 		return NULL;
 	position = ro->index + 1;
-	return PyInt_FromLong((seqsize < position)  ?  0  :  position);
+	return PyInt_FromSsize_t((seqsize < position)  ?  0  :  position);
 }
 
 PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");