After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 651773 - Lenght parameter for returned array is not recognized
Lenght parameter for returned array is not recognized
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: GObject Introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-03 10:49 UTC by Raul Gutierrez Segales
Modified: 2011-06-03 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Raul Gutierrez Segales 2011-06-03 10:49:59 UTC
Out param representing returned array's length is not being picked up. 

Given the following GIR definition :

      <method name="get_inlined" c:identifier="e_contact_photo_get_inlined">
        <doc xml:whitespace="preserve">Gets the @photo's data.
#EContactPhoto.</doc>
        <return-value transfer-ownership="none">
          <doc xml:whitespace="preserve">the inlined image in the</doc>
          <array length="0" c:type="guchar*">
            <type name="guint8" c:type="guchar"/>
          </array>
        </return-value>
        <parameters>
          <parameter name="len"
                     direction="out"
                     caller-allocates="1"
                     transfer-ownership="full">
            <doc xml:whitespace="preserve">the length of the inlined data</doc>
            <type name="gsize" c:type="gsize*"/>
          </parameter>
        </parameters>
      </method>

I get the following Wrong VAPI (the array is NOT null terminated and the array length IS given in the GIR):

   [CCode (array_length = false, array_null_terminated = true)]
   public unowned uint8[] get_inlined (out size_t len);
Comment 1 Luca Bruno 2011-06-03 12:03:58 UTC
commit 62d49650866540d30088fb6f15b218d55caf2a60
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Fri Jun 3 13:54:42 2011 +0200

    girparser: Handle array length index for return values
    
    Fixes bug 651773.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.