diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2012-11-06 18:33:32 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-11-06 19:02:43 -0700 |
commit | e614443709ab49e4a5f2533b038e650f564d3d07 (patch) | |
tree | 1548b3878827b10c24f56c0c7e3e0b45db165262 | |
parent | cf0f98595cf2e0c69b5432d54bd6ceef57540c67 (diff) | |
download | numpy-e614443709ab49e4a5f2533b038e650f564d3d07.tar.gz |
BUG: Remove pointer cast from the PyArray_DATA macro.
This lets PyArray_DATA be used as an lvalue as some compilers raised an
error with the previous version. The type is now determined by the type of
the struct member and is char*. PyArray_BYTES had the same problem when
used as an lvalue in Theano and the same fix is used here. This problem
needs a bigger fix at some point as the function equivalent of the macro
does not return an lvalue.
-rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index 9c14005a2..c84eb6277 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -1477,8 +1477,8 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) /* These macros are deprecated as of NumPy 1.7. */ #define PyArray_NDIM(obj) (((PyArrayObject_fields *)(obj))->nd) -#define PyArray_BYTES(obj) ((((PyArrayObject_fields *)(obj))->data)) -#define PyArray_DATA(obj) ((void *)(((PyArrayObject_fields *)(obj))->data)) +#define PyArray_BYTES(obj) (((PyArrayObject_fields *)(obj))->data) +#define PyArray_DATA(obj) (((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]) |