diff options
author | Mark Wiebe <mwwiebe@gmail.com> | 2011-08-24 18:57:01 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:27:01 -0600 |
commit | 094992665c66ec66bb33042bfa1c1dc496e11b5c (patch) | |
tree | b74f450262cb824d68209bc6e5caa053f9065b48 /numpy | |
parent | 3e32ef204af784b57627313754491d2d3ca9370d (diff) | |
download | numpy-094992665c66ec66bb33042bfa1c1dc496e11b5c.tar.gz |
ENH: core: Rename PyArrayObject_fieldaccess to PyArrayObject_fields
Because it's shorter and seems like a decent name.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 72 | ||||
-rw-r--r-- | numpy/core/src/multiarray/arrayobject.c | 8 | ||||
-rw-r--r-- | numpy/core/src/multiarray/arraytypes.c.src | 48 | ||||
-rw-r--r-- | numpy/core/src/multiarray/convert.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/convert_datatype.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 20 | ||||
-rw-r--r-- | numpy/core/src/multiarray/getset.c | 30 | ||||
-rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/iterators.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 6 | ||||
-rw-r--r-- | numpy/core/src/multiarray/methods.c | 12 | ||||
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 12 | ||||
-rw-r--r-- | numpy/core/src/multiarray/na_mask.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_api.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_constr.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_pywrap.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/reduction.c | 12 | ||||
-rw-r--r-- | numpy/core/src/multiarray/sequence.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/shape.c | 24 |
19 files changed, 135 insertions, 135 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index 7bdcdff81..b4046f940 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -619,7 +619,7 @@ typedef struct _arr_descr { * #define NPY_NO_DEPRECATED_API. */ /* This struct will be moved to a private header in a future release */ -typedef struct tagPyArrayObject_fieldaccess { +typedef struct tagPyArrayObject_fields { PyObject_HEAD /* Pointer to the raw data buffer */ char *data; @@ -679,7 +679,7 @@ typedef struct tagPyArrayObject_fieldaccess { * of whether there is an NA mask or not. */ npy_intp *maskna_strides; -} PyArrayObject_fieldaccess; +} PyArrayObject_fields; /* * To hide the implementation details, we only expose @@ -694,10 +694,10 @@ typedef struct tagPyArrayObject { * Can't put this in npy_deprecated_api.h like the others. * PyArrayObject field access is deprecated as of NumPy 1.7. */ -typedef PyArrayObject_fieldaccess PyArrayObject; +typedef PyArrayObject_fields PyArrayObject; #endif -#define NPY_SIZEOF_PYARRAYOBJECT (sizeof(PyArrayObject_fieldaccess)) +#define NPY_SIZEOF_PYARRAYOBJECT (sizeof(PyArrayObject_fields)) /* Array Flags Object */ typedef struct PyArrayFlagsObject { @@ -1436,67 +1436,67 @@ PyArrayNeighborhoodIter_Next2D(PyArrayNeighborhoodIterObject* iter); static NPY_INLINE int PyArray_NDIM(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->nd; + return ((PyArrayObject_fields *)arr)->nd; } static NPY_INLINE char * PyArray_DATA(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->data; + return ((PyArrayObject_fields *)arr)->data; } static NPY_INLINE npy_intp * PyArray_DIMS(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->dimensions; + return ((PyArrayObject_fields *)arr)->dimensions; } static NPY_INLINE npy_intp * PyArray_STRIDES(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->strides; + return ((PyArrayObject_fields *)arr)->strides; } static NPY_INLINE npy_intp PyArray_DIM(PyArrayObject *arr, int idim) { - return ((PyArrayObject_fieldaccess *)arr)->dimensions[idim]; + return ((PyArrayObject_fields *)arr)->dimensions[idim]; } static NPY_INLINE npy_intp PyArray_STRIDE(PyArrayObject *arr, int istride) { - return ((PyArrayObject_fieldaccess *)arr)->strides[istride]; + return ((PyArrayObject_fields *)arr)->strides[istride]; } static NPY_INLINE PyObject * PyArray_BASE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->base; + return ((PyArrayObject_fields *)arr)->base; } static NPY_INLINE PyArray_Descr * PyArray_DESCR(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->descr; + return ((PyArrayObject_fields *)arr)->descr; } static NPY_INLINE int PyArray_FLAGS(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->flags; + return ((PyArrayObject_fields *)arr)->flags; } static NPY_INLINE npy_intp PyArray_ITEMSIZE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->descr->elsize; + return ((PyArrayObject_fields *)arr)->descr->elsize; } static NPY_INLINE int PyArray_TYPE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->descr->type_num; + return ((PyArrayObject_fields *)arr)->descr->type_num; } static NPY_INLINE int @@ -1508,14 +1508,14 @@ PyArray_CHKFLAGS(PyArrayObject *arr, int flags) static NPY_INLINE PyObject * PyArray_GETITEM(PyArrayObject *arr, char *itemptr) { - return ((PyArrayObject_fieldaccess *)arr)->descr->f->getitem( + return ((PyArrayObject_fields *)arr)->descr->f->getitem( itemptr, arr); } static NPY_INLINE int PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) { - return ((PyArrayObject_fieldaccess *)arr)->descr->f->setitem( + return ((PyArrayObject_fields *)arr)->descr->f->setitem( v, itemptr, arr); } @@ -1525,22 +1525,22 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) #else /* These macros are deprecated as of NumPy 1.7. */ -#define PyArray_NDIM(obj) (((PyArrayObject_fieldaccess *)(obj))->nd) -#define PyArray_BYTES(obj) ((char *)(((PyArrayObject_fieldaccess *)(obj))->data)) -#define PyArray_DATA(obj) ((void *)(((PyArrayObject_fieldaccess *)(obj))->data)) -#define PyArray_DIMS(obj) (((PyArrayObject_fieldaccess *)(obj))->dimensions) -#define PyArray_STRIDES(obj) (((PyArrayObject_fieldaccess *)(obj))->strides) +#define PyArray_NDIM(obj) (((PyArrayObject_fields *)(obj))->nd) +#define PyArray_BYTES(obj) ((char *)(((PyArrayObject_fields *)(obj))->data)) +#define PyArray_DATA(obj) ((void *)(((PyArrayObject_fields *)(obj))->data)) +#define PyArray_DIMS(obj) (((PyArrayObject_fields *)(obj))->dimensions) +#define PyArray_STRIDES(obj) (((PyArrayObject_fields *)(obj))->strides) #define PyArray_DIM(obj,n) (PyArray_DIMS(obj)[n]) #define PyArray_STRIDE(obj,n) (PyArray_STRIDES(obj)[n]) -#define PyArray_BASE(obj) (((PyArrayObject_fieldaccess *)(obj))->base) -#define PyArray_DESCR(obj) (((PyArrayObject_fieldaccess *)(obj))->descr) -#define PyArray_FLAGS(obj) (((PyArrayObject_fieldaccess *)(obj))->flags) +#define PyArray_BASE(obj) (((PyArrayObject_fields *)(obj))->base) +#define PyArray_DESCR(obj) (((PyArrayObject_fields *)(obj))->descr) +#define PyArray_FLAGS(obj) (((PyArrayObject_fields *)(obj))->flags) #define PyArray_CHKFLAGS(m, FLAGS) \ - ((((PyArrayObject_fieldaccess *)(m))->flags & (FLAGS)) == (FLAGS)) + ((((PyArrayObject_fields *)(m))->flags & (FLAGS)) == (FLAGS)) #define PyArray_ITEMSIZE(obj) \ - (((PyArrayObject_fieldaccess *)(obj))->descr->elsize) + (((PyArrayObject_fields *)(obj))->descr->elsize) #define PyArray_TYPE(obj) \ - (((PyArrayObject_fieldaccess *)(obj))->descr->type_num) + (((PyArrayObject_fields *)(obj))->descr->type_num) #define PyArray_GETITEM(obj,itemptr) \ PyArray_DESCR(obj)->f->getitem((char *)(itemptr), \ (PyArrayObject *)(obj)) @@ -1554,13 +1554,13 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) static NPY_INLINE PyArray_Descr * PyArray_DTYPE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->descr; + return ((PyArrayObject_fields *)arr)->descr; } static NPY_INLINE npy_intp * PyArray_SHAPE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->dimensions; + return ((PyArrayObject_fields *)arr)->dimensions; } /* @@ -1570,7 +1570,7 @@ PyArray_SHAPE(PyArrayObject *arr) static NPY_INLINE void PyArray_ENABLEFLAGS(PyArrayObject *arr, int flags) { - ((PyArrayObject_fieldaccess *)arr)->flags |= flags; + ((PyArrayObject_fields *)arr)->flags |= flags; } /* @@ -1580,7 +1580,7 @@ PyArray_ENABLEFLAGS(PyArrayObject *arr, int flags) static NPY_INLINE void PyArray_CLEARFLAGS(PyArrayObject *arr, int flags) { - ((PyArrayObject_fieldaccess *)arr)->flags &= ~flags; + ((PyArrayObject_fields *)arr)->flags &= ~flags; } /* Access to the missing values NA mask, added in 1.7 */ @@ -1588,26 +1588,26 @@ PyArray_CLEARFLAGS(PyArrayObject *arr, int flags) static NPY_INLINE PyArray_Descr * PyArray_MASKNA_DTYPE(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->maskna_dtype; + return ((PyArrayObject_fields *)arr)->maskna_dtype; } static NPY_INLINE char * PyArray_MASKNA_DATA(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->maskna_data; + return ((PyArrayObject_fields *)arr)->maskna_data; } /* For the corresponding DIMS, use PyArray_DIMS(arr) */ static NPY_INLINE npy_intp * PyArray_MASKNA_STRIDES(PyArrayObject *arr) { - return ((PyArrayObject_fieldaccess *)arr)->maskna_strides; + return ((PyArrayObject_fields *)arr)->maskna_strides; } static NPY_INLINE npy_bool PyArray_HASMASKNA(PyArrayObject *arr) { - return (((PyArrayObject_fieldaccess *)arr)->flags & NPY_ARRAY_MASKNA) != 0; + return (((PyArrayObject_fields *)arr)->flags & NPY_ARRAY_MASKNA) != 0; } diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index 8c7858a59..90759dc90 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -136,7 +136,7 @@ PyArray_SetBaseObject(PyArrayObject *arr, PyObject *obj) return -1; } - ((PyArrayObject_fieldaccess *)arr)->base = obj; + ((PyArrayObject_fields *)arr)->base = obj; return 0; } @@ -357,7 +357,7 @@ PyArray_TypeNumFromName(char *str) static void array_dealloc(PyArrayObject *self) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)self; + PyArrayObject_fields *fa = (PyArrayObject_fields *)self; _array_dealloc_buffer_info(self); @@ -486,7 +486,7 @@ NPY_NO_EXPORT void PyArray_DebugPrint(PyArrayObject *obj) { int i; - PyArrayObject_fieldaccess *fobj = (PyArrayObject_fieldaccess *)obj; + PyArrayObject_fields *fobj = (PyArrayObject_fields *)obj; printf("-------------------------------------------------------\n"); printf(" Dump of NumPy ndarray at address %p\n", obj); @@ -1673,7 +1673,7 @@ NPY_NO_EXPORT PyTypeObject PyArray_Type = { (traverseproc)0, /* tp_traverse */ (inquiry)0, /* tp_clear */ (richcmpfunc)array_richcompare, /* tp_richcompare */ - offsetof(PyArrayObject_fieldaccess, weakreflist), /* tp_weaklistoffset */ + offsetof(PyArrayObject_fields, weakreflist), /* tp_weaklistoffset */ (getiterfunc)array_iter, /* tp_iter */ (iternextfunc)0, /* tp_iternext */ array_methods, /* tp_methods */ diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index f11318b18..423298afd 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -599,14 +599,14 @@ VOID_getitem(char *ip, PyArrayObject *ap) tup = PyDict_GetItem(descr->fields, key); if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) { Py_DECREF(ret); - ((PyArrayObject_fieldaccess *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->descr = descr; return NULL; } /* * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)ap)->descr = new; + ((PyArrayObject_fields *)ap)->descr = new; /* update alignment based on offset */ if ((new->alignment > 1) && ((((intp)(ip+offset)) % new->alignment) != 0)) { @@ -616,9 +616,9 @@ VOID_getitem(char *ip, PyArrayObject *ap) PyArray_ENABLEFLAGS(ap, NPY_ARRAY_ALIGNED); } PyTuple_SET_ITEM(ret, i, new->f->getitem(ip+offset, ap)); - ((PyArrayObject_fieldaccess *)ap)->flags = savedflags; + ((PyArrayObject_fields *)ap)->flags = savedflags; } - ((PyArrayObject_fieldaccess *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->descr = descr; return ret; } @@ -729,14 +729,14 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap) key = PyTuple_GET_ITEM(names, i); tup = PyDict_GetItem(descr->fields, key); if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) { - ((PyArrayObject_fieldaccess *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->descr = descr; return -1; } /* * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)ap)->descr = new; + ((PyArrayObject_fields *)ap)->descr = new; /* remember to update alignment flags */ if ((new->alignment > 1) && ((((intp)(ip+offset)) % new->alignment) != 0)) { @@ -746,12 +746,12 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap) PyArray_ENABLEFLAGS(ap, NPY_ARRAY_ALIGNED); } res = new->f->setitem(PyTuple_GET_ITEM(op, i), ip+offset, ap); - ((PyArrayObject_fieldaccess *)ap)->flags = savedflags; + ((PyArrayObject_fields *)ap)->flags = savedflags; if (res < 0) { break; } } - ((PyArrayObject_fieldaccess *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->descr = descr; return res; } @@ -1883,19 +1883,19 @@ VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride, continue; } if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } /* * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)arr)->descr = new; + ((PyArrayObject_fields *)arr)->descr = new; new->f->copyswapn(dst+offset, dstride, (src != NULL ? src+offset : NULL), sstride, n, swap, arr); } - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } if (swap && PyArray_DESCR(arr)->subarray != NULL) { @@ -1911,7 +1911,7 @@ VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride, * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)arr)->descr = new; + ((PyArrayObject_fields *)arr)->descr = new; dstptr = dst; srcptr = src; subitemsize = new->elsize; @@ -1924,7 +1924,7 @@ VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride, srcptr += sstride; } } - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } if (src != NULL) { @@ -1951,19 +1951,19 @@ VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) continue; } if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } /* * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)arr)->descr = new; + ((PyArrayObject_fields *)arr)->descr = new; new->f->copyswap(dst+offset, (src != NULL ? src+offset : NULL), swap, arr); } - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } if (swap && PyArray_DESCR(arr)->subarray != NULL) { @@ -1977,12 +1977,12 @@ VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)arr)->descr = new; + ((PyArrayObject_fields *)arr)->descr = new; itemsize = new->elsize; num = descr->elsize / itemsize; new->f->copyswapn(dst, itemsize, src, itemsize, num, swap, arr); - ((PyArrayObject_fieldaccess *)arr)->descr = descr; + ((PyArrayObject_fields *)arr)->descr = descr; return; } if (src != NULL) { @@ -2258,8 +2258,8 @@ VOID_nonzero (char *ip, PyArrayObject *ap) * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)ap)->descr = descr; - ((PyArrayObject_fieldaccess *)ap)->flags = savedflags; + ((PyArrayObject_fields *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->flags = savedflags; if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) { PyArray_CLEARFLAGS(ap, NPY_ARRAY_ALIGNED); } @@ -2271,8 +2271,8 @@ VOID_nonzero (char *ip, PyArrayObject *ap) break; } } - ((PyArrayObject_fieldaccess *)ap)->descr = descr; - ((PyArrayObject_fieldaccess *)ap)->flags = savedflags; + ((PyArrayObject_fields *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->flags = savedflags; return nonz; } len = PyArray_DESCR(ap)->elsize; @@ -2562,7 +2562,7 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap) * TODO: temporarily modifying the array like this * is bad coding style, should be changed. */ - ((PyArrayObject_fieldaccess *)ap)->descr = new; + ((PyArrayObject_fields *)ap)->descr = new; swap = PyArray_ISBYTESWAPPED(ap); nip1 = ip1+offset; nip2 = ip2+offset; @@ -2606,7 +2606,7 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap) } finish: - ((PyArrayObject_fieldaccess *)ap)->descr = descr; + ((PyArrayObject_fields *)ap)->descr = descr; return res; } diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c index f79ffc6a1..e69714088 100644 --- a/numpy/core/src/multiarray/convert.c +++ b/numpy/core/src/multiarray/convert.c @@ -574,7 +574,7 @@ PyArray_View(PyArrayObject *self, PyArray_Descr *type, PyTypeObject *pytype) /* Take a view of the mask if it exists */ if (PyArray_HASMASKNA(self)) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fa = (PyArrayObject_fields *)ret; if (PyArray_HASFIELDS(self)) { PyErr_SetString(PyExc_RuntimeError, diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index 19b01cce9..818d558aa 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -1681,7 +1681,7 @@ PyArray_Zero(PyArrayObject *arr) storeflags = PyArray_FLAGS(arr); PyArray_ENABLEFLAGS(arr, NPY_ARRAY_BEHAVED); ret = PyArray_DESCR(arr)->f->setitem(obj, zeroval, arr); - ((PyArrayObject_fieldaccess *)arr)->flags = storeflags; + ((PyArrayObject_fields *)arr)->flags = storeflags; Py_DECREF(obj); if (ret < 0) { PyDataMem_FREE(zeroval); @@ -1719,7 +1719,7 @@ PyArray_One(PyArrayObject *arr) storeflags = PyArray_FLAGS(arr); PyArray_ENABLEFLAGS(arr, NPY_ARRAY_BEHAVED); ret = PyArray_DESCR(arr)->f->setitem(obj, oneval, arr); - ((PyArrayObject_fieldaccess *)arr)->flags = storeflags; + ((PyArrayObject_fields *)arr)->flags = storeflags; Py_DECREF(obj); if (ret < 0) { PyDataMem_FREE(oneval); diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index bb228d564..c37ce5ad6 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -870,7 +870,7 @@ PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, npy_intp *dims, npy_intp *strides, void *data, int flags, PyObject *obj) { - PyArrayObject_fieldaccess *fa; + PyArrayObject_fields *fa; int i; size_t sd; npy_intp largest; @@ -958,7 +958,7 @@ PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, largest /= dim; } - fa = (PyArrayObject_fieldaccess *) subtype->tp_alloc(subtype, 0); + fa = (PyArrayObject_fields *) subtype->tp_alloc(subtype, 0); if (fa == NULL) { Py_DECREF(descr); return NULL; @@ -1311,7 +1311,7 @@ _array_from_buffer_3118(PyObject *obj, PyObject **out) r = PyArray_NewFromDescr(&PyArray_Type, descr, nd, shape, strides, view->buf, flags, NULL); - ((PyArrayObject_fieldaccess *)r)->base = memoryview; + ((PyArrayObject_fields *)r)->base = memoryview; PyArray_UpdateFlags((PyArrayObject *)r, NPY_ARRAY_UPDATE_ALL); *out = r; @@ -2084,7 +2084,7 @@ PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags) * the chain of bases. */ Py_INCREF(arr); - ((PyArrayObject_fieldaccess *)ret)->base = (PyObject *)arr; + ((PyArrayObject_fields *)ret)->base = (PyObject *)arr; PyArray_ENABLEFLAGS(ret, NPY_ARRAY_UPDATEIFCOPY); PyArray_CLEARFLAGS(arr, NPY_ARRAY_WRITEABLE); } @@ -3328,7 +3328,7 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr Py_DECREF(new); Py_DECREF(PyArray_DESCR(range)); /* steals the reference */ - ((PyArrayObject_fieldaccess *)range)->descr = dtype; + ((PyArrayObject_fields *)range)->descr = dtype; } Py_DECREF(start); Py_DECREF(step); @@ -3453,7 +3453,7 @@ array_from_text(PyArray_Descr *dtype, npy_intp num, char *sep, size_t *nread, err = 1; break; } - ((PyArrayObject_fieldaccess *)r)->data = tmp; + ((PyArrayObject_fields *)r)->data = tmp; dptr = tmp + (totalbytes - bytes); thisbuf = 0; } @@ -3468,7 +3468,7 @@ array_from_text(PyArray_Descr *dtype, npy_intp num, char *sep, size_t *nread, } else { PyArray_DIMS(r)[0] = *nread; - ((PyArrayObject_fieldaccess *)r)->data = tmp; + ((PyArrayObject_fields *)r)->data = tmp; } } NPY_END_ALLOW_THREADS; @@ -3548,7 +3548,7 @@ PyArray_FromFile(FILE *fp, PyArray_Descr *dtype, npy_intp num, char *sep) Py_DECREF(ret); return PyErr_NoMemory(); } - ((PyArrayObject_fieldaccess *)ret)->data = tmp; + ((PyArrayObject_fields *)ret)->data = tmp; PyArray_DIMS(ret)[0] = nread; } return (PyObject *)ret; @@ -3832,7 +3832,7 @@ PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, npy_intp count) Py_DECREF(value); goto done; } - ((PyArrayObject_fieldaccess *)ret)->data = new_data; + ((PyArrayObject_fields *)ret)->data = new_data; } PyArray_DIMS(ret)[0] = i + 1; @@ -3861,7 +3861,7 @@ PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, npy_intp count) PyErr_SetString(PyExc_MemoryError, "cannot allocate array memory"); goto done; } - ((PyArrayObject_fieldaccess *)ret)->data = new_data; + ((PyArrayObject_fields *)ret)->data = new_data; done: Py_XDECREF(iter); diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c index c077eb23f..145e0dbfa 100644 --- a/numpy/core/src/multiarray/getset.c +++ b/numpy/core/src/multiarray/getset.c @@ -61,24 +61,24 @@ array_shape_set(PyArrayObject *self, PyObject *val) /* Free old dimensions and strides */ PyDimMem_FREE(PyArray_DIMS(self)); nd = PyArray_NDIM(ret); - ((PyArrayObject_fieldaccess *)self)->nd = nd; + ((PyArrayObject_fields *)self)->nd = nd; if (nd > 0) { /* create new dimensions and strides */ - ((PyArrayObject_fieldaccess *)self)->dimensions = PyDimMem_NEW(3*nd); + ((PyArrayObject_fields *)self)->dimensions = PyDimMem_NEW(3*nd); if (PyArray_DIMS(self) == NULL) { Py_DECREF(ret); PyErr_SetString(PyExc_MemoryError,""); return -1; } - ((PyArrayObject_fieldaccess *)self)->strides = PyArray_DIMS(self) + nd; - ((PyArrayObject_fieldaccess *)self)->maskna_strides = PyArray_DIMS(self) + 2*nd; + ((PyArrayObject_fields *)self)->strides = PyArray_DIMS(self) + nd; + ((PyArrayObject_fields *)self)->maskna_strides = PyArray_DIMS(self) + 2*nd; memcpy(PyArray_DIMS(self), PyArray_DIMS(ret), nd*sizeof(intp)); memcpy(PyArray_STRIDES(self), PyArray_STRIDES(ret), nd*sizeof(intp)); memcpy(PyArray_MASKNA_STRIDES(self), PyArray_MASKNA_STRIDES(ret), nd*sizeof(intp)); } else { - ((PyArrayObject_fieldaccess *)self)->dimensions = NULL; - ((PyArrayObject_fieldaccess *)self)->strides = NULL; + ((PyArrayObject_fields *)self)->dimensions = NULL; + ((PyArrayObject_fields *)self)->strides = NULL; } Py_DECREF(ret); PyArray_UpdateFlags(self, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS); @@ -343,9 +343,9 @@ array_data_set(PyArrayObject *self, PyObject *op) Py_DECREF(PyArray_BASE(self)); } Py_INCREF(op); - ((PyArrayObject_fieldaccess *)self)->base = op; - ((PyArrayObject_fieldaccess *)self)->data = buf; - ((PyArrayObject_fieldaccess *)self)->flags = NPY_ARRAY_CARRAY; + ((PyArrayObject_fields *)self)->base = op; + ((PyArrayObject_fields *)self)->data = buf; + ((PyArrayObject_fields *)self)->flags = NPY_ARRAY_CARRAY; if (!writeable) { PyArray_CLEARFLAGS(self, ~NPY_ARRAY_WRITEABLE); } @@ -500,18 +500,18 @@ array_descr_set(PyArrayObject *self, PyObject *arg) return -1; } PyDimMem_FREE(PyArray_DIMS(self)); - ((PyArrayObject_fieldaccess *)self)->dimensions = PyArray_DIMS(temp); - ((PyArrayObject_fieldaccess *)self)->nd = PyArray_NDIM(temp); - ((PyArrayObject_fieldaccess *)self)->strides = PyArray_STRIDES(temp); + ((PyArrayObject_fields *)self)->dimensions = PyArray_DIMS(temp); + ((PyArrayObject_fields *)self)->nd = PyArray_NDIM(temp); + ((PyArrayObject_fields *)self)->strides = PyArray_STRIDES(temp); newtype = PyArray_DESCR(temp); Py_INCREF(PyArray_DESCR(temp)); /* Fool deallocator not to delete these*/ - ((PyArrayObject_fieldaccess *)temp)->nd = 0; - ((PyArrayObject_fieldaccess *)temp)->dimensions = NULL; + ((PyArrayObject_fields *)temp)->nd = 0; + ((PyArrayObject_fields *)temp)->dimensions = NULL; Py_DECREF(temp); } - ((PyArrayObject_fieldaccess *)self)->descr = newtype; + ((PyArrayObject_fields *)self)->descr = newtype; PyArray_UpdateFlags(self, NPY_ARRAY_UPDATE_ALL); return 0; diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 663567014..5d8b99489 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -1781,7 +1781,7 @@ PyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2) /* Take a view of the mask if it exists */ if (self_has_maskna) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; npy_intp *maskna_strides = PyArray_MASKNA_STRIDES(self); fret->maskna_dtype = PyArray_MASKNA_DTYPE(self); @@ -2264,7 +2264,7 @@ finish: /* Create views into ret, one for each dimension */ if (ndim == 1) { /* Directly switch to one dimensions (dimension 1 is 1 anyway) */ - ((PyArrayObject_fieldaccess *)ret)->nd = 1; + ((PyArrayObject_fields *)ret)->nd = 1; PyTuple_SET_ITEM(ret_tuple, 0, (PyObject *)ret); } else { diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c index f59cdb7d1..e13173fa7 100644 --- a/numpy/core/src/multiarray/iterators.c +++ b/numpy/core/src/multiarray/iterators.c @@ -1260,7 +1260,7 @@ iter_array(PyArrayIterObject *it, PyObject *NPY_UNUSED(op)) * the chain of bases. */ Py_INCREF(it->ao); - ((PyArrayObject_fieldaccess *)ret)->base = (PyObject *)it->ao; + ((PyArrayObject_fields *)ret)->base = (PyObject *)it->ao; PyArray_ENABLEFLAGS(ret, NPY_ARRAY_UPDATEIFCOPY); PyArray_CLEARFLAGS(it->ao, NPY_ARRAY_WRITEABLE); } @@ -1912,7 +1912,7 @@ static char* _set_constant(PyArrayNeighborhoodIterObject* iter, storeflags = PyArray_FLAGS(ar->ao); PyArray_ENABLEFLAGS(ar->ao, NPY_ARRAY_BEHAVED); st = PyArray_DESCR(ar->ao)->f->setitem((PyObject*)fill, ret, ar->ao); - ((PyArrayObject_fieldaccess *)ar->ao)->flags = storeflags; + ((PyArrayObject_fields *)ar->ao)->flags = storeflags; if (st < 0) { PyDataMem_FREE(ret); diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 92c0429aa..258123e93 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -82,7 +82,7 @@ array_big_item(PyArrayObject *self, npy_intp i) /* Take a view of the NA mask if it exists */ if (PyArray_HASMASKNA(self)) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fa = (PyArrayObject_fields *)ret; fa->maskna_dtype = PyArray_MASKNA_DTYPE(self); Py_INCREF(fa->maskna_dtype); @@ -492,7 +492,7 @@ add_new_axes_0d(PyArrayObject *arr, int newaxis_count) /* Take a view of the NA mask if it exists */ if (PyArray_HASMASKNA(arr)) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; fret->maskna_dtype = PyArray_MASKNA_DTYPE(arr); Py_INCREF(fret->maskna_dtype); @@ -679,7 +679,7 @@ array_subscript_simple(PyArrayObject *self, PyObject *op) /* Take a view of the NA mask if it exists */ if (PyArray_HASMASKNA(self)) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; fret->maskna_dtype = PyArray_MASKNA_DTYPE(self); Py_INCREF(fret->maskna_dtype); diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index 6af1ca984..b99425969 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -1268,13 +1268,13 @@ array_sort(PyArrayObject *self, PyObject *args, PyObject *kwds) } newd = PyArray_DescrNew(saved); newd->names = new_name; - ((PyArrayObject_fieldaccess *)self)->descr = newd; + ((PyArrayObject_fields *)self)->descr = newd; } val = PyArray_Sort(self, axis, sortkind); if (order != NULL) { Py_XDECREF(PyArray_DESCR(self)); - ((PyArrayObject_fieldaccess *)self)->descr = saved; + ((PyArrayObject_fields *)self)->descr = saved; } if (val < 0) { return NULL; @@ -1322,13 +1322,13 @@ array_argsort(PyArrayObject *self, PyObject *args, PyObject *kwds) } newd = PyArray_DescrNew(saved); newd->names = new_name; - ((PyArrayObject_fieldaccess *)self)->descr = newd; + ((PyArrayObject_fields *)self)->descr = newd; } res = PyArray_ArgSort(self, axis, sortkind); if (order != NULL) { Py_XDECREF(PyArray_DESCR(self)); - ((PyArrayObject_fieldaccess *)self)->descr = saved; + ((PyArrayObject_fields *)self)->descr = saved; } return PyArray_Return((PyArrayObject *)res); } @@ -1570,7 +1570,7 @@ array_setstate(PyArrayObject *self, PyObject *args) npy_intp size, dimensions[MAX_DIMS]; int nd; - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)self; + PyArrayObject_fields *fa = (PyArrayObject_fields *)self; /* This will free any memory associated with a and use the string in setstate as the (writeable) memory. @@ -2202,7 +2202,7 @@ array_setflags(PyArrayObject *self, PyObject *args, PyObject *kwds) PyObject *uic = Py_None; int flagback = PyArray_FLAGS(self); - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)self; + PyArrayObject_fields *fa = (PyArrayObject_fields *)self; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOO", kwlist, &write, diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index dc3d9cfeb..e269319a8 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -319,7 +319,7 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis) int strideperm[NPY_MAXDIMS]; PyArray_Descr *dtype = NULL; PyArrayObject *ret = NULL; - PyArrayObject_fieldaccess *sliding_view = NULL; + PyArrayObject_fields *sliding_view = NULL; int has_maskna; if (narrays <= 0) { @@ -438,7 +438,7 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis) * Create a view which slides through ret for assigning the * successive input arrays. */ - sliding_view = (PyArrayObject_fieldaccess *)PyArray_View(ret, + sliding_view = (PyArrayObject_fields *)PyArray_View(ret, NULL, &PyArray_Type); if (sliding_view == NULL) { Py_DECREF(ret); @@ -482,7 +482,7 @@ PyArray_ConcatenateFlattenedArrays(int narrays, PyArrayObject **arrays, npy_intp shape[2], strides[2]; PyArray_Descr *dtype = NULL; PyArrayObject *ret = NULL; - PyArrayObject_fieldaccess *sliding_view = NULL; + PyArrayObject_fields *sliding_view = NULL; int has_maskna; if (narrays <= 0) { @@ -557,7 +557,7 @@ PyArray_ConcatenateFlattenedArrays(int narrays, PyArrayObject **arrays, * Create a view which slides through ret for assigning the * successive input arrays. */ - sliding_view = (PyArrayObject_fieldaccess *)PyArray_View(ret, + sliding_view = (PyArrayObject_fields *)PyArray_View(ret, NULL, &PyArray_Type); if (sliding_view == NULL) { Py_DECREF(ret); @@ -1574,7 +1574,7 @@ _prepend_ones(PyArrayObject *arr, int nd, int ndmin) /* Take a view of the NA mask as well if necessary */ if (PyArray_HASMASKNA(arr)) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; fret->maskna_dtype = PyArray_MASKNA_DTYPE(arr); Py_INCREF(fret->maskna_dtype); @@ -1714,7 +1714,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) } Py_INCREF(oldtype); Py_DECREF(PyArray_DESCR(ret)); - ((PyArrayObject_fieldaccess *)ret)->descr = oldtype; + ((PyArrayObject_fields *)ret)->descr = oldtype; goto finish; } } diff --git a/numpy/core/src/multiarray/na_mask.c b/numpy/core/src/multiarray/na_mask.c index fedafb4f3..ce3fe3863 100644 --- a/numpy/core/src/multiarray/na_mask.c +++ b/numpy/core/src/multiarray/na_mask.c @@ -329,7 +329,7 @@ PyArray_AllocateMaskNA(PyArrayObject *arr, npy_bool multina, npy_mask defaultmask) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)arr; + PyArrayObject_fields *fa = (PyArrayObject_fields *)arr; PyArray_Descr *maskna_dtype = NULL; char *maskna_data = NULL; npy_intp size; diff --git a/numpy/core/src/multiarray/nditer_api.c b/numpy/core/src/multiarray/nditer_api.c index ec2d81db0..fd5d4d74e 100644 --- a/numpy/core/src/multiarray/nditer_api.c +++ b/numpy/core/src/multiarray/nditer_api.c @@ -1162,7 +1162,7 @@ NpyIter_GetIterView(NpyIter *iter, npy_intp i) * Add the mask to the view if the operand was NPY_ITER_USE_MASKNA. */ if (maskna_indices[i] >= 0) { - PyArrayObject_fieldaccess *fview = (PyArrayObject_fieldaccess *)view; + PyArrayObject_fields *fview = (PyArrayObject_fields *)view; int i_maskna = maskna_indices[i]; npy_intp *maskna_strides = fview->maskna_strides; diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c index e16738f7e..2754b2098 100644 --- a/numpy/core/src/multiarray/nditer_constr.c +++ b/numpy/core/src/multiarray/nditer_constr.c @@ -3030,7 +3030,7 @@ npyiter_allocate_arrays(NpyIter *iter, * the chain of bases. */ Py_INCREF(op[iop]); - ((PyArrayObject_fieldaccess *)temp)->base = + ((PyArrayObject_fields *)temp)->base = (PyObject *)op[iop]; PyArray_ENABLEFLAGS(temp, NPY_ARRAY_UPDATEIFCOPY); PyArray_CLEARFLAGS(op[iop], NPY_ARRAY_WRITEABLE); diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c index 2929ef2fc..2e86e4753 100644 --- a/numpy/core/src/multiarray/nditer_pywrap.c +++ b/numpy/core/src/multiarray/nditer_pywrap.c @@ -2057,7 +2057,7 @@ npyiter_seq_item(NewNpyArrayIterObject *self, Py_ssize_t i) /* If this is a USE_MASKNA operand, include the mask */ if (maskna_indices[i] >= 0) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; int i_maskna = maskna_indices[i]; fret->maskna_dtype = NpyIter_GetDescrArray(self->iter)[i_maskna]; @@ -2210,7 +2210,7 @@ npyiter_seq_ass_item(NewNpyArrayIterObject *self, Py_ssize_t i, PyObject *v) } /* If this is a USE_MASKNA operand, include the mask */ if (maskna_indices[i] >= 0) { - PyArrayObject_fieldaccess *ftmp = (PyArrayObject_fieldaccess *)tmp; + PyArrayObject_fields *ftmp = (PyArrayObject_fields *)tmp; int i_maskna = maskna_indices[i]; ftmp->maskna_dtype = NpyIter_GetDescrArray(self->iter)[i_maskna]; diff --git a/numpy/core/src/multiarray/reduction.c b/numpy/core/src/multiarray/reduction.c index 94ca111a9..d8978ad3b 100644 --- a/numpy/core/src/multiarray/reduction.c +++ b/numpy/core/src/multiarray/reduction.c @@ -88,7 +88,7 @@ conform_reduce_result(int ndim, npy_bool *axis_flags, npy_intp *shape_out = PyArray_DIMS(out); int idim, idim_out, ndim_out = PyArray_NDIM(out); PyArray_Descr *dtype; - PyArrayObject_fieldaccess *ret; + PyArrayObject_fields *ret; /* * If the 'keepdims' parameter is true, do a simpler validation and @@ -149,7 +149,7 @@ conform_reduce_result(int ndim, npy_bool *axis_flags, /* Allocate the view */ dtype = PyArray_DESCR(out); Py_INCREF(dtype); - ret = (PyArrayObject_fieldaccess *)PyArray_NewFromDescr(&PyArray_Type, + ret = (PyArrayObject_fields *)PyArray_NewFromDescr(&PyArray_Type, dtype, ndim, shape, strides, @@ -650,8 +650,8 @@ PyArray_InitializeReduceResult( * non-skipna case. */ shape[0] = shape0; - ((PyArrayObject_fieldaccess *)op_view)->data = data; - ((PyArrayObject_fieldaccess *)op_view)->maskna_data = maskna_data; + ((PyArrayObject_fields *)op_view)->data = data; + ((PyArrayObject_fields *)op_view)->maskna_data = maskna_data; } /* * Here 'skipna' is True and 'operand' has an NA mask, but @@ -701,14 +701,14 @@ PyArray_InitializeReduceResult( for (idim = 0; idim < ndim; ++idim) { if (axis_flags[idim]) { shape[idim] = shape_orig[idim] - 1; - ((PyArrayObject_fieldaccess *)op_view)->data += strides[idim]; + ((PyArrayObject_fields *)op_view)->data += strides[idim]; } } if (PyArray_HASMASKNA(op_view)) { strides = PyArray_MASKNA_STRIDES(op_view); for (idim = 0; idim < ndim; ++idim) { if (axis_flags[idim]) { - ((PyArrayObject_fieldaccess *)op_view)->maskna_data += + ((PyArrayObject_fields *)op_view)->maskna_data += strides[idim]; } } diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c index 055b5db3e..2d1437df2 100644 --- a/numpy/core/src/multiarray/sequence.c +++ b/numpy/core/src/multiarray/sequence.c @@ -86,7 +86,7 @@ array_slice(PyArrayObject *self, Py_ssize_t ilow, Py_ssize_t ihigh) /* Also take a view of the NA mask if it exists */ if (PyArray_HASMASKNA(self)) { - PyArrayObject_fieldaccess *fret = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fret = (PyArrayObject_fields *)ret; fret->maskna_dtype = PyArray_MASKNA_DTYPE(self); Py_INCREF(fret->maskna_dtype); diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c index 8cc338aa3..a0cf5a6aa 100644 --- a/numpy/core/src/multiarray/shape.c +++ b/numpy/core/src/multiarray/shape.c @@ -97,7 +97,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, } if ((refcnt > 2) || (PyArray_BASE(self) != NULL) - || (((PyArrayObject_fieldaccess *)self)->weakreflist != NULL)) { + || (((PyArrayObject_fields *)self)->weakreflist != NULL)) { PyErr_SetString(PyExc_ValueError, "cannot resize an array references or is referenced\n"\ "by another array in this way. Use the resize function"); @@ -117,7 +117,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, "cannot allocate memory for array"); return NULL; } - ((PyArrayObject_fieldaccess *)self)->data = new_data; + ((PyArrayObject_fields *)self)->data = new_data; } if ((newsize > oldsize) && PyArray_ISWRITEABLE(self)) { @@ -141,7 +141,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, if (PyArray_NDIM(self) != new_nd) { /* Different number of dimensions. */ - ((PyArrayObject_fieldaccess *)self)->nd = new_nd; + ((PyArrayObject_fields *)self)->nd = new_nd; /* Need new dimensions and strides arrays */ dimptr = PyDimMem_RENEW(PyArray_DIMS(self), 3*new_nd); if (dimptr == NULL) { @@ -149,15 +149,15 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck, "cannot allocate memory for array"); return NULL; } - ((PyArrayObject_fieldaccess *)self)->dimensions = dimptr; - ((PyArrayObject_fieldaccess *)self)->strides = dimptr + new_nd; - ((PyArrayObject_fieldaccess *)self)->maskna_strides = dimptr + 2*new_nd; + ((PyArrayObject_fields *)self)->dimensions = dimptr; + ((PyArrayObject_fields *)self)->strides = dimptr + new_nd; + ((PyArrayObject_fields *)self)->maskna_strides = dimptr + 2*new_nd; } /* make new_strides variable */ sd = (size_t) PyArray_DESCR(self)->elsize; sd = (size_t) _array_fill_strides(new_strides, new_dimensions, new_nd, sd, - PyArray_FLAGS(self), &(((PyArrayObject_fieldaccess *)self)->flags)); + PyArray_FLAGS(self), &(((PyArrayObject_fields *)self)->flags)); memmove(PyArray_DIMS(self), new_dimensions, new_nd*sizeof(npy_intp)); memmove(PyArray_STRIDES(self), new_strides, new_nd*sizeof(npy_intp)); Py_INCREF(Py_None); @@ -327,7 +327,7 @@ PyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims, /* If there's an NA mask, make sure to view it too */ if (PyArray_HASMASKNA(self)) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fa = (PyArrayObject_fields *)ret; fa->maskna_dtype = PyArray_MASKNA_DTYPE(self); Py_INCREF(fa->maskna_dtype); fa->maskna_data = PyArray_MASKNA_DATA(self); @@ -894,7 +894,7 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute) /* Take a view of the NA mask as well if necessary */ if (flags & NPY_ARRAY_MASKNA) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fa = (PyArrayObject_fields *)ret; fa->maskna_dtype = PyArray_MASKNA_DTYPE(ap); Py_INCREF(fa->maskna_dtype); @@ -1143,8 +1143,8 @@ PyArray_Ravel(PyArrayObject *arr, NPY_ORDER order) /* Take a view of the NA mask as well if necessary */ if (PyArray_HASMASKNA(arr)) { - PyArrayObject_fieldaccess *fa = - (PyArrayObject_fieldaccess *)ret; + PyArrayObject_fields *fa = + (PyArrayObject_fields *)ret; fa->maskna_dtype = PyArray_MASKNA_DTYPE(arr); Py_INCREF(fa->maskna_dtype); @@ -1283,7 +1283,7 @@ build_shape_string(npy_intp n, npy_intp *vals) NPY_NO_EXPORT void PyArray_RemoveAxesInPlace(PyArrayObject *arr, npy_bool *flags) { - PyArrayObject_fieldaccess *fa = (PyArrayObject_fieldaccess *)arr; + PyArrayObject_fields *fa = (PyArrayObject_fields *)arr; npy_intp *shape = fa->dimensions, *strides = fa->strides; int idim, ndim = fa->nd, idim_out = 0; |