diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2017-09-24 12:04:23 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2017-09-24 12:04:23 +0200 |
commit | 36f6c617764efb1e22ed1af37706f8bf2dedf47f (patch) | |
tree | 0c4bd5d8947e3a8faf68325b22036b866676a6b3 | |
parent | 2dd089653344c872523cdad9137b7fa1d280186c (diff) | |
download | glibmm-36f6c617764efb1e22ed1af37706f8bf2dedf47f.tar.gz |
gmmproc: Suppress the @return section if return type is void
If the wrapped C function returns a value, but the corresponding C++ method
returns void, _WRAP_METHOD() suppresses the @return section in the
documentation. Bug 787978
-rw-r--r-- | tools/pm/DocsParser.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 047aff49..e9f308b3 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -328,10 +328,12 @@ sub lookup_enum_documentation($$$$$$$) } # $strCommentBlock lookup_documentation($strFunctionName, $deprecation_docs, $newin, $objCppfunc) -# The final objCppfunc parameter is optional. If passed, it is used to -# decide if the final C parameter should be omitted if the C++ method -# has a slot parameter. It is also used for converting C parameter names to -# C++ parameter names in the documentation, if they differ. +# The final objCppfunc parameter is optional. If passed, it is used for +# - deciding if the final C parameter shall be omitted if the C++ method +# has a slot parameter, +# - converting C parameter names to C++ parameter names in the documentation, +# if they differ, +# - deciding if the @return section shall be omitted. sub lookup_documentation($$$;$) { my ($functionName, $deprecation_docs, $newin, $objCppfunc) = @_; @@ -364,8 +366,10 @@ sub lookup_documentation($$$;$) } my %param_name_mappings = DocsParser::append_parameter_docs($objFunction, \$text, $objCppfunc); - DocsParser::append_return_docs($objFunction, \$text); - + if (!(defined($objCppfunc) && $$objCppfunc{rettype} eq "void")) + { + DocsParser::append_return_docs($objFunction, \$text); + } # Convert C parameter names to C++ parameter names where they differ. foreach my $key (keys %param_name_mappings) { |