Merge pull request #12673 from alalek:fix_build_warnings

* fix build warnings

* python: forbid wrapping of functions with "void*" arguments
pull/12653/head
Alexander Alekhin 6 years ago committed by GitHub
parent a8b0db4e5d
commit 5575171652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/core/include/opencv2/core/cuda.hpp
  2. 2
      modules/python/src2/cv2.cpp
  3. 5
      modules/python/src2/gen2.py

@ -134,8 +134,8 @@ public:
CV_WRAP GpuMat(const GpuMat& m);
//! 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);
CV_WRAP GpuMat(Size size, 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);
GpuMat(Size size, int type, void* data, size_t step = Mat::AUTO_STEP);
//! creates a GpuMat header for a part of the bigger matrix
CV_WRAP GpuMat(const GpuMat& m, Range rowRange, Range colRange);

@ -92,7 +92,7 @@ bool pyopencv_to(PyObject* dst, TYPE& src, const char* name)
{ \
if (!dst || dst == Py_None) \
return true; \
std::underlying_type<TYPE>::type underlying; \
std::underlying_type<TYPE>::type underlying = 0; \
\
if (!pyopencv_to(dst, underlying, name)) return false; \
src = static_cast<TYPE>(underlying); \

@ -10,6 +10,8 @@ if sys.version_info[0] >= 3:
else:
from cStringIO import StringIO
forbidden_arg_types = ["void*"]
ignored_arg_types = ["RNG*"]
pass_by_val_types = ["Point*", "Point2f*", "Rect*", "String*", "double*", "float*", "int*"]
@ -483,6 +485,7 @@ class FuncVariant(object):
argno += 1
if a.name in self.array_counters:
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:
continue
if a.returnarg:
@ -671,7 +674,7 @@ class FuncInfo(object):
if a.tp in ignored_arg_types:
defval = a.defval
if not defval and a.tp.endswith("*"):
defval = 0
defval = "0"
assert defval
if not code_args.endswith("("):
code_args += ", "

Loading…
Cancel
Save