diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-02-07 06:34:11 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-02-07 06:34:11 +0000 |
commit | 79f73f394f16f03e335e215383abf03e93a88794 (patch) | |
tree | ed83647f73a21a544ccd4111edd0a435f83b310d /numpy | |
parent | 810f8fa8ede914c69619bf888322fde161516fd4 (diff) | |
download | numpy-79f73f394f16f03e335e215383abf03e93a88794.tar.gz |
Remove void * arithmetic
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/include/numpy/arrayobject.h | 2 | ||||
-rw-r--r-- | numpy/core/include/numpy/ufuncobject.h | 14 | ||||
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 6 | ||||
-rw-r--r-- | numpy/core/src/ufuncobject.c | 10 |
5 files changed, 17 insertions, 17 deletions
diff --git a/numpy/core/include/numpy/arrayobject.h b/numpy/core/include/numpy/arrayobject.h index 30a804807..74fb5f4c1 100644 --- a/numpy/core/include/numpy/arrayobject.h +++ b/numpy/core/include/numpy/arrayobject.h @@ -216,7 +216,7 @@ typedef enum { PyArray_QUICKSORT=0, PyArray_HEAPSORT=1, PyArray_MERGESORT=2, - PyArray_TIMSORT=3, /* the sort Python uses -- specialized */ + PyArray_TIMSORT=3 /* the sort Python uses -- specialized */ } PyArray_SORTKIND; #define PyArray_NSORTS PyArray_TIMSORT + 1 diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h index dbcbebcd6..f95a6d02a 100644 --- a/numpy/core/include/numpy/ufuncobject.h +++ b/numpy/core/include/numpy/ufuncobject.h @@ -99,19 +99,19 @@ typedef struct { int swap[MAX_ARGS]; /* Buffers for the loop */ - void *buffer[MAX_ARGS]; + char *buffer[MAX_ARGS]; int bufsize; intp bufcnt; - void *dptr[MAX_ARGS]; + char *dptr[MAX_ARGS]; /* For casting */ - void *castbuf[MAX_ARGS]; + char *castbuf[MAX_ARGS]; PyArray_VectorUnaryFunc *cast[MAX_ARGS]; /* usually points to buffer but when a cast is to be done it switches for that argument to castbuf. */ - void *bufptr[MAX_ARGS]; + char *bufptr[MAX_ARGS]; /* Steps filled in from iters or sizeof(item) depending on loop method. @@ -148,13 +148,13 @@ typedef struct { int meth; int swap; - void *buffer; + char *buffer; int bufsize; - void *castbuf; + char *castbuf; PyArray_VectorUnaryFunc *cast; - void *bufptr[3]; + char *bufptr[3]; intp steps[3]; intp N; diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 3c3b8590a..46c437d1d 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -651,7 +651,7 @@ OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip, #from=STRING*20, UNICODE*20, VOID*20# #fromtyp=char*60# #to=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,STRING,UNICODE,VOID)*3# -#totyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, void)*3# +#totyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char)*3# #oskip=(1*17,aop->descr->elsize*3)*3# #convert=1*17,0*3,1*17,0*3,0*20# #convstr=(Int*9,Long*2,Float*3,Complex*3,Tuple*3)*3# diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 794a3d394..2d985ce08 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -2513,7 +2513,7 @@ PyArray_CopyAndTranspose(PyObject *op) optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; i<dims[0]; i++) { - iptr = PyArray_DATA(arr) + i*elsize; + iptr = PyArray_BYTES(arr) + i*elsize; for (j=0; j<dims[1]; j++) { /* optr[i,j] = iptr[j,i] */ memcpy(optr, iptr, elsize); @@ -5011,7 +5011,7 @@ PyArray_Arange(double start, double stop, double step, int type_num) if (length == 1) return range; obj = PyFloat_FromDouble(start + step); - ret = funcs->setitem(obj, PyArray_DATA(range)+PyArray_ITEMSIZE(range), + ret = funcs->setitem(obj, PyArray_BYTES(range)+PyArray_ITEMSIZE(range), (PyArrayObject *)range); Py_DECREF(obj); if (ret < 0) goto fail; @@ -5136,7 +5136,7 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr if (funcs->setitem(start, PyArray_DATA(range), (PyArrayObject *)range) < 0) goto fail; if (length == 1) goto finish; - if (funcs->setitem(next, PyArray_DATA(range)+PyArray_ITEMSIZE(range), + if (funcs->setitem(next, PyArray_BYTES(range)+PyArray_ITEMSIZE(range), (PyArrayObject *)range) < 0) goto fail; if (length == 2) goto finish; diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index 31dad8762..cd246e6ce 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -1460,7 +1460,7 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyArray_CopySwapNFunc *copyswapn[MAX_ARGS]; PyArrayIterObject **iters=loop->iters; int *swap=loop->swap; - void **dptr=loop->dptr; + char **dptr=loop->dptr; int mpselsize[MAX_ARGS]; intp laststrides[MAX_ARGS]; int fastmemcpy[MAX_ARGS]; @@ -1469,9 +1469,9 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, int bufsize; intp bufcnt; int copysizes[MAX_ARGS]; - void **bufptr = loop->bufptr; - void **buffer = loop->buffer; - void **castbuf = loop->castbuf; + char **bufptr = loop->bufptr; + char **buffer = loop->buffer; + char **castbuf = loop->castbuf; intp *steps = loop->steps; char *tptr[MAX_ARGS]; int ninnerloops = loop->ninnerloops; @@ -2768,7 +2768,7 @@ ufunc_frompyfunc(PyObject *dummy, PyObject *args, PyObject *kwds) { fdata->nout = nout; fdata->callable = function; - self->data = (void **)(self->ptr + offset[0]); + self->data = (void **)(((char *)self->ptr) + offset[0]); self->data[0] = (void *)fdata; self->types = (char *)self->data + sizeof(void *); |