Feb. 1, 2006
11:57 p.m.
David M. Cooke wrote:
Ok, how about this? Change the definition of PyArray_DATA to
#define PyArray_DATA(obj) ((void *)(((PyArrayObject *)(obj))->data))
(i.e., throw in an explicit void * cast). If you're assigning to a char *, this will still work for bytes. If you're dereferencing it, the compiler should throw an error. Also, introduce
#define PyArray_BYTES(obj) (((PyArrayObject *)(obj))->data)
when you actually want the byte-based version.
Sounds great. -Travis