[glibmm] gmmproc: Suppress the @return section if return type is void
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Suppress the @return section if return type is void
- Date: Sun, 24 Sep 2017 10:07:03 +0000 (UTC)
commit 9d53a2ab2d74a172b56476f8802bd4cab549be40
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Sun Sep 24 10:59:25 2017 +0200
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 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index 23f9728..1eb0327 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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]