diff options
author | David Cournapeau <cournape@gmail.com> | 2008-10-08 13:34:09 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-10-08 13:34:09 +0000 |
commit | 0f3fbf1eab50c35199908a0532de82c0b4917024 (patch) | |
tree | 54b064e9717b309e7af9b910605b36692a278840 /numpy | |
parent | dd7abccf331365e58b867a5601db089a1c51444a (diff) | |
download | numpy-0f3fbf1eab50c35199908a0532de82c0b4917024.tar.gz |
Use NPY_UNUSED in numpy.core sources.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/blasdot/_dotblas.c | 10 | ||||
-rw-r--r-- | numpy/core/include/numpy/ndarrayobject.h | 2 | ||||
-rw-r--r-- | numpy/core/src/_sortmodule.c.src | 12 | ||||
-rw-r--r-- | numpy/core/src/arraymethods.c | 2 | ||||
-rw-r--r-- | numpy/core/src/arrayobject.c | 18 | ||||
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 98 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 64 | ||||
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 17 | ||||
-rw-r--r-- | numpy/core/src/scalartypes.inc.src | 37 | ||||
-rw-r--r-- | numpy/core/src/ufuncobject.c | 6 | ||||
-rw-r--r-- | numpy/core/src/umathmodule.c.src | 108 |
11 files changed, 204 insertions, 170 deletions
diff --git a/numpy/core/blasdot/_dotblas.c b/numpy/core/blasdot/_dotblas.c index d71468bb5..c75fb9ecc 100644 --- a/numpy/core/blasdot/_dotblas.c +++ b/numpy/core/blasdot/_dotblas.c @@ -80,7 +80,7 @@ static Bool altered=FALSE; static char doc_alterdot[] = "alterdot() changes all dot functions to use blas."; static PyObject * -dotblas_alterdot(PyObject *dummy, PyObject *args) +dotblas_alterdot(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyArray_Descr *descr; @@ -115,7 +115,7 @@ dotblas_alterdot(PyObject *dummy, PyObject *args) static char doc_restoredot[] = "restoredot() restores dots to defaults."; static PyObject * -dotblas_restoredot(PyObject *dummy, PyObject *args) +dotblas_restoredot(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyArray_Descr *descr; @@ -203,7 +203,7 @@ static char doc_matrixproduct[] = \ "dimension of b.\nNB: The first argument is not conjugated."; static PyObject * -dotblas_matrixproduct(PyObject *dummy, PyObject *args) +dotblas_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *op1, *op2; PyArrayObject *ap1 = NULL, *ap2 = NULL, *ret = NULL; @@ -798,7 +798,7 @@ static char doc_innerproduct[] = \ "not conjugated."; static PyObject * -dotblas_innerproduct(PyObject *dummy, PyObject *args) +dotblas_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *op1, *op2; PyArrayObject *ap1, *ap2, *ret; @@ -1046,7 +1046,7 @@ dotblas_innerproduct(PyObject *dummy, PyObject *args) static char doc_vdot[] = "vdot(a,b)\nReturns the dot product of a and b for scalars and vectors\nof floating point and complex types. The first argument, a, is conjugated."; -static PyObject *dotblas_vdot(PyObject *dummy, PyObject *args) { +static PyObject *dotblas_vdot(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *op1, *op2; PyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL; int l; diff --git a/numpy/core/include/numpy/ndarrayobject.h b/numpy/core/include/numpy/ndarrayobject.h index 5fdd16463..50f4c8442 100644 --- a/numpy/core/include/numpy/ndarrayobject.h +++ b/numpy/core/include/numpy/ndarrayobject.h @@ -23,6 +23,8 @@ extern "C" CONFUSE_EMACS #define NPY_ALLOW_THREADS 0 #endif +#include "utils.h" + /* There are several places in the code where an array of dimensions is * allocated statically. This is the size of that static allocation. * diff --git a/numpy/core/src/_sortmodule.c.src b/numpy/core/src/_sortmodule.c.src index 8e2e742bd..aa2566445 100644 --- a/numpy/core/src/_sortmodule.c.src +++ b/numpy/core/src/_sortmodule.c.src @@ -54,7 +54,7 @@ #lessequal=STDC_LE*14,NUMC_LE*3# **/ static int -@TYPE@_quicksort(@type@ *start, intp num, void *unused) +@TYPE@_quicksort(@type@ *start, intp num, void * NPY_UNUSED(unused)) { @type@ *pl = start; @type@ *pr = start + num - 1; @@ -112,7 +112,7 @@ static int } static int -@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *unused) +@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *NPY_UNUSED(unused)) { @type@ vp; intp *pl, *pr, SWAP_temp; @@ -174,7 +174,7 @@ static int static int -@TYPE@_heapsort(@type@ *start, intp n, void *unused) +@TYPE@_heapsort(@type@ *start, intp n, void *NPY_UNUSED(unused)) { @type@ tmp, *a; intp i,j,l; @@ -220,7 +220,7 @@ static int } static int -@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *unused) +@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *NPY_UNUSED(unused)) { intp *a, i,j,l, tmp; /* The arrays need to be offset by one for heapsort indexing */ @@ -306,7 +306,7 @@ static void } static int -@TYPE@_mergesort(@type@ *start, intp num, void *unused) +@TYPE@_mergesort(@type@ *start, intp num, void *NPY_UNUSED(unused)) { @type@ *pl, *pr, *pw; @@ -365,7 +365,7 @@ static void } static int -@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *unused) +@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *NPY_UNUSED(unused)) { intp *pl, *pr, *pw; diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 8e50bcdf7..7615fcfb9 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -1105,7 +1105,7 @@ _setlist_pkl(PyArrayObject *self, PyObject *list) static PyObject * -array_reduce(PyArrayObject *self, PyObject *args) +array_reduce(PyArrayObject *self, PyObject *NPY_UNUSED(args)) { /* version number of this pickle type. Increment if we need to change the format. Be sure to handle the old versions in diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index f944a499d..3cc30ba2b 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -3710,7 +3710,7 @@ fast_scalar_power(PyArrayObject *a1, PyObject *o2, int inplace) { } static PyObject * -array_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo) +array_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo)) { /* modulo is ignored! */ PyObject *value; @@ -3801,7 +3801,7 @@ array_inplace_remainder(PyArrayObject *m1, PyObject *m2) } static PyObject * -array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo) +array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo)) { /* modulo is ignored! */ PyObject *value; @@ -6871,7 +6871,7 @@ array_transpose_get(PyArrayObject *self) --- default sub-class behavior */ static PyObject * -array_finalize_get(PyArrayObject *self) +array_finalize_get(PyArrayObject *NPY_UNUSED(self)) { Py_INCREF(Py_None); return Py_None; @@ -6949,7 +6949,7 @@ static PyGetSetDef array_getsetlist[] = { static PyObject * -array_alloc(PyTypeObject *type, Py_ssize_t nitems) +array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems)) { PyObject *obj; /* nitems will always be 0 */ @@ -9960,7 +9960,7 @@ static PyMappingMethods iter_as_mapping = { static PyObject * -iter_array(PyArrayIterObject *it, PyObject *op) +iter_array(PyArrayIterObject *it, PyObject *NPY_UNUSED(op)) { PyObject *r; @@ -10917,7 +10917,7 @@ PyArray_MultiIterNew(int n, ...) } static PyObject * -arraymultiter_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) +arraymultiter_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds) { int n, i; @@ -11526,7 +11526,7 @@ static PyGetSetDef arraydescr_getsets[] = { }; static PyObject * -arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) +arraydescr_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds) { PyObject *odescr; PyArray_Descr *descr, *conv; @@ -11558,7 +11558,7 @@ arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) /* return a tuple of (callable object, args, state). */ static PyObject * -arraydescr_reduce(PyArray_Descr *self, PyObject *args) +arraydescr_reduce(PyArray_Descr *self, PyObject *NPY_UNUSED(args)) { /* version number of this pickle type. Increment if we need to change the format. Be sure to handle the old versions in @@ -12557,7 +12557,7 @@ static PyMappingMethods arrayflags_as_mapping = { static PyObject * -arrayflags_new(PyTypeObject *self, PyObject *args, PyObject *kwds) +arrayflags_new(PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNUSED(kwds)) { PyObject *arg=NULL; if (!PyArg_UnpackTuple(args, "flagsobj", 0, 1, &arg)) diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 63c1b7f42..764bad1f4 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -668,7 +668,7 @@ fail: */ static void @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { *op++ = (@totyp@)*ip; @@ -683,7 +683,7 @@ static void */ static void @from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { *op++ = (Bool)(*ip++ != FALSE); @@ -697,7 +697,7 @@ static void */ static void @from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { *op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE)); @@ -712,7 +712,7 @@ static void */ static void BOOL_to_@to@(register Bool *ip, register @totyp@ *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { *op++ = (@totyp@)(*ip++ != FALSE); @@ -729,7 +729,7 @@ BOOL_to_@to@(register Bool *ip, register @totyp@ *op, register intp n, */ static void @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { while (n--) { *op++ = (@totyp@)*ip++; @@ -748,7 +748,7 @@ static void */ static void @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, - PyArrayObject *aip, PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop)) { n <<= 1; while (n--) { @@ -766,7 +766,7 @@ static void */ static void @from@_to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip, - PyArrayObject *aop) + PyArrayObject *NPY_UNUSED(aop)) { register intp i; int skip=@skip@; @@ -777,6 +777,26 @@ static void } /**end repeat**/ +#define _NPY_UNUSEDBOOL NPY_UNUSED +#define _NPY_UNUSEDBYTE NPY_UNUSED +#define _NPY_UNUSEDUBYTE NPY_UNUSED +#define _NPY_UNUSEDSHORT NPY_UNUSED +#define _NPY_UNUSEDUSHORT NPY_UNUSED +#define _NPY_UNUSEDINT NPY_UNUSED +#define _NPY_UNUSEDUINT NPY_UNUSED +#define _NPY_UNUSEDLONG NPY_UNUSED +#define _NPY_UNUSEDULONG NPY_UNUSED +#define _NPY_UNUSEDLONGLONG NPY_UNUSED +#define _NPY_UNUSEDULONGLONG NPY_UNUSED +#define _NPY_UNUSEDFLOAT NPY_UNUSED +#define _NPY_UNUSEDDOUBLE NPY_UNUSED +#define _NPY_UNUSEDLONGDOUBLE NPY_UNUSED +#define _NPY_UNUSEDCFLOAT NPY_UNUSED +#define _NPY_UNUSEDCDOUBLE NPY_UNUSED +#define _NPY_UNUSEDCLONGDOUBLE NPY_UNUSED +#define _NPY_UNUSEDSTRING +#define _NPY_UNUSEDVOID +#define _NPY_UNUSEDUNICODE /**begin repeat #to=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID# @@ -784,7 +804,7 @@ static void #skip= 1*17, aip->descr->elsize*3# */ static void -OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip, +OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *_NPY_UNUSED@to@(aip), PyArrayObject *aop) { register intp i; @@ -883,7 +903,7 @@ static void #format="hd","hu","d","u","ld","lu",LONGLONG_FMT,ULONGLONG_FMT,"f","lf","Lf"# */ static int -@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2) +@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored)) { return fscanf(fp, "%"@format@, ip); } @@ -897,7 +917,7 @@ static int #format="d","u"# */ static int -@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2) +@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2)) { @btype@ temp; int num; @@ -908,7 +928,7 @@ static int /**end repeat**/ static int -BOOL_scan (FILE *fp, Bool *ip, void *ignore, PyArray_Descr *ignore2) +BOOL_scan (FILE *fp, Bool *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2)) { int temp; int num; @@ -932,7 +952,7 @@ BOOL_scan (FILE *fp, Bool *ip, void *ignore, PyArray_Descr *ignore2) #btype=(long,ulong)*5# */ static int -@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore) +@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore)) { @btype@ result; @@ -948,7 +968,7 @@ static int */ #if (PY_VERSION_HEX >= 0x02040000) || defined(PyOS_ascii_strtod) static int -@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore) +@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore)) { double result; @@ -980,7 +1000,7 @@ static int */ static void @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, - intp n, int swap, void *arr) + intp n, int swap, void *NPY_UNUSED(arr)) { if (src != NULL) { if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) { @@ -997,7 +1017,7 @@ static void } static void -@fname@_copyswap (void *dst, void *src, int swap, void *arr) +@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr)) { if (src != NULL) /* copy first if needed */ @@ -1067,7 +1087,7 @@ static void */ static void @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n, - int swap, void *arr) + int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) { if (src != NULL) { if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) { @@ -1082,7 +1102,7 @@ static void } static void -@fname@_copyswap (void *dst, void *src, int swap, void *arr) +@fname@_copyswap (void *dst, void *src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) { if (src != NULL) /* copy first if needed */ memcpy(dst, src, sizeof(@type@)); @@ -1101,7 +1121,7 @@ static void */ static void @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n, - int swap, void *arr) + int swap, void *NPY_UNUSED(arr)) { if (src != NULL) { /* copy first if needed */ @@ -1123,7 +1143,7 @@ static void } static void -@fname@_copyswap (void *dst, void *src, int swap, void *arr) +@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr)) { if (src != NULL) /* copy first if needed */ memcpy(dst, src, sizeof(@type@)); @@ -1225,7 +1245,7 @@ static void #define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) static void OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride, - register intp n, int swap, void *arr) + register intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) { register intp i; if (src != NULL) { @@ -1258,7 +1278,7 @@ OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride, } static void -OBJECT_copyswap(PyObject **dst, PyObject **src, int swap, void *arr) +OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr)) { if (src != NULL) { @@ -1279,7 +1299,7 @@ OBJECT_copyswap(PyObject **dst, PyObject **src, int swap, void *arr) /* ignore swap */ static void STRING_copyswapn (char *dst, intp dstride, char *src, intp sstride, - intp n, int swap, PyArrayObject *arr) + intp n, int NPY_UNUSED(swap), PyArrayObject *arr) { if (src != NULL && arr != NULL) { int itemsize = arr->descr->elsize; @@ -1422,7 +1442,7 @@ UNICODE_copyswapn (char *dst, intp dstride, char *src, intp sstride, static void -STRING_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) +STRING_copyswap(char *dst, char *src, int NPY_UNUSED(swap), PyArrayObject *arr) { if (src != NULL && arr != NULL) { memcpy(dst, src, arr->descr->elsize); @@ -1633,7 +1653,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap) /****************** compare **********************************/ static int -BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *ap) +BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *NPY_UNUSED(ap)) { return (*ip1 ? (*ip2 ? 0 : 1) : (*ip2 ? -1 : 0)); } @@ -1644,7 +1664,7 @@ BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *ap) */ static int -@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) +@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap)) { return *ip1 < *ip2 ? -1 : *ip1 == *ip2 ? 0 : 1; } @@ -1658,7 +1678,7 @@ static int */ static int -@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) +@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap)) { if (*ip1 == *ip2) { return ip1[1]<ip2[1] ? -1 : (ip1[1] == ip2[1] ? 0 : 1); @@ -1670,7 +1690,7 @@ static int /**end repeat**/ static int -OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *ap) +OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *NPY_UNUSED(ap)) { if ((*ip1 == NULL) || (*ip2 == NULL)) { if (ip1 == ip2) return 1; @@ -1795,7 +1815,7 @@ finish: */ static int -@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) +@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { register intp i; @type@ mp=*ip; @@ -1813,7 +1833,7 @@ static int /**end repeat**/ static int -OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip) +OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { register intp i; PyObject *mp=ip[0]; *max_ind=0; @@ -1865,7 +1885,7 @@ static int static void BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, - void *ignore) + void *NPY_UNUSED(ignore)) { register Bool tmp=FALSE; register intp i; @@ -1885,7 +1905,7 @@ BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, */ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, - void *ignore) + void *NPY_UNUSED(ignore)) { register @out@ tmp=(@out@)0; register intp i; @@ -1903,7 +1923,7 @@ static void #type= float, double, longdouble# */ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2, - char *op, intp n, void *ignore) + char *op, intp n, void *NPY_UNUSED(ignore)) { @type@ tmpr=(@type@)0.0, tmpi=(@type@)0.0; intp i; @@ -1920,7 +1940,7 @@ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2, static void OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, - void *ignore) + void *NPY_UNUSED(ignore)) { intp i; PyObject *tmp1, *tmp2, *tmp=NULL; @@ -1955,7 +1975,7 @@ OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, /* this requires buffer to be filled with objects or NULL */ static void -OBJECT_fill(PyObject **buffer, intp length, void *ignored) +OBJECT_fill(PyObject **buffer, intp length, void *NPY_UNUSED(ignored)) { intp i; PyObject *start = buffer[0]; @@ -1983,7 +2003,7 @@ finish: #typ=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble# */ static void -@NAME@_fill(@typ@ *buffer, intp length, void *ignored) +@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored)) { register intp i; @typ@ start = buffer[0]; @@ -2000,7 +2020,7 @@ static void #typ=cfloat,cdouble,clongdouble# */ static void -@NAME@_fill(@typ@ *buffer, intp length, void *ignored) +@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignore)) { register intp i; @typ@ start; @@ -2023,7 +2043,7 @@ static void /* this requires buffer to be filled with objects or NULL */ static void -OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ignored) +OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *NPY_UNUSED(ignored)) { intp i; PyObject *val = *value; @@ -2038,7 +2058,7 @@ OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ig #typ=Bool,byte,ubyte# */ static void -@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored) +@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored)) { memset(buffer, *value, length); } @@ -2049,7 +2069,7 @@ static void #typ=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble# */ static void -@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored) +@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored)) { register intp i; @typ@ val = *value; diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index e3e84fda2..214cd6ccd 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -4177,7 +4177,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0, } static PyObject * -array_putmask(PyObject *module, PyObject *args, PyObject *kwds) +array_putmask(PyObject *NPY_UNUSED(module), PyObject *args, PyObject *kwds) { PyObject *mask, *values; PyObject *array; @@ -5697,7 +5697,7 @@ _prepend_ones(PyArrayObject *arr, int nd, int ndmin) PyArray_ISFORTRAN(op))) static PyObject * -_array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws) +_array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) { PyObject *op, *ret=NULL; static char *kwd[]= {"object", "dtype", "copy", "order", "subok", @@ -5816,7 +5816,7 @@ PyArray_Empty(int nd, intp *dims, PyArray_Descr *type, int fortran) } static PyObject * -array_empty(PyObject *ignored, PyObject *args, PyObject *kwds) +array_empty(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds) { static char *kwlist[] = {"shape","dtype","order",NULL}; @@ -5851,7 +5851,7 @@ array_empty(PyObject *ignored, PyObject *args, PyObject *kwds) numpy scalar objects. */ static PyObject * -array_scalar(PyObject *ignored, PyObject *args, PyObject *kwds) +array_scalar(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds) { static char *kwlist[] = {"dtype","obj", NULL}; @@ -5935,7 +5935,7 @@ PyArray_Zeros(int nd, intp *dims, PyArray_Descr *type, int fortran) } static PyObject * -array_zeros(PyObject *ignored, PyObject *args, PyObject *kwds) +array_zeros(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds) { static char *kwlist[] = {"shape","dtype","order",NULL}; /* XXX ? */ PyArray_Descr *typecode=NULL; @@ -5966,7 +5966,7 @@ array_zeros(PyObject *ignored, PyObject *args, PyObject *kwds) } static PyObject * -array_set_typeDict(PyObject *ignored, PyObject *args) +array_set_typeDict(PyObject *NPY_UNUSED(ignored), PyObject *args) { PyObject *dict; if (!PyArg_ParseTuple(args, "O", &dict)) return NULL; @@ -6002,7 +6002,7 @@ fromstr_next_element(char **s, void *dptr, PyArray_Descr *dtype, static int fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype, - void *stream_data) + void *NPY_UNUSED(stream_data)) { /* the NULL argument is for backwards-compatibility */ return dtype->f->scanfunc(*fp, dptr, NULL, dtype); @@ -6095,7 +6095,7 @@ fromstr_skip_separator(char **s, const char *sep, const char *end) } static int -fromfile_skip_separator(FILE **fp, const char *sep, void *stream_data) +fromfile_skip_separator(FILE **fp, const char *sep, void *NPY_UNUSED(stream_data)) { int result = 0; const char *sep_start = sep; @@ -6307,7 +6307,7 @@ PyArray_FromString(char *data, intp slen, PyArray_Descr *dtype, } static PyObject * -array_fromstring(PyObject *ignored, PyObject *args, PyObject *keywds) +array_fromstring(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds) { char *data; Py_ssize_t nin=-1; @@ -6440,7 +6440,7 @@ PyArray_FromFile(FILE *fp, PyArray_Descr *dtype, intp num, char *sep) } static PyObject * -array_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds) +array_fromfile(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds) { PyObject *file=NULL, *ret; FILE *fp; @@ -6579,7 +6579,7 @@ PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, intp count) } static PyObject * -array_fromiter(PyObject *ignored, PyObject *args, PyObject *keywds) +array_fromiter(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds) { PyObject *iter; Py_ssize_t nin=-1; @@ -6698,7 +6698,7 @@ PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type, } static PyObject * -array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds) +array_frombuffer(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds) { PyObject *obj=NULL; Py_ssize_t nin=-1, offset=0; @@ -6721,7 +6721,7 @@ array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds) } static PyObject * -array_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds) +array_concatenate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *a0; int axis=0; @@ -6734,7 +6734,7 @@ array_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds) return PyArray_Concatenate(a0, axis); } -static PyObject *array_innerproduct(PyObject *dummy, PyObject *args) { +static PyObject *array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *b0, *a0; if (!PyArg_ParseTuple(args, "OO", &a0, &b0)) return NULL; @@ -6742,7 +6742,7 @@ static PyObject *array_innerproduct(PyObject *dummy, PyObject *args) { return _ARET(PyArray_InnerProduct(a0, b0)); } -static PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) { +static PyObject *array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *v, *a; if (!PyArg_ParseTuple(args, "OO", &a, &v)) return NULL; @@ -6750,7 +6750,7 @@ static PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) { return _ARET(PyArray_MatrixProduct(a, v)); } -static PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) { +static PyObject *array_fastCopyAndTranspose(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *a0; if (!PyArg_ParseTuple(args, "O", &a0)) return NULL; @@ -6758,7 +6758,7 @@ static PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) { return _ARET(PyArray_CopyAndTranspose(a0)); } -static PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds) { +static PyObject *array_correlate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *shape, *a0; int mode=0; static char *kwlist[] = {"a", "v", "mode", NULL}; @@ -6988,7 +6988,7 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr } static PyObject * -array_arange(PyObject *ignored, PyObject *args, PyObject *kws) { +array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) { PyObject *o_start=NULL, *o_stop=NULL, *o_step=NULL; static char *kwd[]= {"start", "stop", "step", "dtype", NULL}; PyArray_Descr *typecode=NULL; @@ -7015,7 +7015,7 @@ PyArray_GetNDArrayCVersion(void) } static PyObject * -array__get_ndarray_c_version(PyObject *dummy, PyObject *args, PyObject *kwds) +array__get_ndarray_c_version(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { static char *kwlist[] = {NULL}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist )) return NULL; @@ -7024,7 +7024,7 @@ array__get_ndarray_c_version(PyObject *dummy, PyObject *args, PyObject *kwds) } static PyObject * -array__reconstruct(PyObject *dummy, PyObject *args) +array__reconstruct(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *ret; @@ -7056,7 +7056,7 @@ array__reconstruct(PyObject *dummy, PyObject *args) } static PyObject * -array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds) +array_set_string_function(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *op=NULL; int repr=1; @@ -7078,7 +7078,7 @@ array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds) } static PyObject * -array_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds) +array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *kwds) { PyObject *oldops=NULL; @@ -7145,7 +7145,7 @@ PyArray_Where(PyObject *condition, PyObject *x, PyObject *y) } static PyObject * -array_where(PyObject *ignored, PyObject *args) +array_where(PyObject *NPY_UNUSED(ignored), PyObject *args) { PyObject *obj=NULL, *x=NULL, *y=NULL; @@ -7155,7 +7155,7 @@ array_where(PyObject *ignored, PyObject *args) } static PyObject * -array_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds) +array_lexsort(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds) { int axis=-1; PyObject *obj; @@ -7170,7 +7170,7 @@ array_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds) #undef _ARET static PyObject * -array_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds) +array_can_cast_safely(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyArray_Descr *d1=NULL; PyArray_Descr *d2=NULL; @@ -7201,7 +7201,7 @@ array_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds) } static PyObject * -new_buffer(PyObject *dummy, PyObject *args) +new_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args) { int size; @@ -7212,7 +7212,7 @@ new_buffer(PyObject *dummy, PyObject *args) } static PyObject * -buffer_buffer(PyObject *dummy, PyObject *args, PyObject *kwds) +buffer_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *obj; Py_ssize_t offset=0, size=Py_END_OF_BUFFER, n; @@ -7258,7 +7258,7 @@ _SigSegv_Handler(int signum) } static PyObject * -as_buffer(PyObject *dummy, PyObject *args, PyObject *kwds) +as_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *mem; Py_ssize_t size; @@ -7315,7 +7315,7 @@ as_buffer(PyObject *dummy, PyObject *args, PyObject *kwds) #undef _test_code static PyObject * -format_longfloat(PyObject *dummy, PyObject *args, PyObject *kwds) +format_longfloat(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *obj; unsigned int precision; @@ -7340,7 +7340,7 @@ format_longfloat(PyObject *dummy, PyObject *args, PyObject *kwds) } static PyObject * -compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds) +compare_chararrays(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { PyObject *array; PyObject *other; @@ -7441,7 +7441,7 @@ _PyArray_GetSigintBuf(void) static PyObject * -test_interrupt(PyObject *self, PyObject *args) +test_interrupt(PyObject *NPY_UNUSED(self), PyObject *args) { int kind=0; int a = 0; @@ -7546,7 +7546,7 @@ static struct PyMethodDef array_module_methods[] = { Thus, we call PyType_Ready on the standard Python Types, here. */ static int -setup_scalartypes(PyObject *dict) +setup_scalartypes(PyObject *NPY_UNUSED(dict)) { initialize_numeric_types(); diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index 1daf83f68..913e73dce 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -14,6 +14,7 @@ /** numarray adapted routines.... **/ +#if SIZEOF_LONGLONG == 64 || SIZEOF_LONGLONG == 128 static int ulonglong_overflow(ulonglong a, ulonglong b) { ulonglong ah, al, bh, bl, w, x, y, z; @@ -50,6 +51,12 @@ static int ulonglong_overflow(ulonglong a, ulonglong b) #endif } +#else +static int ulonglong_overflow(ulonglong NPY_UNUSED(a), ulonglong NPY_UNUSED(b)) +{ + return 0; +} +#endif static int slonglong_overflow(longlong a0, longlong b0) { @@ -665,7 +672,7 @@ static PyObject * **/ static PyObject * -@name@_power(PyObject *a, PyObject *b, PyObject *c) +@name@_power(PyObject *a, PyObject *b, PyObject *NPY_UNUSED(c)) { PyObject *ret; @name@ arg1, arg2; @@ -1117,7 +1124,7 @@ static void *saved_tables[9]; char doc_alterpyscalars[] = ""; static PyObject * -alter_pyscalars(PyObject *dummy, PyObject *args) +alter_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args) { int n; PyObject *obj; @@ -1152,7 +1159,7 @@ alter_pyscalars(PyObject *dummy, PyObject *args) char doc_restorepyscalars[] = ""; static PyObject * -restore_pyscalars(PyObject *dummy, PyObject *args) +restore_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args) { int n; PyObject *obj; @@ -1186,7 +1193,7 @@ restore_pyscalars(PyObject *dummy, PyObject *args) char doc_usepythonmath[] = ""; static PyObject * -use_pythonmath(PyObject *dummy, PyObject *args) +use_pythonmath(PyObject *NPY_UNUSED(dummy), PyObject *args) { int n; PyObject *obj; @@ -1220,7 +1227,7 @@ use_pythonmath(PyObject *dummy, PyObject *args) char doc_usescalarmath[] = ""; static PyObject * -use_scalarmath(PyObject *dummy, PyObject *args) +use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args) { int n; PyObject *obj; diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src index 381da0ac1..b215a438b 100644 --- a/numpy/core/src/scalartypes.inc.src +++ b/numpy/core/src/scalartypes.inc.src @@ -373,7 +373,7 @@ gentype_dealloc(PyObject *v) static PyObject * -gentype_power(PyObject *m1, PyObject *m2, PyObject *m3) +gentype_power(PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3)) { PyObject *arr, *ret, *arg2; char *msg="unsupported operand type(s) for ** or pow()"; @@ -770,13 +770,13 @@ gentype_richcompare(PyObject *self, PyObject *other, int cmp_op) } static PyObject * -gentype_ndim_get(PyObject *self) +gentype_ndim_get(PyObject *NPY_UNUSED(self)) { return PyInt_FromLong(0); } static PyObject * -gentype_flags_get(PyObject *self) +gentype_flags_get(PyObject *NPY_UNUSED(self)) { return PyArray_NewFlagsObject(NULL); } @@ -827,7 +827,7 @@ gentype_itemsize_get(PyObject *self) } static PyObject * -gentype_size_get(PyObject *self) +gentype_size_get(PyObject *NPY_UNUSED(self)) { return PyInt_FromLong(1); } @@ -866,13 +866,13 @@ gentype_struct_get(PyObject *self) } static PyObject * -gentype_priority_get(PyObject *self) +gentype_priority_get(PyObject *NPY_UNUSED(self)) { return PyFloat_FromDouble(NPY_SCALAR_PRIORITY); } static PyObject * -gentype_shape_get(PyObject *self) +gentype_shape_get(PyObject *NPY_UNUSED(self)) { return PyTuple_New(0); } @@ -902,7 +902,7 @@ gentype_typedescr_get(PyObject *self) static PyObject * -gentype_base_get(PyObject *self) +gentype_base_get(PyObject *NPY_UNUSED(self)) { Py_INCREF(Py_None); return Py_None; @@ -1110,7 +1110,7 @@ gentype_getarray(PyObject *scalar, PyObject *args) static char doc_sc_wraparray[] = "sc.__array_wrap__(obj) return scalar from array"; static PyObject * -gentype_wraparray(PyObject *scalar, PyObject *args) +gentype_wraparray(PyObject *NPY_UNUSED(scalar), PyObject *args) { PyObject *arr; @@ -1143,7 +1143,7 @@ gentype_@name@(PyObject *self, PyObject *args) /**end repeat**/ static PyObject * -gentype_itemset(PyObject *self, PyObject *args) +gentype_itemset(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args)) { PyErr_SetString(PyExc_ValueError, "array-scalars are immutable"); return NULL; @@ -1230,7 +1230,7 @@ voidtype_getfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds) } static PyObject * -gentype_setfield(PyObject *self, PyObject *args, PyObject *kwds) +gentype_setfield(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds)) { PyErr_SetString(PyExc_TypeError, "Can't set fields in a non-void array scalar."); @@ -1296,7 +1296,7 @@ voidtype_setfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds) static PyObject * -gentype_reduce(PyObject *self, PyObject *args) +gentype_reduce(PyObject *self, PyObject *NPY_UNUSED(args)) { PyObject *ret=NULL, *obj=NULL, *mod=NULL; const char *buffer; @@ -1369,7 +1369,7 @@ fail: /* ignores everything */ static PyObject * -gentype_setstate(PyObject *self, PyObject *args) +gentype_setstate(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args)) { Py_INCREF(Py_None); return (Py_None); @@ -1400,7 +1400,7 @@ gentype_dumps(PyObject *self, PyObject *args) /* setting flags cannot be done for scalars */ static PyObject * -gentype_setflags(PyObject *self, PyObject *args, PyObject *kwds) +gentype_setflags(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds)) { Py_INCREF(Py_None); return Py_None; @@ -1892,8 +1892,13 @@ object_arrtype_dealloc(PyObject *v) #work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0# #default=0*16,1*2,2# */ + +#define _NPY_UNUSED1 +#define _NPY_UNUSEDz +#define _NPY_UNUSED0 NPY_UNUSED + static PyObject * -@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *_NPY_UNUSED@work@(kwds)) { PyObject *obj = NULL; PyObject *robj; @@ -1999,7 +2004,7 @@ finish: /* bool->tp_new only returns Py_True or Py_False */ static PyObject * -bool_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +bool_arrtype_new(PyTypeObject *NPY_UNUSED(type), PyObject *args, PyObject *NPY_UNUSED(kwds)) { PyObject *obj=NULL; PyObject *arr; @@ -2095,7 +2100,7 @@ static PyNumberMethods bool_arrtype_as_number = { }; static PyObject * -void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds)) { PyObject *obj, *arr; ulonglong memu=1; diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index ab4ecef75..d646dd6b9 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -3500,7 +3500,7 @@ fail: } static PyObject * -ufunc_geterr(PyObject *dummy, PyObject *args) +ufunc_geterr(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *thedict; PyObject *res; @@ -3563,7 +3563,7 @@ ufunc_update_use_defaults(void) #endif static PyObject * -ufunc_seterr(PyObject *dummy, PyObject *args) +ufunc_seterr(PyObject *NPY_UNUSED(dummy), PyObject *args) { PyObject *thedict; int res; @@ -3600,7 +3600,7 @@ static char doc_frompyfunc[] = "frompyfunc(func, nin, nout) take an arbitrary python function that takes nin objects as input and returns nout objects and return a universal function (ufunc). This ufunc always returns PyObject arrays"; static PyObject * -ufunc_frompyfunc(PyObject *dummy, PyObject *args, PyObject *kwds) { +ufunc_frompyfunc(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *NPY_UNUSED(kwds)) { /* Keywords are ignored for now */ PyObject *function, *pyname=NULL; diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index 2f2521047..c7dfa24ef 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -554,7 +554,7 @@ nc_tanh@c@(c@typ@ *x, c@typ@ *r) **/ static void -BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) +BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { Bool in1 = *((Bool *)ip1) != 0; @@ -565,7 +565,7 @@ BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) /**end repeat**/ static void -BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *func) +BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { Bool in1 = *((Bool *)ip1) != 0; @@ -579,7 +579,7 @@ BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *func) * #OP = >, <# **/ static void -BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) +BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { Bool in1 = *((Bool *)ip1) != 0; @@ -594,7 +594,7 @@ BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) * #OP = !=, ==# **/ static void -BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) +BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { Bool in1 = *(Bool *)ip1; @@ -659,7 +659,7 @@ static void } static void -@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -668,7 +668,7 @@ static void } static void -@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -677,7 +677,7 @@ static void } static void -@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -686,7 +686,7 @@ static void } static void -@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -701,7 +701,7 @@ static void * #OP = +, -,*, &, |, ^, <<, >># */ static void -@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -717,7 +717,7 @@ static void * #OP = ==, !=, >, >=, <, <=, &&, ||# */ static void -@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -728,7 +728,7 @@ static void /**end repeat2**/ static void -@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -742,7 +742,7 @@ static void * #OP = >, <# **/ static void -@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -753,7 +753,7 @@ static void /**end repeat2**/ static void -@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -769,7 +769,7 @@ static void } static void -@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @ftype@ in1 = (@ftype@)*(@s@@type@ *)ip1; @@ -779,7 +779,7 @@ static void } static void -@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *func) +@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @s@@type@ in1 = *(@s@@type@ *)ip1; @@ -798,7 +798,7 @@ static void /**end repeat1**/ static void -U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) +U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const u@type@ in1 = *(u@type@ *)ip1; @@ -807,7 +807,7 @@ U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) } static void -@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -816,7 +816,7 @@ static void } static void -U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func) +U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const u@type@ in1 = *(u@type@ *)ip1; @@ -825,7 +825,7 @@ U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func) } static void -@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -834,7 +834,7 @@ static void } static void -@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -853,7 +853,7 @@ static void } static void -U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *func) +U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const u@type@ in1 = *(u@type@ *)ip1; @@ -869,7 +869,7 @@ U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *func) } static void -@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -892,7 +892,7 @@ static void } static void -U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) +U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const u@type@ in1 = *(u@type@ *)ip1; @@ -930,7 +930,7 @@ U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) * # OP = +, -, *, /# */ static void -@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -946,7 +946,7 @@ static void * #OP = ==, !=, <, <=, >, >=, &&, ||# */ static void -@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -957,7 +957,7 @@ static void /**end repeat1**/ static void -@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -967,7 +967,7 @@ static void } static void -@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -980,7 +980,7 @@ static void * #func = isnan, isinf, isfinite, signbit# **/ static void -@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -994,7 +994,7 @@ static void * #OP = >, <# **/ static void -@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { /* */ BINARY_LOOP { @@ -1006,7 +1006,7 @@ static void /**end repeat1**/ static void -@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1016,7 +1016,7 @@ static void } static void -@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1058,7 +1058,7 @@ static void } static void -@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1067,7 +1067,7 @@ static void } static void -@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1078,7 +1078,7 @@ static void } static void -@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1087,7 +1087,7 @@ static void } static void -@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { /* */ UNARY_LOOP { @@ -1105,7 +1105,7 @@ static void } static void -@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP_TWO_OUT { const @type@ in1 = *(@type@ *)ip1; @@ -1115,7 +1115,7 @@ static void #ifdef HAVE_FREXP@C@ static void -@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP_TWO_OUT { const @type@ in1 = *(@type@ *)ip1; @@ -1126,7 +1126,7 @@ static void #ifdef HAVE_LDEXP@C@ static void -@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func) +@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; @@ -1161,7 +1161,7 @@ static void * #OP = +, -# */ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1175,7 +1175,7 @@ static void /**end repeat1**/ static void -@CTYPE@_multiply(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1188,7 +1188,7 @@ static void } static void -@CTYPE@_divide(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1202,7 +1202,7 @@ static void } static void -@CTYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1221,7 +1221,7 @@ static void #OP2 = &&, ||# */ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1238,7 +1238,7 @@ static void * #OP = >, >=, <, <=# */ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1261,7 +1261,7 @@ static void #OP2 = &&, ||# */ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1274,7 +1274,7 @@ static void /**end repeat1**/ static void -@CTYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1288,7 +1288,7 @@ static void } static void -@CTYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1303,7 +1303,7 @@ static void * #OP = ||, ||, &&# **/ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1354,7 +1354,7 @@ static void } static void -@CTYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func) { +@CTYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; const @type@ in1i = ((@type@ *)ip1)[1]; @@ -1364,7 +1364,7 @@ static void } static void -@CTYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1374,7 +1374,7 @@ static void } static void -@CTYPE@_sign(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { UNARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1405,7 +1405,7 @@ static void * #OP = >, <# */ static void -@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) +@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { const @type@ in1r = ((@type@ *)ip1)[0]; @@ -1438,7 +1438,7 @@ static void * #OP = EQ, NE, GT, GE, LT, LE# */ static void -OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) { +OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { BINARY_LOOP { PyObject *in1 = *(PyObject **)ip1; PyObject *in2 = *(PyObject **)ip2; @@ -1447,7 +1447,7 @@ OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) { } /**end repeat**/ -OBJECT_sign(char **args, intp *dimensions, intp *steps, void *func) +OBJECT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) { PyObject *zero = PyInt_FromLong(0); UNARY_LOOP { |