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 771790 - Markup.collect_attributes should have attribute_names and _values bound as null-terminated
Markup.collect_attributes should have attribute_names and _values bound as nu...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GLib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-21 20:56 UTC by Jens Georg
Modified: 2016-09-23 17:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-2.0: Fix binding of Markup.collect_attributes (1.17 KB, patch)
2016-09-22 18:04 UTC, Jens Georg
committed Details | Review

Description Jens Georg 2016-09-21 20:56:46 UTC
Currently, it generates code like:

	g_markup_collect_attributes (_tmp2_, _tmp3_, _tmp3__length1, _tmp4_, _tmp4__length1, &_inner_error_, G_MARKUP_COLLECT_BOOLEAN, "Assigned", &assigned, G_MARKUP_COLLECT_INVALID);
Comment 1 Jens Georg 2016-09-22 18:04:10 UTC
Created attachment 336100 [details] [review]
glib-2.0: Fix binding of Markup.collect_attributes

Array parameters don't have an associcated length parameter but are
null-terminated.
Comment 2 Al Thomas 2016-09-22 19:07:41 UTC
Review of attachment 336100 [details] [review]:

Matches documented API:
https://developer.gnome.org/glib/stable/glib-Simple-XML-Subset-Parser.html#g-markup-collect-attributes
Docs state "The element_name , attribute_names , attribute_values and error parameters passed to the start_element callback should be passed unmodified to this function." and from the start_element callback "The callback's attribute_names and attribute_values parameters are NULL-terminated."
Comment 3 Al Thomas 2016-09-22 19:14:30 UTC
Review of attachment 336100 [details] [review]:

Why is array_length = false necessary. See https://wiki.gnome.org/Projects/Vala/LegacyBindings#Arrays
Comment 4 Jens Georg 2016-09-22 19:23:08 UTC
Because just having the array_null_terminated = true annotation does not make the array_length parameter disappear
Comment 5 Al Thomas 2016-09-22 19:28:03 UTC
Review of attachment 336100 [details] [review]:

> Because just having the array_null_terminated = true annotation does not make the array_length parameter disappear

OK, that's useful to know
Comment 6 Jens Georg 2016-09-23 17:31:23 UTC
Attachment 336100 [details] pushed as 34f3b85 - glib-2.0: Fix binding of Markup.collect_attributes