summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic <nouiz@nouiz.org>2012-11-06 14:18:12 -0500
committerCharles Harris <charlesr.harris@gmail.com>2012-11-06 19:02:05 -0700
commitcf0f98595cf2e0c69b5432d54bd6ceef57540c67 (patch)
tree09fcb596ae6a8e708795eaffc794cc71ee6e0bb7
parent93be7c0ca93735faac3c9b03b6844a4f9ed90d71 (diff)
downloadnumpy-cf0f98595cf2e0c69b5432d54bd6ceef57540c67.tar.gz
BUG: Remove pointer cast from the PyArray_BYTES macro.
This fixes a compilation problem encountered with numpy 1.7 when the PyArray_BYTES macro was used as an lvalue in Theano. The macro worked as an lvalue in 1.6 and in 1.7 only the struct name was changed, which makes the problem a bit of a mystery, but Theano compiles with this fix.
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index f7898753b..9c14005a2 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -1477,7 +1477,7 @@ 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) ((char *)(((PyArrayObject_fields *)(obj))->data))
+#define PyArray_BYTES(obj) ((((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)