summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2017-09-24 10:59:25 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2017-09-24 10:59:25 +0200
commit9d53a2ab2d74a172b56476f8802bd4cab549be40 (patch)
tree11279a252cdcd2704132321c81d4a057ea30ef37 /tools
parentb93615bc5657ee571850cf76b3d415d46cefdbf8 (diff)
downloadglibmm-9d53a2ab2d74a172b56476f8802bd4cab549be40.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
Diffstat (limited to 'tools')
-rw-r--r--tools/pm/DocsParser.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index 23f97282..1eb0327c 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)
{