summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.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/listobject.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/listobject.c')
-rw-r--r--Objects/listobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index c083ffc..8b5771b 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2504,13 +2504,13 @@ static int
list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
{
if (PyInt_Check(item)) {
- long i = PyInt_AS_LONG(item);
+ Py_ssize_t i = PyInt_AS_LONG(item);
if (i < 0)
i += PyList_GET_SIZE(self);
return list_ass_item(self, i, value);
}
else if (PyLong_Check(item)) {
- long i = PyLong_AsLong(item);
+ Py_ssize_t i = PyInt_AsSsize_t(item);
if (i == -1 && PyErr_Occurred())
return -1;
if (i < 0)
@@ -2818,7 +2818,7 @@ PyTypeObject PyListIter_Type = {
typedef struct {
PyObject_HEAD
- long it_index;
+ Py_ssize_t it_index;
PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
} listreviterobject;
@@ -2860,7 +2860,7 @@ static PyObject *
listreviter_next(listreviterobject *it)
{
PyObject *item;
- long index = it->it_index;
+ Py_ssize_t index = it->it_index;
PyListObject *seq = it->it_seq;
if (index>=0 && index < PyList_GET_SIZE(seq)) {