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 656031 - Improve GVariant annotations
Improve GVariant annotations
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.29.x
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-08-05 14:28 UTC by Pavel Holejsovsky
Modified: 2015-02-07 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which adds missing annotations (3.69 KB, patch)
2011-08-05 14:32 UTC, Pavel Holejsovsky
reviewed Details | Review
Add missing annotations (3.71 KB, patch)
2011-08-06 06:12 UTC, Pavel Holejsovsky
committed Details | Review

Description Pavel Holejsovsky 2011-08-05 14:28:04 UTC
Several GVariant annotations have problems:

g_variant_new_bytestring, g_variant_get_bytestring and g_variant_dup_bytestring need explicit element-type annotations, otherwise gi-scanner incorrectly infers utf8 element type.

(transfer none) annotation is missing on g_variant_get_data and g_variant_get_fixed_array

g_variant_type_string_scan is missing (out) annotation
Comment 1 Pavel Holejsovsky 2011-08-05 14:32:29 UTC
Created attachment 193312 [details] [review]
Patch which adds missing annotations
Comment 2 Colin Walters 2011-08-05 15:38:12 UTC
Review of attachment 193312 [details] [review]:

::: glib/gvariant.c
@@ +1591,3 @@
 /**
  * g_variant_new_bytestring:
+ * @string: (array zero-terminated=1) (element-type gchar): a normal

This should be guint8; I'd treat bytestrings as explicitly unsigned.

@@ +1616,3 @@
  * g_variant_get_bytestring:
  * @value: an array-of-bytes #GVariant instance
+ * @returns: (transfer none) (array zero-terminated=1) (element-type gchar):

Ditto.

@@ +1660,3 @@
  * @length: (out) (allow-none) (default NULL): a pointer to a #gsize, to store
  *          the length (not including the nul terminator)
+ * @returns: (transfer full) (array zero-terminated=1 length=length) (element-type gchar): a newly allocated string

Ditto.
Comment 3 Pavel Holejsovsky 2011-08-06 06:12:04 UTC
Created attachment 193339 [details] [review]
Add missing annotations

Thanks for review, new patch with gchar->guint8 change is here
Comment 4 Colin Walters 2011-08-06 08:25:03 UTC
Review of attachment 193339 [details] [review]:

Looks good.
Comment 5 Pavel Holejsovsky 2011-08-06 09:36:02 UTC
Review of attachment 193339 [details] [review]:

Committed
Comment 6 André Klapper 2015-02-07 17:01:28 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]