GNOME Bugzilla – Bug 561087
Respect is_pointer in serialize_type()
Last modified: 2015-02-07 16:52:11 UTC
Add a '*' to the serialization for the cases where we set is_pointer in the type blob we write out depending on node->is_pointer. Don't add the '*' in the cases where is_pointer is set or not set in a fixed fashion. == This patch is needed to avoid having pointer and non-pointer types collapsed together in the typelib. (is_pointer in that type would depend on whatever is referenced first.)
Created attachment 122808 [details] [review] Respect is_pointer in serialize_type()
What do you think about removing is_pointer completely? Proposal here and in following comments: http://bugzilla.gnome.org/show_bug.cgi?id=560241#c2 In short: Add GI_TYPE_TAG_ANY to replace current usage of NONE+is_pointer, add g_type_tag_is_reference and add g_field_info_is_reference.
A) I would be really delighted if I could get my struct field work for gobject-introspection and gjs working and landed before we start changing stuff around in this area. B) I don't think anything should be landed without a table in the docs, that lays out what exactly the C type/ABI is for each combination of: type tag interface type (for the interface type tag) direction parameter / return value / field is_reference flag (You can keep it basically 2D if you do type-tag+interface type vs. direction+parameter+is_reference) In fact, I think making that table is a first step which would allow determination whether is_reference in FieldBlob is sufficient. (I expressed some concern in IRC the other day about passing/returning structures by value. The utility of being able to map that is a judgement call. But aside from that...) (Aside: your ANY should be POINTER, I think. It's not a variant, it's just an uninterpreted, unusable, C language pointer.)
On A) after thinking about it a bit, I agree we should land your work first. That will give us something to test for when we refactor internals later. On B), let's discuss in http://bugzilla.gnome.org/show_bug.cgi?id=561099
Committed.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]