From 36f6c617764efb1e22ed1af37706f8bf2dedf47f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 24 Sep 2017 12:04:23 +0200 Subject: 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 --- tools/pm/DocsParser.pm | 16 ++++++++++------ 1 file 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) { -- cgit v1.2.1