diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 13:42:12 +0200 |
commit | 3dd32863337ea2f6308ebf2f7656795d3fd488c9 (patch) | |
tree | 08a3b35607dee19536ccb5f21b2ede0fdc41cc79 /sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp | |
parent | 4f4f1be9f46e02e87357aeee613cfd5ea0be8220 (diff) | |
parent | 67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp index 8bc680796..996968fa1 100644 --- a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp +++ b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp @@ -138,7 +138,7 @@ static bool isPrimitiveArray(PyObject *pyIn, int expectedNpType) { if (!PyArray_Check(pyIn)) return false; - PyArrayObject *pya = reinterpret_cast<PyArrayObject *>(pyIn); + auto *pya = reinterpret_cast<PyArrayObject *>(pyIn); if (debugNumPy) { std::cerr << __FUNCTION__ << "(expectedNpType=" << expectedNpType; if (const char *name = npTypeName(expectedNpType)) @@ -176,7 +176,7 @@ static inline bool primitiveArrayCheck1(PyObject *pyIn, int expectedNpType, int if (!isPrimitiveArray<1>(pyIn, expectedNpType)) return false; if (expectedSize >= 0) { - PyArrayObject *pya = reinterpret_cast<PyArrayObject *>(pyIn); + auto *pya = reinterpret_cast<PyArrayObject *>(pyIn); const int size = int(PyArray_DIMS(pya)[0]); if (size < expectedSize) { warning(PyExc_RuntimeWarning, 0, "A numpy array of size %d was passed to a function expects %d.", @@ -191,8 +191,8 @@ static inline bool primitiveArrayCheck1(PyObject *pyIn, int expectedNpType, int template <class T> static void convertArray1(PyObject *pyIn, void *cppOut) { - ArrayHandle<T> *handle = reinterpret_cast<ArrayHandle<T> *>(cppOut); - PyArrayObject *pya = reinterpret_cast<PyArrayObject *>(pyIn); + auto *handle = reinterpret_cast<ArrayHandle<T> *>(cppOut); + auto *pya = reinterpret_cast<PyArrayObject *>(pyIn); const npy_intp size = PyArray_DIMS(pya)[0]; if (debugNumPy) std::cerr << __FUNCTION__ << ' ' << size << '\n'; @@ -204,8 +204,8 @@ template <class T> static void convertArray2(PyObject *pyIn, void *cppOut) { typedef typename Array2Handle<T, 1>::RowType RowType; - Array2Handle<T, 1> *handle = reinterpret_cast<Array2Handle<T, 1> *>(cppOut); - PyArrayObject *pya = reinterpret_cast<PyArrayObject *>(pyIn); + auto *handle = reinterpret_cast<Array2Handle<T, 1> *>(cppOut); + auto *pya = reinterpret_cast<PyArrayObject *>(pyIn); handle->setData(reinterpret_cast<RowType *>(PyArray_DATA(pya))); } @@ -220,7 +220,7 @@ static inline bool primitiveArrayCheck2(PyObject *pyIn, int expectedNpType, int if (!isPrimitiveArray<2>(pyIn, expectedNpType)) return false; if (expectedDim2 >= 0) { - PyArrayObject *pya = reinterpret_cast<PyArrayObject *>(pyIn); + auto *pya = reinterpret_cast<PyArrayObject *>(pyIn); const int dim1 = int(PyArray_DIMS(pya)[0]); const int dim2 = int(PyArray_DIMS(pya)[1]); if (dim1 != expectedDim1 || dim2 != expectedDim2) { |