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 691524 - gets uint8 type for signed char properties
gets uint8 type for signed char properties
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.35.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-01-11 07:34 UTC by Martin Pitt
Modified: 2015-02-07 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add test case (2.24 KB, patch)
2013-01-11 07:35 UTC, Martin Pitt
none Details | Review
girepository: gchar is a signed type (3.28 KB, patch)
2013-01-11 07:50 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2013-01-11 07:34:42 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?
Comment 1 Martin Pitt 2013-01-11 07:35:54 UTC
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.
Comment 2 Martin Pitt 2013-01-11 07:50:19 UTC
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?
Comment 3 Colin Walters 2013-01-11 13:11:10 UTC
Review of attachment 233209 [details] [review]:

Looks good, surprising this bug existed so long.
Comment 4 Martin Pitt 2013-01-11 13:56:35 UTC
Pushed, thanks for the review!
Comment 5 André Klapper 2015-02-07 17:01:33 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]