Skip to content

Fix PyArray_BYTES return type. #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions numpy/core/include/numpy/ndarraytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down