summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-02-14 22:15:05 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-02-14 22:15:05 +0000
commit263df7516f66a53dd9a93f6cd08ce98e30ad0eca (patch)
tree6f709f00e6fa5573cfa897be3e826ddbea5b3777 /numpy
parent3faeb7eb7d496991eaa55996c6a9ada2248a2b29 (diff)
downloadnumpy-263df7516f66a53dd9a93f6cd08ce98e30ad0eca.tar.gz
Make Getptr function and macros return void *
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/include/numpy/arrayobject.h8
-rw-r--r--numpy/core/src/multiarraymodule.c4
2 files changed, 6 insertions, 6 deletions
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