diff options
-rw-r--r-- | numpy/core/src/multiarray/common.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/getset.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 16 | ||||
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 8 | ||||
-rw-r--r-- | numpy/core/src/multiarray/methods.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/multiarray_tests.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 6 | ||||
-rw-r--r-- | numpy/core/src/multiarray/shape.c | 4 |
9 files changed, 25 insertions, 25 deletions
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c index 0bf7c7b5e..09b452f45 100644 --- a/numpy/core/src/multiarray/common.c +++ b/numpy/core/src/multiarray/common.c @@ -583,7 +583,7 @@ index2ptr(PyArrayObject *mp, npy_intp i) if (i == 0) { return PyArray_DATA(mp); } - return PyArray_DATA(mp)+i*PyArray_STRIDES(mp)[0]; + return PyArray_BYTES(mp)+i*PyArray_STRIDES(mp)[0]; } NPY_NO_EXPORT int diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index ef6c40b46..980d73a32 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -443,7 +443,7 @@ setArrayFromSequence(PyArrayObject *a, PyObject *s, } else { res = PyArray_DESCR(a)->f->setitem(o, - (PyArray_DATA(a) + offset), a); + (PyArray_BYTES(a) + offset), a); } if (res < 0) { Py_DECREF(o); @@ -465,7 +465,7 @@ setArrayFromSequence(PyArrayObject *a, PyObject *s, } else { res = PyArray_DESCR(a)->f->setitem(o, - (PyArray_DATA(a) + offset), a); + (PyArray_BYTES(a) + offset), a); } Py_DECREF(o); if (res < 0) { diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c index 7106e7a13..95830a625 100644 --- a/numpy/core/src/multiarray/getset.c +++ b/numpy/core/src/multiarray/getset.c @@ -138,7 +138,7 @@ array_strides_set(PyArrayObject *self, PyObject *obj) PyErr_Clear(); numbytes = PyArray_MultiplyList(PyArray_DIMS(new), PyArray_NDIM(new))*PyArray_DESCR(new)->elsize; - offset = PyArray_DATA(self) - PyArray_DATA(new); + offset = PyArray_BYTES(self) - PyArray_BYTES(new); } if (!PyArray_CheckStrides(PyArray_DESCR(self)->elsize, PyArray_NDIM(self), numbytes, @@ -666,7 +666,7 @@ _get_part(PyArrayObject *self, int imag) PyArray_NDIM(self), PyArray_DIMS(self), PyArray_STRIDES(self), - PyArray_DATA(self) + offset, + PyArray_BYTES(self) + offset, PyArray_FLAGS(self), (PyObject *)self); if (ret == NULL) { return NULL; diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 3b66ad66a..ab8480857 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -252,7 +252,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, switch(clipmode) { case NPY_RAISE: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk*(i % nv); + src = PyArray_BYTES(values) + chunk*(i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (check_and_adjust_index(&tmp, max_item, 0) < 0) { goto fail; @@ -264,7 +264,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, break; case NPY_WRAP: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (tmp < 0) { while (tmp < 0) { @@ -283,7 +283,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, break; case NPY_CLIP: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (tmp < 0) { tmp = 0; @@ -302,7 +302,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, switch(clipmode) { case NPY_RAISE: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (check_and_adjust_index(&tmp, max_item, 0) < 0) { goto fail; @@ -312,7 +312,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, break; case NPY_WRAP: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (tmp < 0) { while (tmp < 0) { @@ -329,7 +329,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, break; case NPY_CLIP: for (i = 0; i < ni; i++) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); tmp = ((npy_intp *)(PyArray_DATA(indices)))[i]; if (tmp < 0) { tmp = 0; @@ -428,7 +428,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0) for (i = 0; i < ni; i++) { tmp = ((npy_bool *)(PyArray_DATA(mask)))[i]; if (tmp) { - src = PyArray_DATA(values) + chunk * (i % nv); + src = PyArray_BYTES(values) + chunk * (i % nv); PyArray_Item_INCREF(src, PyArray_DESCR(self)); PyArray_Item_XDECREF(dest+i*chunk, PyArray_DESCR(self)); memmove(dest + i * chunk, src, chunk); @@ -441,7 +441,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0) for (i = 0; i < ni; i++) { tmp = ((npy_bool *)(PyArray_DATA(mask)))[i]; if (tmp) { - src = PyArray_DATA(values) + chunk*(i % nv); + src = PyArray_BYTES(values) + chunk*(i % nv); memmove(dest + i*chunk, src, chunk); } } diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 31446ca41..7a512ba9d 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -60,7 +60,7 @@ array_big_item(PyArrayObject *self, npy_intp i) if (check_and_adjust_index(&i, dim0, 0) < 0) { return NULL; } - item = PyArray_DATA(self) + i * PyArray_STRIDE(self, 0); + item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0); /* Create the view array */ Py_INCREF(PyArray_DESCR(self)); @@ -108,7 +108,7 @@ array_item_nice(PyArrayObject *self, Py_ssize_t _i) if (check_and_adjust_index(&i, dim0, 0) < 0) { return NULL; } - item = PyArray_DATA(self) + i * PyArray_STRIDE(self, 0); + item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0); return PyArray_Scalar(item, PyArray_DESCR(self), (PyObject *)self); } @@ -159,7 +159,7 @@ array_ass_big_item(PyArrayObject *self, npy_intp i, PyObject *v) if (check_and_adjust_index(&i, dim0, 0) < 0) { return -1; } - item = PyArray_DATA(self) + i * PyArray_STRIDE(self, 0); + item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0); return PyArray_DESCR(self)->f->setitem(v, item, self); } @@ -593,7 +593,7 @@ array_subscript_simple(PyArrayObject *self, PyObject *op) ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(self), PyArray_DESCR(self), nd, dimensions, - strides, PyArray_DATA(self) + offset, + strides, PyArray_BYTES(self) + offset, PyArray_FLAGS(self), (PyObject *)self); if (ret == NULL) { diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index 79e9fe0a6..7f0e3861b 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -372,7 +372,7 @@ PyArray_GetField(PyArrayObject *self, PyArray_Descr *typed, int offset) typed, PyArray_NDIM(self), PyArray_DIMS(self), PyArray_STRIDES(self), - PyArray_DATA(self) + offset, + PyArray_BYTES(self) + offset, PyArray_FLAGS(self)&(~NPY_ARRAY_F_CONTIGUOUS), (PyObject *)self); if (ret == NULL) { @@ -427,7 +427,7 @@ PyArray_SetField(PyArrayObject *self, PyArray_Descr *dtype, } ret = PyArray_NewFromDescr(Py_TYPE(self), dtype, PyArray_NDIM(self), PyArray_DIMS(self), - PyArray_STRIDES(self), PyArray_DATA(self) + offset, + PyArray_STRIDES(self), PyArray_BYTES(self) + offset, PyArray_FLAGS(self), (PyObject *)self); if (ret == NULL) { return -1; diff --git a/numpy/core/src/multiarray/multiarray_tests.c.src b/numpy/core/src/multiarray/multiarray_tests.c.src index 954097e28..4aa179b68 100644 --- a/numpy/core/src/multiarray/multiarray_tests.c.src +++ b/numpy/core/src/multiarray/multiarray_tests.c.src @@ -82,7 +82,7 @@ static int copy_object(PyArrayIterObject *itx, PyArrayNeighborhoodIterObject *ni } for (j = 0; j < niterx->size; ++j) { - copyswap(PyArray_DATA(aout) + j * itemsize, niterx->dataptr, 0, NULL); + copyswap(PyArray_BYTES(aout) + j * itemsize, niterx->dataptr, 0, NULL); PyArrayNeighborhoodIter_Next(niterx); } diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index 757f9ea3b..72923d5af 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -208,7 +208,7 @@ PyArray_AsCArray(PyObject **op, void *ptr, npy_intp *dims, int nd, goto fail; } for (i = 0; i < n; i++) { - ptr2[i] = PyArray_DATA(ap) + i*PyArray_STRIDES(ap)[0]; + ptr2[i] = PyArray_BYTES(ap) + i*PyArray_STRIDES(ap)[0]; } *((char ***)ptr) = ptr2; break; @@ -222,7 +222,7 @@ PyArray_AsCArray(PyObject **op, void *ptr, npy_intp *dims, int nd, for (i = 0; i < n; i++) { ptr3[i] = ptr3[n + (m-1)*i]; for (j = 0; j < m; j++) { - ptr3[i][j] = PyArray_DATA(ap) + i*PyArray_STRIDES(ap)[0] + j*PyArray_STRIDES(ap)[1]; + ptr3[i][j] = PyArray_BYTES(ap) + i*PyArray_STRIDES(ap)[0] + j*PyArray_STRIDES(ap)[1]; } } *((char ****)ptr) = ptr3; @@ -1172,7 +1172,7 @@ _pyarray_correlate(PyArrayObject *ap1, PyArrayObject *ap2, int typenum, op = PyArray_DATA(ret); os = PyArray_DESCR(ret)->elsize; ip1 = PyArray_DATA(ap1); - ip2 = PyArray_DATA(ap2) + n_left*is2; + ip2 = PyArray_BYTES(ap2) + n_left*is2; n = n - n_left; for (i = 0; i < n_left; i++) { dot(ip1, is1, ip2, is2, op, n, ret); diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c index 5c82f7309..97ddb2e61 100644 --- a/numpy/core/src/multiarray/shape.c +++ b/numpy/core/src/multiarray/shape.c @@ -120,7 +120,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, if (PyDataType_FLAGCHK(PyArray_DESCR(self), NPY_ITEM_REFCOUNT)) { PyObject *zero = PyInt_FromLong(0); char *optr; - optr = PyArray_DATA(self) + oldsize*elsize; + optr = PyArray_BYTES(self) + oldsize*elsize; n = newsize - oldsize; for (k = 0; k < n; k++) { _putzero((char *)optr, zero, PyArray_DESCR(self)); @@ -129,7 +129,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, Py_DECREF(zero); } else{ - memset(PyArray_DATA(self)+oldsize*elsize, 0, (newsize-oldsize)*elsize); + memset(PyArray_BYTES(self)+oldsize*elsize, 0, (newsize-oldsize)*elsize); } } |