diff options
author | robot-piglet <[email protected]> | 2025-08-28 14:27:58 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-08-28 14:57:06 +0300 |
commit | 81d828c32c8d5477cb2f0ce5da06a1a8d9392ca3 (patch) | |
tree | 3081d566f0d5158d76e9093261344f6406fd09f7 /contrib/tools/swig/patches/fix-unused-parameter.patch | |
parent | 77ea11423f959e51795cc3ef36a48d808b4ffb98 (diff) |
Intermediate changes
commit_hash:d5b1af16dbe9030537a04c27eb410c88c2f496cd
Diffstat (limited to 'contrib/tools/swig/patches/fix-unused-parameter.patch')
-rw-r--r-- | contrib/tools/swig/patches/fix-unused-parameter.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/tools/swig/patches/fix-unused-parameter.patch b/contrib/tools/swig/patches/fix-unused-parameter.patch new file mode 100644 index 00000000000..9bff7c57c79 --- /dev/null +++ b/contrib/tools/swig/patches/fix-unused-parameter.patch @@ -0,0 +1,33 @@ +--- contrib/tools/swig/Source/Modules/python.cxx (index) ++++ contrib/tools/swig/Source/Modules/python.cxx (working tree) +@@ -2981,6 +2981,8 @@ public: + } else { + int is_tp_call = Equal(Getattr(n, "feature:python:slot"), "tp_call"); + Printv(f->def, linkage, wrap_return, wname, "(PyObject *self, PyObject *args", builtin_kwargs, ") {", NIL); ++ /* Avoid warning if the self parameter is not used. */ ++ Append(f->def, "(void)self;\n"); + if (builtin_ctor) + Printf(parse_args, "if (!SWIG_Python_CheckNoKeywords(kwargs, \"%s\")) SWIG_fail;\n", iname); + if (onearg && !builtin_ctor && !is_tp_call) { +--- contrib/tools/swig/Source/Modules/python.cxx (index) ++++ contrib/tools/swig/Source/Modules/python.cxx (working tree) +@@ -2977,6 +2977,8 @@ public: + } else { + Printv(f->def, linkage, wrap_return, wname, "(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {", NIL); + } ++ /* Avoid warning if the self parameter is not used. */ ++ Append(f->def, "(void)self;\n"); + Printf(parse_args, "if ((nobjs < %d) || (nobjs > %d)) SWIG_fail;\n", num_required, num_arguments); + } else { + int is_tp_call = Equal(Getattr(n, "feature:python:slot"), "tp_call"); +--- contrib/tools/swig/Source/Modules/python.cxx (index) ++++ contrib/tools/swig/Source/Modules/python.cxx (working tree) +@@ -2808,6 +2808,8 @@ public: + varargs = 0; + } + Printv(f->def, linkage, wrap_return, wname, "(PyObject *self, PyObject *args, PyObject *kwargs) {", NIL); ++ /* Avoid warning if the self parameter is not used. */ ++ Append(f->def, "(void)self;\n"); + } + + if (builtin) { |