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 561087 - Respect is_pointer in serialize_type()
Respect is_pointer in serialize_type()
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal trivial
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-11-16 18:16 UTC by Owen Taylor
Modified: 2015-02-07 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Respect is_pointer in serialize_type() (1.32 KB, patch)
2008-11-16 18:16 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2008-11-16 18:16:36 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.)
Comment 1 Owen Taylor 2008-11-16 18:16:40 UTC
Created attachment 122808 [details] [review]
Respect is_pointer in serialize_type()
Comment 2 Colin Walters 2008-11-16 19:22:22 UTC
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.
Comment 3 Owen Taylor 2008-11-16 19:54:03 UTC
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.)
Comment 4 Colin Walters 2008-11-16 20:14:14 UTC
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
Comment 5 Owen Taylor 2008-11-16 21:21:14 UTC
Committed.
Comment 6 André Klapper 2015-02-07 16:52:11 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]