From 263df7516f66a53dd9a93f6cd08ce98e30ad0eca Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 14 Feb 2006 22:15:05 +0000 Subject: Make Getptr function and macros return void * --- numpy/core/include/numpy/arrayobject.h | 8 ++++---- numpy/core/src/multiarraymodule.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'numpy') diff --git a/numpy/core/include/numpy/arrayobject.h b/numpy/core/include/numpy/arrayobject.h index 603d38b99..a96fca6d7 100644 --- a/numpy/core/include/numpy/arrayobject.h +++ b/numpy/core/include/numpy/arrayobject.h @@ -1465,19 +1465,19 @@ typedef struct { inline the constants inside a for loop making it a moot point */ -#define PyArray_GETPTR1(obj, i) (PyArray_DATA(obj) + \ +#define PyArray_GETPTR1(obj, i) (void *)(PyArray_BYTES(obj) + \ i*PyArray_STRIDE(obj, 0)) -#define PyArray_GETPTR2(obj, i, j) (PyArray_DATA(obj) + \ +#define PyArray_GETPTR2(obj, i, j) (void *)(PyArray_BYTES(obj) + \ i*PyArray_STRIDE(obj, 0) + \ j*PyArray_STRIDE(obj, 1)) -#define PyArray_GETPTR3(obj, i, j, k) (PyArray_DATA(obj) + \ +#define PyArray_GETPTR3(obj, i, j, k) (void *)(PyArray_BYTES(obj) + \ i*PyArray_STRIDE(obj, 0) + \ j*PyArray_STRIDE(obj, 1) + \ k*PyArray_STRIDE(obj, 2)) \ -#define PyArray_GETPTR4(obj, i, j, k, l) (PyArray_DATA(obj) + \ +#define PyArray_GETPTR4(obj, i, j, k, l) (void *)(PyArray_BYTES(obj) + \ i*PyArray_STRIDE(obj, 0) + \ j*PyArray_STRIDE(obj, 1) + \ k*PyArray_STRIDE(obj, 2) + \ diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 8afdb3855..5776c9fa6 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -93,7 +93,7 @@ PyArray_MultiplyList(register intp *l1, register int n) /*MULTIARRAY_API Produce a pointer into array */ -static char * +static void * PyArray_GetPtr(PyArrayObject *obj, register intp* ind) { register int n = obj->nd; @@ -101,7 +101,7 @@ PyArray_GetPtr(PyArrayObject *obj, register intp* ind) register char *dptr = obj->data; while (n--) dptr += (*strides++) * (*ind++); - return dptr; + return (void *)dptr; } /*MULTIARRAY_API -- cgit v1.2.1