diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-08-29 20:08:52 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-29 20:19:04 -0600 |
commit | f3e70d9c0ea5db74033be9f437bb8e275839c9dc (patch) | |
tree | 8c8f9a51a4ea43bb5bca10e82f21105682649c4d /numpy/lib/src | |
parent | 180750b9a4a4dc46be32ed6d738329b2ab97abfa (diff) | |
download | numpy-f3e70d9c0ea5db74033be9f437bb8e275839c9dc.tar.gz |
STY: Some style cleanups.
Diffstat (limited to 'numpy/lib/src')
-rw-r--r-- | numpy/lib/src/_compiled_base.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c index 155f29033..dd8cea16b 100644 --- a/numpy/lib/src/_compiled_base.c +++ b/numpy/lib/src/_compiled_base.c @@ -402,7 +402,7 @@ arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict) /* compute indx into input array */ rem_indx = mindx; indx = 0; - for(i = nd - 1; i > 0; --i) { + for (i = nd - 1; i > 0; --i) { indx += (rem_indx % inshape[i]) * instrides[i]; rem_indx /= inshape[i]; } @@ -646,35 +646,35 @@ ravel_multi_index_loop(int ravel_ndim, npy_intp *ravel_dims, j = *(npy_intp *)coords[i]; switch (modes[i]) { case NPY_RAISE: - if(j < 0 || j>=m) { + if (j < 0 || j >= m) { PyErr_SetString(PyExc_ValueError, "invalid entry in coordinates array"); return NPY_FAIL; } break; case NPY_WRAP: - if(j < 0) { + if (j < 0) { j += m; - if(j < 0) { - j = j%m; - if(j != 0) { + if (j < 0) { + j = j % m; + if (j != 0) { j += m; } } } - else if(j >= m) { + else if (j >= m) { j -= m; - if(j >= m) { - j = j%m; + if (j >= m) { + j = j % m; } } break; case NPY_CLIP: - if(j < 0) { + if (j < 0) { j = 0; } - else if(j >= m) { - j = m-1; + else if (j >= m) { + j = m - 1; } break; @@ -713,7 +713,7 @@ arr_ravel_multi_index(PyObject *self, PyObject *args, PyObject *kwds) memset(op, 0, sizeof(op)); dtype[0] = NULL; - if(!PyArg_ParseTupleAndKeywords(args, kwds, + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&|OO&:ravel_multi_index", kwlist, &coords0, PyArray_IntpConverter, &dimensions, @@ -728,7 +728,7 @@ arr_ravel_multi_index(PyObject *self, PyObject *args, PyObject *kwds) goto fail; } - if(!PyArray_ConvertClipmodeSequence(mode0, modes, dimensions.len)) { + if (!PyArray_ConvertClipmodeSequence(mode0, modes, dimensions.len)) { goto fail; } @@ -902,7 +902,7 @@ arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds) char *kwlist[] = {"indices", "dims", "order", NULL}; - if(!PyArg_ParseTupleAndKeywords(args, kwds, "OO&|O&:unravel_index", + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&|O&:unravel_index", kwlist, &indices0, PyArray_IntpConverter, &dimensions, @@ -918,10 +918,10 @@ arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds) unravel_size = PyArray_MultiplyList(dimensions.ptr, dimensions.len); - if(!PyArray_Check(indices0)) { + if (!PyArray_Check(indices0)) { indices = (PyArrayObject*)PyArray_FromAny(indices0, NULL, 0, 0, 0, NULL); - if(indices == NULL) { + if (indices == NULL) { goto fail; } } |