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 619545 - gobject-introspection can't express non-primitive-array containers' element types
gobject-introspection can't express non-primitive-array containers' element t...
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 618660
 
 
Reported: 2010-05-24 18:59 UTC by Travis Reitter
Modified: 2015-02-07 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[scanner] Element-type annotation for GArray types (4.85 KB, patch)
2010-05-27 03:09 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review

Description Travis Reitter 2010-05-24 18:59:35 UTC
This annotated GLib/C code fragment:

/**
 * Returns: (element-type GLib.Value) the value
 */
 GPtrArray * get_values (Foo *src) {}

ends up with this .gir fragment for its return type:

<array name="GLib.PtrArray" c:type="GPtrArray*">
    <type name="GLib.Value"/>
</array>

which maps to the C type "GValue*[]" (and Vala type "GLib.Value[]").

However, the real return type is "GLib.PtrArray of GLib.Value elements" (Vala type GLib.PtrArray<GLib.Value>).

So my proposal is that the g-i scanner instead generate this GIR fragment from the annotated code above:

<type name="GLib.PtrArray" c:type="GPtrArray*">
    <type name="GLib.Value" c:type="GValue*"/>
</type>

For types that truly are primitive arrays, the element-type will correspond to the C type. Eg,

/**
 * Returns: (element-type GLib.Value) the value
 */
 GValue ** get_values_primitive_array (Foo *src) {}

which should result in the GIR fragment

<array name="GLib.Value" c:type="GValue*"></array>
Comment 1 Travis Reitter 2010-05-26 23:44:05 UTC
Johan, any chance you could take a look at this?

It's the end of a chain of a few bugs blocking a release of libfolks, which is proposed as a new external dependency for Empathy for Gnome 3.0.0.
Comment 2 Johan (not receiving bugmail) Dahlin 2010-05-27 03:09:57 UTC
Created attachment 162068 [details] [review]
[scanner] Element-type annotation for GArray types

Add support for (element-type) annotations for G*Array
types.
Comment 3 Johan (not receiving bugmail) Dahlin 2010-05-27 13:12:59 UTC
Attachment 162068 [details] pushed as e77f99f - [scanner] Element-type annotation for GArray types
Comment 4 André Klapper 2015-02-07 16:53:08 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]