summaryrefslogtreecommitdiff
path: root/Objects/sliceobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 +0000
committerMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 +0000
commit26a6348f77faff1083d501950812ea9f68eb9547 (patch)
tree8aebd3631f3b60d9753cd8271c0ad7c1379af1a2 /Objects/sliceobject.c
parentad4cf65e988f853a3b32a7da30198ce9c6c73c02 (diff)
downloadcpython-26a6348f77faff1083d501950812ea9f68eb9547.tar.gz
Merge ssize_t branch.
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r--Objects/sliceobject.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index f5ed898014..3b37dbb40b 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -80,9 +80,10 @@ PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
}
int
-PySlice_GetIndices(PySliceObject *r, int length,
- int *start, int *stop, int *step)
+PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
{
+ /* XXX support long ints */
if (r->step == Py_None) {
*step = 1;
} else {
@@ -110,12 +111,12 @@ PySlice_GetIndices(PySliceObject *r, int length,
}
int
-PySlice_GetIndicesEx(PySliceObject *r, int length,
- int *start, int *stop, int *step, int *slicelength)
+PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
{
/* this is harder to get right than you might think */
- int defstart, defstop;
+ Py_ssize_t defstart, defstop;
if (r->step == Py_None) {
*step = 1;
@@ -230,7 +231,7 @@ static PyMemberDef slice_members[] = {
static PyObject*
slice_indices(PySliceObject* self, PyObject* len)
{
- int ilen, start, stop, step, slicelength;
+ Py_ssize_t ilen, start, stop, step, slicelength;
ilen = PyInt_AsLong(len);