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 656772 - g_variant_compare for uint64 incorrect
g_variant_compare for uint64 incorrect
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-08-17 19:45 UTC by brumikey
Modified: 2011-08-17 23:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description brumikey 2011-08-17 19:45:05 UTC
From source in git (http://git.gnome.org/browse/glib/tree/glib/gvariant.c#n2697), function g_variant_compare:

    case G_VARIANT_CLASS_UINT64:
      {
        guint64 a_val = g_variant_get_int32 (a);
        guint64 b_val = g_variant_get_int32 (b);

        return (a_val == b_val) ? 0 : (a_val > b_val) ? 1 : -1;
      }

The two instances of g_variant_get_int32 should be replaced with g_variant_get_uint64.
Comment 1 Christian Dywan 2011-08-17 23:42:53 UTC
Indeed obviously wrong, fixed in master.