summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-04-23 12:26:59 -0700
committerMark Wiebe <mwwiebe@gmail.com>2011-04-23 12:40:02 -0700
commit566ace25f63985e0739bcc600c35336d3c66508c (patch)
tree34e76d58054dbc445d22213b2bdb59a2e65c8d8c /numpy
parent7f5130a7ac41e93066f60d80203a0b8ea675c0c9 (diff)
downloadnumpy-566ace25f63985e0739bcc600c35336d3c66508c.tar.gz
WRN: Fix gcc warnings (4.6.0 with "-Wall -Wno-unused-function")
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src1
-rw-r--r--numpy/core/src/multiarray/item_selection.c2
-rw-r--r--numpy/core/src/multiarray/iterators.c2
-rw-r--r--numpy/core/src/multiarray/nditer.c.src29
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c4
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src3
-rw-r--r--numpy/core/src/umath/ufunc_object.c9
7 files changed, 14 insertions, 36 deletions
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index e37b88fdd..fde95c4cb 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -612,7 +612,6 @@ VOID_getitem(char *ip, PyArrayObject *ap)
return ret;
}
-finish:
if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT)
|| PyDataType_FLAGCHK(descr, NPY_ITEM_IS_POINTER)) {
PyErr_SetString(PyExc_ValueError,
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 3b3a0a5ae..3b57b4c3d 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1786,7 +1786,6 @@ PyArray_Nonzero(PyArrayObject *self)
NpyIter_IterNextFunc *iternext;
NpyIter_GetMultiIndexFunc *get_multi_index;
char **dataptr;
- npy_intp *innersizeptr;
/* Allocate the result as a 2D array */
ret_dims[0] = nonzero_count;
@@ -1845,7 +1844,6 @@ PyArray_Nonzero(PyArrayObject *self)
return NULL;
}
dataptr = NpyIter_GetDataPtrArray(iter);
- innersizeptr = NpyIter_GetInnerLoopSizePtr(iter);
multi_index = (npy_intp *)PyArray_DATA(ret);
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index cc2a0b6cd..eed4c46c9 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -889,13 +889,11 @@ static int
iter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,
PyArrayIterObject *val, int swap)
{
- PyArray_Descr *typecode;
npy_intp num;
PyArrayIterObject *ind_it;
npy_intp index;
PyArray_CopySwapFunc *copyswap;
- typecode = self->ao->descr;
copyswap = self->ao->descr->f->copyswap;
if (ind->nd == 0) {
num = *((npy_intp *)ind->data);
diff --git a/numpy/core/src/multiarray/nditer.c.src b/numpy/core/src/multiarray/nditer.c.src
index 4475ca965..64a7f5e8a 100644
--- a/numpy/core/src/multiarray/nditer.c.src
+++ b/numpy/core/src/multiarray/nditer.c.src
@@ -1619,22 +1619,23 @@ static int
npyiter_iternext_itflags@tag_itflags@_dims@tag_ndim@_iters@tag_nop@(
NpyIter *iter)
{
+#if !(@const_itflags@&NPY_ITFLAG_EXLOOP) || (@const_ndim@ > 1)
const npy_uint32 itflags = @const_itflags@;
-#if @const_ndim@ >= NPY_MAXDIMS
+# if @const_ndim@ >= NPY_MAXDIMS
int idim, ndim = NIT_NDIM(iter);
-#endif
-#if @const_nop@ < NPY_MAXDIMS
+# endif
+# if @const_nop@ < NPY_MAXDIMS
const int nop = @const_nop@;
-#else
+# else
int nop = NIT_NOP(iter);
-#endif
+# endif
- npy_intp istrides, nstrides, sizeof_axisdata;
-#if @const_ndim@ > 0
NpyIter_AxisData *axisdata0;
+ npy_intp istrides, nstrides = NAD_NSTRIDES();
#endif
#if @const_ndim@ > 1
NpyIter_AxisData *axisdata1;
+ npy_intp sizeof_axisdata;
#endif
#if @const_ndim@ > 2
NpyIter_AxisData *axisdata2;
@@ -1647,10 +1648,13 @@ npyiter_iternext_itflags@tag_itflags@_dims@tag_ndim@_iters@tag_nop@(
}
#endif
- nstrides = NAD_NSTRIDES();
+#if @const_ndim@ > 1
sizeof_axisdata = NIT_AXISDATA_SIZEOF(itflags, ndim, nop);
+#endif
+# if !(@const_itflags@&NPY_ITFLAG_EXLOOP) || (@const_ndim@ > 1)
axisdata0 = NIT_AXISDATA(iter);
+# endif
# if !(@const_itflags@&NPY_ITFLAG_EXLOOP)
/* Increment index 0 */
NAD_INDEX(axisdata0)++;
@@ -1666,9 +1670,6 @@ npyiter_iternext_itflags@tag_itflags@_dims@tag_ndim@_iters@tag_nop@(
/* Finished when the index equals the shape */
return NAD_INDEX(axisdata0) < NAD_SHAPE(axisdata0);
# else
- /* Get rid of unused variable warning */
- istrides = 0;
-
return 0;
# endif
@@ -4335,14 +4336,13 @@ npyiter_find_best_axis_ordering(NpyIter *iter)
/* If this axis hasn't been touched yet, process it */
if (NAD_INDEX(ad_i) == 1) {
- npy_int8 pidim = perm[idim], qidim;
+ npy_int8 pidim = perm[idim];
npy_intp tmp;
NpyIter_AxisData *ad_p, *ad_q;
if (pidim != idim) {
/* Follow the cycle, copying the data */
for (i = 0; i < size; ++i) {
- qidim = (npy_int8)idim;
pidim = perm[idim];
ad_q = ad_i;
tmp = *((npy_intp*)ad_q + i);
@@ -4350,7 +4350,6 @@ npyiter_find_best_axis_ordering(NpyIter *iter)
ad_p = NIT_INDEX_AXISDATA(axisdata, pidim);
*((npy_intp*)ad_q + i) = *((npy_intp*)ad_p + i);
- qidim = pidim;
ad_q = ad_p;
pidim = perm[(int)pidim];
}
@@ -5347,7 +5346,6 @@ npyiter_copy_from_buffers(NpyIter *iter)
npy_intp reduce_outerdim = 0;
npy_intp *reduce_outerstrides = NULL;
- char **reduce_outerptrs = NULL;
PyArray_StridedTransferFn *stransfer = NULL;
void *transferdata = NULL;
@@ -5365,7 +5363,6 @@ npyiter_copy_from_buffers(NpyIter *iter)
if (itflags&NPY_ITFLAG_REDUCE) {
reduce_outerdim = NBF_REDUCE_OUTERDIM(bufferdata);
reduce_outerstrides = NBF_REDUCE_OUTERSTRIDES(bufferdata);
- reduce_outerptrs = NBF_REDUCE_OUTERPTRS(bufferdata);
reduce_outeraxisdata = NIT_INDEX_AXISDATA(axisdata, reduce_outerdim);
transfersize *= NBF_REDUCE_OUTERSIZE(bufferdata);
}
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index a0ddc2f5a..5227f9c1e 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -1417,8 +1417,6 @@ static PyObject *npyiter_value_get(NewNpyArrayIterObject *self)
PyObject *ret;
npy_intp iop, nop;
- PyArray_Descr **dtypes;
- char **dataptrs;
if (self->iter == NULL || self->finished) {
PyErr_SetString(PyExc_ValueError,
@@ -1427,8 +1425,6 @@ static PyObject *npyiter_value_get(NewNpyArrayIterObject *self)
}
nop = NpyIter_GetNOp(self->iter);
- dtypes = self->dtypes;
- dataptrs = self->dataptrs;
/* Return an array or tuple of arrays with the values */
if (nop == 1) {
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index bd12f58a0..58dc39861 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -1290,12 +1290,11 @@ gentype_byteswap(PyObject *self, PyObject *args)
else {
/* get the data, copyswap it and pass it to a new Array scalar */
char *data;
- int numbytes;
PyArray_Descr *descr;
PyObject *new;
char *newmem;
- numbytes = gentype_getreadbuf(self, 0, (void **)&data);
+ gentype_getreadbuf(self, 0, (void **)&data);
descr = PyArray_DescrFromScalar(self);
newmem = _pya_malloc(descr->elsize);
if (newmem == NULL) {
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 110d300fc..472c1b55e 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -3146,8 +3146,6 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
NpyIter_IterNextFunc *iternext;
char **dataptr;
- npy_intp *stride;
- npy_intp *count_ptr;
int itemsize = op_dtypes[0]->elsize;
@@ -3157,8 +3155,6 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
goto fail;
}
dataptr = NpyIter_GetDataPtrArray(iter);
- stride = NpyIter_GetInnerStrideArray(iter);
- count_ptr = NpyIter_GetInnerLoopSizePtr(iter);
/* Execute the loop with two nested iterators */
@@ -3696,8 +3692,6 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,
char **dataptr;
npy_intp count_m1;
npy_intp stride0, stride1;
- npy_intp *stride;
- npy_intp *count_ptr;
npy_intp stride0_ind = PyArray_STRIDE(op[0], axis);
int itemsize = op_dtypes[0]->elsize;
@@ -3708,9 +3702,6 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,
goto fail;
}
dataptr = NpyIter_GetDataPtrArray(iter);
- stride = NpyIter_GetInnerStrideArray(iter);
- count_ptr = NpyIter_GetInnerLoopSizePtr(iter);
-
/* Execute the loop with just the outer iterator */
count_m1 = PyArray_DIM(op[1], axis)-1;