From c22dcb04af1793c94e399b1432a19e805ed751a4 Mon Sep 17 00:00:00 2001 From: Alexander Mordvintsev Date: Tue, 19 Aug 2014 14:57:47 +0400 Subject: [PATCH] fixing warnings --- modules/python/src2/cv2.cpp | 6 +++--- modules/python/src2/gen2.py | 2 +- modules/python/src2/hdr_parser.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index d71abba..f02ba5a 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -1192,7 +1192,7 @@ static int convert_to_char(PyObject *o, char *dst, const char *name = "no_name") #include "pyopencv_generated_types.h" #include "pyopencv_generated_funcs.h" -static PyMethodDef methods[] = { +static PyMethodDef special_methods[] = { {"createTrackbar", pycvCreateTrackbar, METH_VARARGS, "createTrackbar(trackbarName, windowName, value, count, onChange) -> None"}, {"setMouseCallback", (PyCFunction)pycvSetMouseCallback, METH_VARARGS | METH_KEYWORDS, "setMouseCallback(windowName, onMouse [, param]) -> None"}, {NULL, NULL}, @@ -1266,7 +1266,7 @@ static struct PyModuleDef cv2_moduledef = "Python wrapper for OpenCV.", -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ - methods + special_methods }; PyObject* PyInit_cv2() @@ -1283,7 +1283,7 @@ void initcv2() #if PY_MAJOR_VERSION >= 3 PyObject* m = PyModule_Create(&cv2_moduledef); #else - PyObject* m = Py_InitModule(MODULESTR, methods); + PyObject* m = Py_InitModule(MODULESTR, special_methods); #endif init_submodules(m); // from "pyopencv_generated_ns_reg.h" diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index 0c1ff64..e94d584 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -821,7 +821,7 @@ class PythonWrapperGenerator(object): self.code_ns_reg.write('static ConstDef consts_%s[] = {\n'%wname) for name, cname in sorted(ns.consts.items()): - self.code_ns_reg.write(' {"%s", %s},\n'%(name, cname)) + self.code_ns_reg.write(' {"%s", (long)(%s)},\n'%(name, cname)) self.code_ns_reg.write(' {NULL, NULL}\n};\n\n') def gen_namespaces_reg(self): diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index 5f989d6..e0f8ecf 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -883,4 +883,3 @@ if __name__ == '__main__': parser.print_decls(decls) print(len(decls)) print("namespaces:", " ".join(sorted(parser.namespaces))) - -- 2.7.4