diff options
author | Michael Droettboom <mdboom@gmail.com> | 2011-07-27 12:44:30 -0400 |
---|---|---|
committer | Michael Droettboom <mdboom@gmail.com> | 2011-07-27 12:44:30 -0400 |
commit | 7b34e36c374376f537c8c27d59a9c6c15ba12de3 (patch) | |
tree | ec711874815eee65c19cb97892c5ced7e3b5f8dd | |
parent | 9163993794f1bc56c279ab3d90796370d6b579c4 (diff) | |
download | numpy-7b34e36c374376f537c8c27d59a9c6c15ba12de3.tar.gz |
In the old API, PyArray_DATA and PyArray_BYTES differ in that DATA returns a (void *) and BYTES returns a (char *).
matplotlib builds were failing because PyArray_BYTES was returning a (void *).
-rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index af705b936..94c45df88 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -1377,10 +1377,14 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) arr); } +/* Same as PyArray_DATA */ +#define PyArray_BYTES(arr) PyArray_DATA(arr) + #else /* 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) @@ -1405,9 +1409,6 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) (PyArrayObject *)(obj)) #endif -/* Same as PyArray_DATA */ -#define PyArray_BYTES(arr) PyArray_DATA(arr) - /* * Enables the specified array flags. Does no checking, * assumes you know what you're doing. |