mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +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:
committed by
Alexander Alekhin
parent
5421d0866b
commit
8c1e0537ec
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user