GNOME Bugzilla – Bug 724432
g-ir-scanner maps unsigned char* to guint8
Last modified: 2018-02-08 12:26:42 UTC
g-ir-scanner (1.38.0) maps unsigned char* to guint8 I would have expected gpointer or something like that. a header file containing the following line void unsignedchar_test(unsigned char* data); is transformed to this block: <function name="test" c:identifier="unsignedchar_test"> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> </return-value> <parameters> <parameter name="data" transfer-ownership="none"> <type name="guint8" c:type="unsigned char*"/> </parameter> </parameters> </function>
While it is obviously wrong, I'm not sure what should be expected. Is this an out argument or is it an input buffer? Either case can be annotated explicitly: /** * test_unsignedchar: * @data: (out caller-allocates): **/ or /** * test_unsignedchar: * @data: (array zero-terminated=1): **/ See: https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations If anything I think the scanner should probably generate an error and skip the method due to the ambiguity.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/105.