Mercurial > hg > vampy
diff PyTypeInterface.cpp @ 70:6c755f3e1173
More fixes
author | Chris Cannam |
---|---|
date | Mon, 17 Nov 2014 14:07:00 +0000 |
parents | 5664fe298af2 |
children | 40a01bb24209 |
line wrap: on
line diff
--- a/PyTypeInterface.cpp Mon Nov 17 12:53:51 2014 +0000 +++ b/PyTypeInterface.cpp Mon Nov 17 14:07:00 2014 +0000 @@ -182,11 +182,16 @@ setValueError("Error while converting integer object.",m_strict); return 0; } + // this test is nonsense -- neither part can occur + // owing to range of data types -- size_t is at least + // as big as long, and unsigned is always non-negative +/* if ((unsigned long)rValue > SIZE_T_MAX || (unsigned long)rValue < 0) { setValueError("Overflow error. Object can not be converted to size_t.",m_strict); return 0; } +*/ return (size_t) rValue; } @@ -717,7 +722,7 @@ std::string msg = "NumPy array must be a one dimensional vector."; setValueError(msg,m_strict); #ifdef _DEBUG - cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) pyArray->nd << endl; + cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) PyArray_NDIM(pyArray) << endl; #endif return Output; }