[SciPy-dev] Changing return types in C API

Travis Oliphant oliphant at ee.byu.edu
Wed Feb 1 17:57:08 CST 2006


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





More information about the Scipy-dev mailing list