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 642293 - Incorrect parameter direction for "Pango.parse_markup" in "pango.vapi"
Incorrect parameter direction for "Pango.parse_markup" in "pango.vapi"
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-14 13:42 UTC by gawhelan
Modified: 2011-03-11 00:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for "pango.vapi" (936 bytes, patch)
2011-02-14 13:53 UTC, gawhelan
none Details | Review

Description gawhelan 2011-02-14 13:42:38 UTC
The file "pango.vapi" defines the method "Pango.parse_markup" with the final parameter as "unichar accel_char". According to the Pango docs (http://library.gnome.org/devel/pango/unstable/pango-Text-Attributes.html#pango-parse-markup) I believe it should be "out unichar accel_path".
Comment 1 gawhelan 2011-02-14 13:53:38 UTC
Created attachment 180827 [details] [review]
patch for "pango.vapi"
Comment 2 gawhelan 2011-02-15 15:17:56 UTC
I have the following test case:

/* pango-test.vala */

int main (string[] args) {
	string markup = "<b>Hello, World!</b>";

	Pango.AttrList attrs;
	string text;
	Pango.parse_markup (markup, -1, 0, out attrs, out text, null);

	stdout.printf ("%s\n", text);

	return 0;
}

When I try to compile this (with versions 0.10.0 and 0.11.5) I get:

$ valac --pkg=pango pango-test.vala 
pango-test.vala:8.58-8.61: error: Argument 6: Cannot convert from `null' to `unichar'
	Pango.parse_markup (markup, -1, 0, out attrs, out text, null);
	                                                        ^^^^
Compilation failed: 1 error(s), 0 warning(s)


After applying the attached patch for "pango.vapi" the test case compiles but I get a warning about another parameter:

$ valac --pkg=pango pango-test.vala 
pango-test.vala:8.2-8.62: warning: unhandled error `GLib.Error'
	Pango.parse_markup (markup, -1, 0, out attrs, out text, null);
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/graham/pango-test.vala.c: In function ‘_vala_main’:
/home/graham/pango-test.vala.c:39: warning: passing argument 5 of ‘pango_parse_markup’ from incompatible pointer type
/usr/include/pango-1.0/pango/pango-attributes.h:270: note: expected ‘char **’ but argument is of type ‘const gchar **’
Compilation succeeded - 1 warning(s)


I'm not sure if the is another problem with the binding or a bug in my test case.
Comment 3 Michal Hruby 2011-03-11 00:28:40 UTC
commit 5d6c21cebd3c5a4fdbf50cfa780729ba863c2909
Author: Michal Hruby <michal.mhr@gmail.com>
Date:   Fri Mar 11 01:27:31 2011 +0100

    pango: Multiple binding fixes
    
    Fixes bug 642293.