diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-05-25 10:28:07 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-05-25 10:38:31 +0200 |
commit | cf574923b764e477a6b748c3620c99c9fadf44e9 (patch) | |
tree | 555dfa12cbc685ea54440f842348164bab1630d2 /numpy/core/src | |
parent | e11cd9b028051659a852b7e8daa150f082d42c5a (diff) | |
download | numpy-cf574923b764e477a6b748c3620c99c9fadf44e9.tar.gz |
MAINT: fix some compiler warnings
implicit declarations, wrong declarations, unused variables and fixes a
comparison typo bug in multiarraymodule.c
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/multiarray/_datetime.h | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/arrayobject.c | 3 | ||||
-rw-r--r-- | numpy/core/src/multiarray/calculation.c | 1 | ||||
-rw-r--r-- | numpy/core/src/multiarray/convert.h | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/convert_datatype.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 3 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_constr.c | 1 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ucsnarrow.c | 1 | ||||
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/umath/test_rational.c.src | 1 | ||||
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 6 |
12 files changed, 15 insertions, 13 deletions
diff --git a/numpy/core/src/multiarray/_datetime.h b/numpy/core/src/multiarray/_datetime.h index 7ec3cd907..8cfd5d851 100644 --- a/numpy/core/src/multiarray/_datetime.h +++ b/numpy/core/src/multiarray/_datetime.h @@ -10,7 +10,7 @@ NPY_NO_EXPORT int _days_per_month_table[2][12]; #endif NPY_NO_EXPORT void -numpy_pydatetime_import(); +numpy_pydatetime_import(void); /* * Returns 1 if the given year is a leap year, 0 otherwise. diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index dbbabbc99..4f031d55d 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -49,6 +49,7 @@ maintainer email: oliphant.travis@ieee.org #include "getset.h" #include "sequence.h" #include "buffer.h" +#include "array_assign.h" /*NUMPY_API Compute the size of an array (in number of items) @@ -1464,8 +1465,6 @@ NPY_NO_EXPORT npy_bool PyArray_CheckStrides(int elsize, int nd, npy_intp numbytes, npy_intp offset, npy_intp *dims, npy_intp *newstrides) { - int i; - npy_intp max_axis_offset; npy_intp begin, end; npy_intp lower_offset; npy_intp upper_offset; diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c index c083a00f0..c75ac012a 100644 --- a/numpy/core/src/multiarray/calculation.c +++ b/numpy/core/src/multiarray/calculation.c @@ -14,6 +14,7 @@ #include "number.h" #include "calculation.h" +#include "array_assign.h" static double power_of_ten(int n) diff --git a/numpy/core/src/multiarray/convert.h b/numpy/core/src/multiarray/convert.h index de24e27cf..96df19711 100644 --- a/numpy/core/src/multiarray/convert.h +++ b/numpy/core/src/multiarray/convert.h @@ -1,4 +1,8 @@ #ifndef _NPY_ARRAYOBJECT_CONVERT_H_ #define _NPY_ARRAYOBJECT_CONVERT_H_ +NPY_NO_EXPORT int +PyArray_AssignZero(PyArrayObject *dst, + PyArrayObject *wheremask); + #endif diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index 957a74fde..8cdd65d7b 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -141,7 +141,7 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype, { PyArray_DatetimeMetaData *meta; int flex_type_num; - PyArrayObject *arr = NULL, *ret; + PyArrayObject *arr = NULL; PyArray_Descr *dtype = NULL; int ndim = 0; npy_intp dims[NPY_MAXDIMS]; diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 4adecf193..373e17425 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -1319,7 +1319,7 @@ PyArray_LexSort(PyObject *sort_keys, int axis) } if (!PyArray_DESCR(mps[i])->f->argsort[NPY_MERGESORT]) { PyErr_Format(PyExc_TypeError, - "merge sort not available for item %d", i); + "merge sort not available for item %zd", i); goto fail; } if (!object diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index dd6d44003..a1c9e7c30 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -51,6 +51,7 @@ NPY_NO_EXPORT int NPY_NUMUSERTYPES = 0; #include "item_selection.h" #include "shape.h" #include "ctors.h" +#include "array_assign.h" /* Only here for API compatibility */ NPY_NO_EXPORT PyTypeObject PyBigArray_Type; @@ -338,7 +339,7 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis) axis += ndim; } - if (ndim == 1 & axis != 0) { + if (ndim == 1 && axis != 0) { char msg[] = "axis != 0 for ndim == 1; this will raise an error in " "future versions of numpy"; if (DEPRECATE(msg) < 0) { diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c index a40cbc7bc..8a1e3c9a1 100644 --- a/numpy/core/src/multiarray/nditer_constr.c +++ b/numpy/core/src/multiarray/nditer_constr.c @@ -1027,7 +1027,6 @@ npyiter_prepare_one_operand(PyArrayObject **op, if (PyArray_Check(*op)) { - npy_uint32 tmp; if ((*op_itflags) & NPY_OP_ITFLAG_WRITE && PyArray_FailUnlessWriteable(*op, "operand array with iterator " diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c index b0afdc6d9..54a9d5671 100644 --- a/numpy/core/src/multiarray/ucsnarrow.c +++ b/numpy/core/src/multiarray/ucsnarrow.c @@ -13,6 +13,7 @@ #include "npy_config.h" #include "npy_pycompat.h" +#include "ctors.h" /* * Functions only needed on narrow builds of Python for converting back and diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index b87d9b405..11716dd46 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -1381,7 +1381,7 @@ NONZERO_NAME(@name@_)(PyObject *a) static int -emit_complexwarning() +emit_complexwarning(void) { static PyObject *cls = NULL; if (cls == NULL) { diff --git a/numpy/core/src/umath/test_rational.c.src b/numpy/core/src/umath/test_rational.c.src index f9153b87c..8c4caec46 100644 --- a/numpy/core/src/umath/test_rational.c.src +++ b/numpy/core/src/umath/test_rational.c.src @@ -1138,7 +1138,6 @@ PyMODINIT_FUNC inittest_rational(void) { PyObject* numpy_str; PyObject* numpy; int npy_rational; - PyObject* gufunc; import_array(); if (PyErr_Occurred()) { diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 1bf56a0f0..85c0069c3 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -727,7 +727,7 @@ static int get_ufunc_arguments(PyUFuncObject *ufunc, int *out_subok, PyArrayObject **out_wheremask) { - int i, nargs, nin = ufunc->nin, nout = ufunc->nout; + int i, nargs, nin = ufunc->nin; PyObject *obj, *context; PyObject *str_key_obj = NULL; char *ufunc_name; @@ -1743,7 +1743,6 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, /* The strides which get passed to the inner loop */ npy_intp *inner_strides = NULL; - npy_intp *inner_strides_tmp, *ax_strides_tmp[NPY_MAXDIMS]; /* The sizes of the core dimensions (# entries is ufunc->core_num_dim_ix) */ npy_intp *core_dim_sizes = inner_dimensions + 1; int core_dim_ixs_size; @@ -1875,7 +1874,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, PyErr_Format(PyExc_ValueError, "%s: Operand %d has a mismatch in its core " "dimension %d, with gufunc signature %s " - "(size %d is different from %d)", + "(size %zd is different from %zd)", ufunc_name, i, idim, ufunc->core_signature, op_dim_size, core_dim_sizes[core_dim_index]); retval = -1; @@ -2081,7 +2080,6 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, /* Copy the strides after the first nop */ idim = nop; for (i = 0; i < nop; ++i) { - int dim_offset = ufunc->core_offsets[i]; int num_dims = ufunc->core_num_dims[i]; int core_start_dim = PyArray_NDIM(op[i]) - num_dims; /* |