Fixed several warnings on various platforms

This commit is contained in:
Andrey Kamaev
2012-04-11 11:11:39 +00:00
parent 07f8bf9226
commit b756033206
14 changed files with 25 additions and 19 deletions

View File

@@ -376,8 +376,9 @@ static bool pyopencv_to(PyObject* obj, uchar& value, const char* name = "<unknow
{
if(!obj || obj == Py_None)
return true;
value = (int)PyInt_AsLong(obj);
return value != -1 || !PyErr_Occurred();
int ivalue = (int)PyInt_AsLong(obj);
value = cv::saturate_cast<uchar>(ivalue);
return ivalue != -1 || !PyErr_Occurred();
}
static PyObject* pyopencv_from(double value)