Unverified Commit 55751716 authored by Alexander Alekhin's avatar Alexander Alekhin Committed by GitHub

Merge pull request #12673 from alalek:fix_build_warnings

* fix build warnings

* python: forbid wrapping of functions with "void*" arguments
parent a8b0db4e
...@@ -134,8 +134,8 @@ public: ...@@ -134,8 +134,8 @@ public:
CV_WRAP GpuMat(const GpuMat& m); CV_WRAP GpuMat(const GpuMat& m);
//! constructor for GpuMat headers pointing to user-allocated data //! constructor for GpuMat headers pointing to user-allocated data
CV_WRAP GpuMat(int rows, int cols, int type, void* data, size_t step = Mat::AUTO_STEP); GpuMat(int rows, int cols, int type, void* data, size_t step = Mat::AUTO_STEP);
CV_WRAP GpuMat(Size size, int type, void* data, size_t step = Mat::AUTO_STEP); GpuMat(Size size, int type, void* data, size_t step = Mat::AUTO_STEP);
//! creates a GpuMat header for a part of the bigger matrix //! creates a GpuMat header for a part of the bigger matrix
CV_WRAP GpuMat(const GpuMat& m, Range rowRange, Range colRange); CV_WRAP GpuMat(const GpuMat& m, Range rowRange, Range colRange);
......
...@@ -92,7 +92,7 @@ bool pyopencv_to(PyObject* dst, TYPE& src, const char* name) ...@@ -92,7 +92,7 @@ bool pyopencv_to(PyObject* dst, TYPE& src, const char* name)
{ \ { \
if (!dst || dst == Py_None) \ if (!dst || dst == Py_None) \
return true; \ return true; \
std::underlying_type<TYPE>::type underlying; \ std::underlying_type<TYPE>::type underlying = 0; \
\ \
if (!pyopencv_to(dst, underlying, name)) return false; \ if (!pyopencv_to(dst, underlying, name)) return false; \
src = static_cast<TYPE>(underlying); \ src = static_cast<TYPE>(underlying); \
......
...@@ -10,6 +10,8 @@ if sys.version_info[0] >= 3: ...@@ -10,6 +10,8 @@ if sys.version_info[0] >= 3:
else: else:
from cStringIO import StringIO from cStringIO import StringIO
forbidden_arg_types = ["void*"]
ignored_arg_types = ["RNG*"] ignored_arg_types = ["RNG*"]
pass_by_val_types = ["Point*", "Point2f*", "Rect*", "String*", "double*", "float*", "int*"] pass_by_val_types = ["Point*", "Point2f*", "Rect*", "String*", "double*", "float*", "int*"]
...@@ -483,6 +485,7 @@ class FuncVariant(object): ...@@ -483,6 +485,7 @@ class FuncVariant(object):
argno += 1 argno += 1
if a.name in self.array_counters: if a.name in self.array_counters:
continue continue
assert not a.tp in forbidden_arg_types, 'Forbidden type "{}" for argument "{}" in "{}" ("{}")'.format(a.tp, a.name, self.name, self.classname)
if a.tp in ignored_arg_types: if a.tp in ignored_arg_types:
continue continue
if a.returnarg: if a.returnarg:
...@@ -671,7 +674,7 @@ class FuncInfo(object): ...@@ -671,7 +674,7 @@ class FuncInfo(object):
if a.tp in ignored_arg_types: if a.tp in ignored_arg_types:
defval = a.defval defval = a.defval
if not defval and a.tp.endswith("*"): if not defval and a.tp.endswith("*"):
defval = 0 defval = "0"
assert defval assert defval
if not code_args.endswith("("): if not code_args.endswith("("):
code_args += ", " code_args += ", "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment