1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Merge pull request #13889 from mshabunin:enable-narrowing-warning

* Enabled -Wnarrowing warning

* Fixed type narrowing issues

* Cast python constants

* Use long long for python constants

* Use int for python constants with fallback to long

* Update cv2.cpp
This commit is contained in:
Maksim Shabunin
2019-02-26 13:15:59 +03:00
committed by Alexander Alekhin
parent 5421d0866b
commit 8c1e0537ec
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -1838,7 +1838,7 @@ static PyMethodDef special_methods[] = {
struct ConstDef
{
const char * name;
long val;
long long val;
};
static void init_submodule(PyObject * root, const char * name, PyMethodDef * methods, ConstDef * consts)
@@ -1877,7 +1877,7 @@ static void init_submodule(PyObject * root, const char * name, PyMethodDef * met
}
for (ConstDef * c = consts; c->name != NULL; ++c)
{
PyDict_SetItemString(d, c->name, PyInt_FromLong(c->val));
PyDict_SetItemString(d, c->name, PyLong_FromLongLong(c->val));
}
}