Mercurial > cpython-lru_cache-weakref
diff Objects/sliceobject.c @ 44099:f324631462a2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sun, 02 Dec 2007 14:31:20 +0000 |
| parents | 003d35215ef2 |
| children | 86a2679dca46 |
line wrap: on
line diff
--- a/Objects/sliceobject.c Sun Dec 02 09:40:06 2007 +0000 +++ b/Objects/sliceobject.c Sun Dec 02 14:31:20 2007 +0000 @@ -83,10 +83,10 @@ _PySlice_FromIndices(Py_ssize_t istart, Py_ssize_t istop) { PyObject *start, *end, *slice; - start = PyInt_FromSsize_t(istart); + start = PyLong_FromSsize_t(istart); if (!start) return NULL; - end = PyInt_FromSsize_t(istop); + end = PyLong_FromSsize_t(istop); if (!end) { Py_DECREF(start); return NULL; @@ -107,20 +107,20 @@ *step = 1; } else { if (!PyLong_Check(r->step)) return -1; - *step = PyInt_AsSsize_t(r->step); + *step = PyLong_AsSsize_t(r->step); } if (r->start == Py_None) { *start = *step < 0 ? length-1 : 0; } else { - if (!PyInt_Check(r->start)) return -1; - *start = PyInt_AsSsize_t(r->start); + if (!PyLong_Check(r->start)) return -1; + *start = PyLong_AsSsize_t(r->start); if (*start < 0) *start += length; } if (r->stop == Py_None) { *stop = *step < 0 ? -1 : length; } else { - if (!PyInt_Check(r->stop)) return -1; - *stop = PyInt_AsSsize_t(r->stop); + if (!PyLong_Check(r->stop)) return -1; + *stop = PyLong_AsSsize_t(r->stop); if (*stop < 0) *stop += length; } if (*stop > length) return -1;
