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 616815 - GStrv not usable as struct field
GStrv not usable as struct field
Status: RESOLVED DUPLICATE of bug 620170
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-04-26 03:29 UTC by Danielle Madeley
Modified: 2015-02-07 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix GStrv as struct fields. (5.38 KB, patch)
2010-06-01 12:19 UTC, Tomeu Vizoso
none Details | Review

Description Danielle Madeley 2010-04-26 03:29:00 UTC
struct _TpAvatarRequirements
{
  GStrv supported_mime_types;
  guint minimum_width;
  guint minimum_height;
...
};

When running g-ir-compiler:

  ** WARNING **: field TelepathyGLib.AvatarRequirements.supported_mime_types has void type
  aborting...

GIR:

    <record name="AvatarRequirements"
            c:type="TpAvatarRequirements"
            doc="..."
            version="0.11.UNRELEASED"
            glib:type-name="TpAvatarRequirements"
            glib:get-type="tp_avatar_requirements_get_type">
      <field name="supported_mime_types" writable="1">
        <type name="GObject.Strv" c:type="GStrv"/>

Changing to using 'char **' works around this.
Comment 1 Tomeu Vizoso 2010-06-01 12:19:45 UTC
Created attachment 162451 [details] [review]
Fix GStrv as struct fields.

* gir/gimarshallingtests.[hc]: Add a test for struct fields of type GStrv

* girepository/giroffsets.c: Correctly compute the size of structs with
  array fields

* girepository/girparser.c: Set is_pointer to FALSE for arrays with
  fixed size inside structs.

* giscanner/glibtransformer.py: Special case GStrv fields as arrays
  of utf8.
Comment 2 Xavier Claessens 2010-06-01 12:44:20 UTC
Tested that patch with tp-glib API, and it indeed fix the compilation issue when I have GStrv in a struct.

I had to also apply the patch from bug #620247 to pygi to make it work in python code, otherwise it enters infinite loop.
Comment 3 Tomeu Vizoso 2010-06-01 15:42:30 UTC

*** This bug has been marked as a duplicate of bug 620170 ***
Comment 4 André Klapper 2015-02-07 16:57:10 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]