summaryrefslogtreecommitdiffstats
path: root/Objects/enumobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-16 14:32:27 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-02-16 14:32:27 (GMT)
commiteb079f1c2533bcefcab3ef4c07b800e5bd37239f (patch)
tree32ce8e1eafb2e93ef977649e3cb60a3c0ec0fc00 /Objects/enumobject.c
parentad0a4629beac0600c4c4c3167b0d68be57ca674e (diff)
downloadcpython-eb079f1c2533bcefcab3ef4c07b800e5bd37239f.zip
cpython-eb079f1c2533bcefcab3ef4c07b800e5bd37239f.tar.gz
cpython-eb079f1c2533bcefcab3ef4c07b800e5bd37239f.tar.bz2
Use Py_ssize_t for counts and sizes.
Convert Py_ssize_t using PyInt_FromSsize_t
Diffstat (limited to 'Objects/enumobject.c')
-rw-r--r--Objects/enumobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index e6e5bc5..ea85e3c 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -159,14 +159,14 @@ PyTypeObject PyEnum_Type = {
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 @@ reversed_len(reversedobject *ro)
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)).");