diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-06-27 20:03:16 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-07-03 01:09:55 +0200 |
commit | c15f7747c78e3e8b492ac4b1ef298b51bbae428f (patch) | |
tree | 009305d52f924a10362205521117c49cf087ec29 /numpy | |
parent | 7a3926c45f99284c83eeefb4e87030139b3d689b (diff) | |
download | numpy-c15f7747c78e3e8b492ac4b1ef298b51bbae428f.tar.gz |
MAINT: remove a bunch of compiler warnings
there is a memset warning remaining when built with -flto, though its
not clear where exactly it comes from.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/code_generators/generate_ufunc_api.py | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/compiled_base.c | 3 | ||||
-rw-r--r-- | numpy/core/src/multiarray/conversion_utils.c | 1 | ||||
-rw-r--r-- | numpy/core/src/multiarray/lowlevel_strided_loops.c.src | 6 | ||||
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/scalartypes.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ucsnarrow.c | 3 | ||||
-rw-r--r-- | numpy/core/src/npymath/npy_math_complex.c.src | 6 | ||||
-rw-r--r-- | numpy/core/src/umath/scalarmath.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/umath/test_rational.c.src | 2 | ||||
-rw-r--r-- | numpy/linalg/lapack_litemodule.c | 5 |
12 files changed, 20 insertions, 18 deletions
diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py index b594fccf7..7a33004e4 100644 --- a/numpy/core/code_generators/generate_ufunc_api.py +++ b/numpy/core/code_generators/generate_ufunc_api.py @@ -37,7 +37,7 @@ static void **PyUFunc_API=NULL; %s -static int +static NPY_INLINE int _import_umath(void) { PyObject *numpy = PyImport_ImportModule("numpy.core.umath"); diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c index aaedbac61..7d42cca7a 100644 --- a/numpy/core/src/multiarray/compiled_base.c +++ b/numpy/core/src/multiarray/compiled_base.c @@ -1271,7 +1271,7 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args) PyObject *str; char *docstr; static char *msg = "already has a docstring"; - PyObject *tp_dict; + PyObject *tp_dict = PyArrayDescr_Type.tp_dict; PyObject *myobj; static PyTypeObject *PyMemberDescr_TypePtr = NULL; static PyTypeObject *PyGetSetDescr_TypePtr = NULL; @@ -1283,7 +1283,6 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args) } if (PyGetSetDescr_TypePtr == NULL) { - tp_dict = PyArrayDescr_Type.tp_dict; /* Get "subdescr" */ myobj = PyDict_GetItemString(tp_dict, "fields"); if (myobj != NULL) { diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c index 52338791f..3b9a10da5 100644 --- a/numpy/core/src/multiarray/conversion_utils.c +++ b/numpy/core/src/multiarray/conversion_utils.c @@ -903,6 +903,7 @@ PyArray_PyIntAsIntp_ErrMsg(PyObject *o, const char * msg) return -1; } + goto overflow_check; /* silence unused warning */ overflow_check: #if (NPY_SIZEOF_LONG < NPY_SIZEOF_INTP) #if (NPY_SIZEOF_LONGLONG > NPY_SIZEOF_INTP) diff --git a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src index 38e7656f3..0fe63c13b 100644 --- a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src +++ b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src @@ -199,9 +199,11 @@ static NPY_GCC_OPT_3 void npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data)) { -# if @elsize@ != 16 +#if @elsize@ != 16 +# if !(@elsize@ == 1 && @dst_contig@) @type@ temp; -# else +# endif +#else npy_uint64 temp0, temp1; #endif #if @is_aligned@ && @elsize@ != 16 diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index f265e6b39..668a5b627 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -1421,7 +1421,7 @@ array_subscript(PyArrayObject *self, PyObject *op) { int index_type; int index_num; - int i, ndim, fancy_ndim, fancy; + int i, ndim, fancy_ndim; /* * Index info array. We can have twice as many indices as dimensions * (because of None). The + 1 is to not need to check as much. diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index d2dc4469a..6155551d6 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -2394,7 +2394,7 @@ array_matmul(PyObject *NPY_UNUSED(m), PyObject *args, PyObject* kwds) return NULL; } - errval = PyUFunc_CheckOverride(matmul, "__call__", + errval = PyUFunc_CheckOverride((PyUFuncObject*)matmul, "__call__", args, kwds, &override, 2); if (errval) { return NULL; @@ -2512,7 +2512,7 @@ array_matmul(PyObject *NPY_UNUSED(m), PyObject *args, PyObject* kwds) /* If no output was supplied, possibly convert to a scalar */ if (ret != NULL && out == NULL) { - ret = PyArray_Return((PyArrayObject *)ret); + return PyArray_Return((PyArrayObject *)ret); } return (PyObject *)ret; diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index 478c5bb78..b5e0fde85 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -1701,7 +1701,7 @@ voidtype_setfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds) } /* 1. Convert to 0-d array and use getfield */ - arr = PyArray_FromScalar(self, NULL); + arr = PyArray_FromScalar((PyObject*)self, NULL); if (arr == NULL) { Py_DECREF(getfield_args); return NULL; diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c index 54a9d5671..8e293e9f2 100644 --- a/numpy/core/src/multiarray/ucsnarrow.c +++ b/numpy/core/src/multiarray/ucsnarrow.c @@ -136,7 +136,8 @@ PyUnicode_FromUCS4(char *src, Py_ssize_t size, int swap, int align) /* produce PyUnicode object */ #ifdef Py_UNICODE_WIDE { - ret = (PyUnicodeObject *)PyUnicode_FromUnicode(buf, (Py_ssize_t) ucs4len); + ret = (PyUnicodeObject *)PyUnicode_FromUnicode((Py_UNICODE*)buf, + (Py_ssize_t) ucs4len); if (ret == NULL) { goto fail; } diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src index 94cb7e29d..c4867e28d 100644 --- a/numpy/core/src/npymath/npy_math_complex.c.src +++ b/numpy/core/src/npymath/npy_math_complex.c.src @@ -33,12 +33,13 @@ */ #include "npy_math_common.h" #include "npy_math_private.h" +#include <numpy/utils.h> #define raise_inexact() do { volatile npy_float junk = 1 + tiny; } while(0) -static npy_float tiny = 3.9443045e-31f; +static __COMP_NPY_UNUSED npy_float tiny = 3.9443045e-31f; /**begin repeat @@ -183,6 +184,8 @@ npy_carg@c@(@ctype@ z) #define SCALED_CEXP_LOWERL 11357.216553474703895L #define SCALED_CEXP_UPPERL 22756.021937783004509L +#ifndef HAVE_CEXP@C@ + static @ctype@ _npy_scaled_cexp@c@(@type@ x, @type@ y, npy_int expt) @@ -209,7 +212,6 @@ _npy_scaled_cexp@c@(@type@ x, @type@ y, npy_int expt) npy_ldexp@c@(mant * mantsin, expt + exsin)); } -#ifndef HAVE_CEXP@C@ @ctype@ npy_cexp@c@(@ctype@ z) { diff --git a/numpy/core/src/umath/scalarmath.c.src b/numpy/core/src/umath/scalarmath.c.src index e4fc617a5..010261214 100644 --- a/numpy/core/src/umath/scalarmath.c.src +++ b/numpy/core/src/umath/scalarmath.c.src @@ -1417,7 +1417,7 @@ static PyObject * * #func = (PyLong_FromLongLong, PyLong_FromUnsignedLongLong)*5, * PyLong_FromDouble*7, PyFloat_FromDouble*17# */ -static PyObject * +static NPY_INLINE PyObject * @name@_@which@(PyObject *obj) { #if @cmplx@ diff --git a/numpy/core/src/umath/test_rational.c.src b/numpy/core/src/umath/test_rational.c.src index 5c4f29f73..b0c06e1ac 100644 --- a/numpy/core/src/umath/test_rational.c.src +++ b/numpy/core/src/umath/test_rational.c.src @@ -543,7 +543,7 @@ pyrational_str(PyObject* self) { } } -static long +static npy_hash_t pyrational_hash(PyObject* self) { rational x = ((PyRational*)self)->r; /* Use a fairly weak hash as Python expects */ diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c index 32290123b..ebffdcc24 100644 --- a/numpy/linalg/lapack_litemodule.c +++ b/numpy/linalg/lapack_litemodule.c @@ -314,8 +314,6 @@ static struct PyMethodDef lapack_lite_module_methods[] = { { NULL,NULL,0, NULL} }; -static char lapack_lite_module_documentation[] = ""; - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { @@ -346,8 +344,7 @@ initlapack_lite(void) m = PyModule_Create(&moduledef); #else m = Py_InitModule4("lapack_lite", lapack_lite_module_methods, - lapack_lite_module_documentation, - (PyObject*)NULL,PYTHON_API_VERSION); + "", (PyObject*)NULL,PYTHON_API_VERSION); #endif if (m == NULL) { return RETVAL; |