GNOME Bugzilla – Bug 762735
[PATCH] The minimum value of an uint64_t is 0, not G_MININT32
Last modified: 2016-04-15 14:34:06 UTC
In file tp-account-widgets/tpaw-account-settings.c, function tpaw_account_settings_get_int32: else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT64)) ret = CLAMP (g_variant_get_uint64 (v), (guint64) G_MININT32, G_MAXINT32); This causes a compiler warning because it may assign a bad value to ret.
Created attachment 322467 [details] [review] account-settings: The minimum value of an uint64_t is 0
Created attachment 322468 [details] [review] account-settings: The minimum value of an uint64_t is 0
Review of attachment 322468 [details] [review]: Thanks for the patch! ::: tp-account-widgets/tpaw-account-settings.c @@ +886,3 @@ ret = CLAMP (g_variant_get_int64 (v), G_MININT32, G_MAXINT32); else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT64)) + ret = CLAMP (g_variant_get_uint64 (v), 0, G_MAXINT32); What about the G_VARIANT_TYPE_UINT32 case a few lines above? It also affects the G_VARIANT_TYPE_UINT64 case in tpaw_account_settings_get_int64, doesn't it?
Created attachment 323059 [details] [review] account-settings: The minimum value of unsigned integers are 0
Review of attachment 323059 [details] [review]: From #empathy on GIMPNet: 13:25 <rishi> cassidy: xclaesse: Hey! Do you want to double check https://bugzilla.gnome.org/show_bug.cgi?id=762735 and https://bugzilla.gnome.org/show_bug.cgi?id=762738 13:26 <rishi> I am more worried about the first one because it can have subtle side-effects. 13:26 <rishi> I am not very familiar with the code - just did a fly-by review. 14:38 <xclaesse> rishi, looks good to me
Attachment 323059 [details] pushed as 47ef181 - account-settings: The minimum value of unsigned integers are 0