Index: numarray-1.5.1/Src/_ndarraymodule.c =================================================================== --- numarray-1.5.1.orig/Src/_ndarraymodule.c +++ numarray-1.5.1/Src/_ndarraymodule.c @@ -592,8 +592,8 @@ _ndarray_simpleIndexing(PyArrayObject *s /* Copied from Python-2.3.3 Objects/sliceobject.c */ int -_GetIndicesEx(PySliceObject *r, int length, - int *start, int *stop, int *step, int *slicelength) +_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 */ @@ -702,7 +702,7 @@ _slicedIndexing0(PyArrayObject *self, Py self->nd = _snip( self->nd, self->dimensions, dim); self->nstrides = _snip( self->nstrides, self->strides, dim); } else if (PySlice_Check(slice)) { - int start, stop, step, strided; + Py_ssize_t start, stop, step, strided; if (_GetIndicesEx( (PySliceObject *) slice, self->dimensions[dim], &start, &stop, &step, &strided) < 0) @@ -714,9 +714,9 @@ _slicedIndexing0(PyArrayObject *self, Py Py_INCREF(Py_None); return Py_None; } - self->byteoffset += self->strides[dim] * start; - self->dimensions[dim] = strided; - self->strides[dim] *= step; + self->byteoffset += (maybelong) (self->strides[dim] * start); + self->dimensions[dim] = (maybelong) strided; + self->strides[dim] *= (maybelong) step; ++ dim; } else { Py_DECREF(rest);