Skip to content
Snippets Groups Projects
Commit dee8fe3d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[j.5] Fix size detection of numeric types (backport from main, closed #951) ()

Merging branch 'j.5'  into 'r21'.

See merge request !2543
parents 2d7e2aa7 55fea5ab
No related branches found
No related tags found
1 merge request!2543Fix size detection of numeric types (backport from main, closed #951)
Pipeline #141419 passed
...@@ -379,12 +379,12 @@ std::vector<double> PyInterpreter::Numpy::createVectorFromArray2D(PyObject* pyob ...@@ -379,12 +379,12 @@ std::vector<double> PyInterpreter::Numpy::createVectorFromArray2D(PyObject* pyob
// prevent the error from Windows compiler MSVC 19: // prevent the error from Windows compiler MSVC 19:
// `error C2196: case value 'NPY_LONG' already used` // `error C2196: case value 'NPY_LONG' already used`
#ifndef _WIN32 #if NPY_LONG != NPY_INT32
case NPY_LONG: case NPY_LONG:
_realArray2DToDouble<npy_long>(npArray_ptr, rowIdxMax, colIdxMax, data); _realArray2DToDouble<npy_long>(npArray_ptr, rowIdxMax, colIdxMax, data);
break; break;
#endif // _WIN32 #endif
// unsigned int // unsigned int
case NPY_UINT8: case NPY_UINT8:
...@@ -399,11 +399,11 @@ std::vector<double> PyInterpreter::Numpy::createVectorFromArray2D(PyObject* pyob ...@@ -399,11 +399,11 @@ std::vector<double> PyInterpreter::Numpy::createVectorFromArray2D(PyObject* pyob
// prevent the error from Windows compiler MSVC 19: // prevent the error from Windows compiler MSVC 19:
// `error C2196: case value 'NPY_ULONG' already used` // `error C2196: case value 'NPY_ULONG' already used`
#ifndef _WIN32 #if NPY_ULONG != NPY_UINT32
case NPY_ULONG: case NPY_ULONG:
_realArray2DToDouble<npy_ulong>(npArray_ptr, rowIdxMax, colIdxMax, data); _realArray2DToDouble<npy_ulong>(npArray_ptr, rowIdxMax, colIdxMax, data);
break; break;
#endif // _WIN32 #endif
default: default:
throw std::runtime_error(errorDescription("PyInterpreter::Numpy: " throw std::runtime_error(errorDescription("PyInterpreter::Numpy: "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment