[gimp] pdb: generate the (array length=foo) annotation with less hacks



commit 5ac8b70e47cc0d3488c001f14efff2a43b2ddc01
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 4 22:24:11 2019 +0200

    pdb: generate the (array length=foo) annotation with less hacks
    
    and more important: correctly.

 libgimp/gimpvectors_pdb.c | 2 +-
 pdb/lib.pl                | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimpvectors_pdb.c
index 11e927055d..a569ac2697 100644
--- a/libgimp/gimpvectors_pdb.c
+++ b/libgimp/gimpvectors_pdb.c
@@ -755,7 +755,7 @@ gimp_vectors_stroke_new_from_points (gint32                 vectors_ID,
  *
  * returns polygonal approximation of the stroke.
  *
- * Returns: (array length=coords) (element-type gdouble) (transfer full):
+ * Returns: (array length=num_coords) (element-type gdouble) (transfer full):
  *          List of the coords along the path (x0, y0, x1, y1, ...).
  *          The returned value must be freed with g_free().
  *
diff --git a/pdb/lib.pl b/pdb/lib.pl
index f9c46af92c..d804adfaef 100644
--- a/pdb/lib.pl
+++ b/pdb/lib.pl
@@ -105,11 +105,9 @@ sub generate {
        # Find the return argument (defaults to the first arg if not
        # explicitly set
        my $retarg  = undef;
-       my $retindex = 0;
        $retvoid = 0;
        foreach (@outargs) {
            $retarg = $_, last if exists $_->{retval};
-           $retindex++;
        }
 
        unless ($retarg) {
@@ -135,7 +133,7 @@ sub generate {
            $retarg->{retval} = 1;
 
            if (exists $argtype->{array}) {
-               $annotate = " (array length=@outargs[$retindex - 2]->{name})";
+               $annotate = " (array length=$retarg->{array}->{name})";
            }
 
            if (exists $argtype->{out_annotate}) {


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