summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2013-06-06 14:59:50 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2013-06-09 17:00:47 +0200
commita6a2c601c28687e8ff8b44f5319280b20a9c3f71 (patch)
treeb6066041de856eaed70c440078073ca7e65502f4 /numpy/core/src
parent0e9dccd0b8375a487b435411eb58f00d5d4a8bdc (diff)
downloadnumpy-a6a2c601c28687e8ff8b44f5319280b20a9c3f71.tar.gz
STY: Style fixes for integer deprecation changes
Also minor changes in the documentation.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarray/conversion_utils.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index 91243d1b7..267b502d9 100644
--- a/numpy/core/src/multiarray/conversion_utils.c
+++ b/numpy/core/src/multiarray/conversion_utils.c
@@ -191,7 +191,7 @@ PyArray_AxisConverter(PyObject *obj, int *axis)
*axis = NPY_MAXDIMS;
}
else {
- *axis = (int) PyArray_PyIntAsInt(obj);
+ *axis = PyArray_PyIntAsInt(obj);
if (PyErr_Occurred()) {
return NPY_FAIL;
}
@@ -812,7 +812,7 @@ PyArray_PyIntAsIntp(PyObject *o)
#if (NPY_SIZEOF_LONGLONG > NPY_SIZEOF_INTP)
if ((long_value < NPY_MIN_INTP) || (long_value > NPY_MAX_INTP)) {
PyErr_SetString(PyExc_OverflowError,
- "Python int too large to convert to C numpy.intp");
+ "Python int too large to convert to C numpy.intp");
return -1;
}
#endif
@@ -820,7 +820,7 @@ PyArray_PyIntAsIntp(PyObject *o)
#if (NPY_SIZEOF_LONG > NPY_SIZEOF_INTP)
if ((long_value < NPY_MIN_INTP) || (long_value > NPY_MAX_INTP)) {
PyErr_SetString(PyExc_OverflowError,
- "Python int too large to convert to C numpy.intp");
+ "Python int too large to convert to C numpy.intp");
return -1;
}
#endif
@@ -849,13 +849,15 @@ PyArray_IntpFromIndexSequence(PyObject *seq, npy_intp *vals, npy_intp maxvals)
*/
nd = PySequence_Length(seq);
if (nd == -1) {
- if (PyErr_Occurred()) PyErr_Clear();
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ }
vals[0] = PyArray_PyIntAsIntp(seq);
if(vals[0] == -1) {
err = PyErr_Occurred();
- if (err &&
- PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) {
+ if (err &&
+ PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) {
PyErr_SetString(PyExc_ValueError,
"Maximum allowed dimension exceeded");
}
@@ -876,8 +878,8 @@ PyArray_IntpFromIndexSequence(PyObject *seq, npy_intp *vals, npy_intp maxvals)
vals[i] = PyArray_PyIntAsIntp(op);
if(vals[i] == -1) {
err = PyErr_Occurred();
- if (err &&
- PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) {
+ if (err &&
+ PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) {
PyErr_SetString(PyExc_ValueError,
"Maximum allowed dimension exceeded");
}
@@ -892,13 +894,13 @@ PyArray_IntpFromIndexSequence(PyObject *seq, npy_intp *vals, npy_intp maxvals)
/*NUMPY_API
* PyArray_IntpFromSequence
- * Returns the number of dimensions or -1 if an error occurred.
+ * Returns the number of integers converted or -1 if an error occurred.
* vals must be large enough to hold maxvals
*/
NPY_NO_EXPORT int
PyArray_IntpFromSequence(PyObject *seq, npy_intp *vals, int maxvals)
{
- return (int)PyArray_IntpFromIndexSequence(seq, vals, (npy_intp)maxvals);
+ return PyArray_IntpFromIndexSequence(seq, vals, (npy_intp)maxvals);
}