GNOME Bugzilla – Bug 691524
gets uint8 type for signed char properties
Last modified: 2015-02-07 17:01:33 UTC
For a while now, we have a failing test case in pygobject which tests correct handling of "gchar" properties: http://git.gnome.org/browse/pygobject/tree/tests/test_gi.py#n2572 (i. e. "def test_char()" in "class TestPropertiesObject". This is because g_property_info_get_type() for GIMarshallingTests.PropertiesObject's "some-char" property gives GI_TYPE_TAG_UINT8. It is correct in the .gir: <property name="some-char" writable="1" construct="1" transfer-ownership="none"> <type name="gchar"/> </property> [...] <property name="some-uchar" writable="1" construct="1" transfer-ownership="none"> <type name="guint8"/> </property> So the scanner seems fine, it seems that libgirepository translates a "gchar" to UINT8 instead of INT8?
Created attachment 233208 [details] [review] patch to add test case This patch adds a check for this to tests/repository/gitypelibtest.c. It succeeds for some-uchar, but fails for some-char.
Created attachment 233209 [details] [review] girepository: gchar is a signed type This fixes the signedness in the integer_aliases table, and also adds guchar there for completeness. I don't think guchar is actually being used right now, as it usually appears as "guint8", but in case that ever changes it might not hurt to have it there?
Review of attachment 233209 [details] [review]: Looks good, surprising this bug existed so long.
Pushed, thanks for the review!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]