GNOME Bugzilla – Bug 638929
array elements lack correct is_pointer
Last modified: 2015-02-07 16:50:05 UTC
For arrays containing pointers, the gir lacks enough information for the compiler to know whether the elements are pointers or not. For example: <array c:type="GVariant**"> <type name="GLib.Variant"/> </array> This produces an array containing GVariant instead of GVariant* But this: <array c:type="GVariant**"> <type name="GLib.Variant" c:type="GVariant*"/> </array> Correctly compiles to a contained type with is_pointer == 1. There's a patch for the tests that reproduces it in https://bugzilla.gnome.org/show_bug.cgi?id=638915
I can confirm that adding c:type="GVariant*" makes this work for me as well
Created attachment 178844 [details] [review] Preserve the c:type of array elements So the element type has the correct is_pointer flag
Review of attachment 178844 [details] [review]: One small change, then feel free to commit. ::: giscanner/maintransformer.py @@ +327,3 @@ element_type_node = node.type.clone() + # The element's ctype is the array's dereferenced + element_type_node.ctype = element_type_node.ctype[:-1] I'd prefer a check here that the last character is actually a '*', like: if element_type_node.ctype.endswith('*'): element_type_node.ctype = element_type_node.ctype[:-1]
Attachment 178844 [details] pushed as 751a9fa - Preserve the c:type of array elements
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]