From 1dacacf9a31e320dc2239e5e4a4ca8f8c11887b2 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Thu, 23 Feb 2017 00:48:52 +0000 Subject: [PATCH] BUG: Use int for axes, not intp Rationale: typeof(PyArray_Dims.len) is int, so typeof(axis) should be the same. --- numpy/core/src/multiarray/shape.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c index 5207513bf531..a5960044efa9 100644 --- a/numpy/core/src/multiarray/shape.c +++ b/numpy/core/src/multiarray/shape.c @@ -680,9 +680,9 @@ PyArray_SwapAxes(PyArrayObject *ap, int a1, int a2) NPY_NO_EXPORT PyObject * PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute) { - npy_intp *axes, axis; - npy_intp i, n; - npy_intp permutation[NPY_MAXDIMS], reverse_permutation[NPY_MAXDIMS]; + npy_intp *axes; + int i, n; + int permutation[NPY_MAXDIMS], reverse_permutation[NPY_MAXDIMS]; PyArrayObject *ret = NULL; int flags; @@ -704,7 +704,7 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute) reverse_permutation[i] = -1; } for (i = 0; i < n; i++) { - axis = axes[i]; + int axis = axes[i]; if (check_and_adjust_axis(&axis, PyArray_NDIM(ap)) < 0) { return NULL; }