[perl-Glib-Object-Introspection] perli11ndoc: properly handle callback fields without return value



commit 46622c88853721c7d7595e3a708d683a1699dd4b
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Mon Oct 2 13:20:40 2017 +0200

    perli11ndoc: properly handle callback fields without return value

 bin/perli11ndoc |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/bin/perli11ndoc b/bin/perli11ndoc
index 5282633..c42821f 100755
--- a/bin/perli11ndoc
+++ b/bin/perli11ndoc
@@ -255,9 +255,12 @@ sub find_type_name {
   if ($callback_list->size == 1) {
     my $callback = $callback_list->pop;
     my ($in, $retval, $out) = $self->find_parameters_and_return_value ($callback);
+    unshift @$out, $retval if defined $retval;
     my $in_list = join ', ', map { $self->find_type_name ($_) } @$in;
-    my $out_list = join ', ', map { $self->find_type_name ($_) } ($retval, @$out);
-    return "callback (in: $in_list; out: $out_list)";
+    my $out_list = join ', ', map { $self->find_type_name ($_) } @$out;
+    my $in_text = $in_list ne '' ? "in: $in_list" : '';
+    my $out_text = $out_list ne '' ? "; out: $out_list" : '';
+    return "callback ($in_text$out_text)";
   }
 
   # bare types


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]