[telepathy-account-widgets] account-settings: The minimum value of unsigned integers are 0



commit 47ef18174e4f39575d2a93a01a221195970afa97
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Fri Mar 4 11:44:22 2016 +0800

    account-settings: The minimum value of unsigned integers are 0
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762735

 tp-account-widgets/tpaw-account-settings.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/tp-account-widgets/tpaw-account-settings.c b/tp-account-widgets/tpaw-account-settings.c
index 2445ad8..c8bea64 100644
--- a/tp-account-widgets/tpaw-account-settings.c
+++ b/tp-account-widgets/tpaw-account-settings.c
@@ -880,12 +880,11 @@ tpaw_account_settings_get_int32 (TpawAccountSettings *settings,
   else if (g_variant_is_of_type (v, G_VARIANT_TYPE_INT32))
     ret = g_variant_get_int32 (v);
   else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT32))
-    ret = CLAMP (g_variant_get_uint32 (v), (guint) G_MININT32,
-        G_MAXINT32);
+    ret = CLAMP (g_variant_get_uint32 (v), 0, G_MAXINT32);
   else if (g_variant_is_of_type (v, G_VARIANT_TYPE_INT64))
     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), (guint64) G_MININT32, G_MAXINT32);
+    ret = CLAMP (g_variant_get_uint64 (v), 0, G_MAXINT32);
   else
     {
       gchar *tmp;
@@ -919,7 +918,7 @@ tpaw_account_settings_get_int64 (TpawAccountSettings *settings,
   else if (g_variant_is_of_type (v, G_VARIANT_TYPE_INT64))
     ret = g_variant_get_int64 (v);
   else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT64))
-    ret = CLAMP (g_variant_get_uint64 (v), (guint64) G_MININT64, G_MAXINT64);
+    ret = CLAMP (g_variant_get_uint64 (v), 0, G_MAXINT64);
   else
     {
       gchar *tmp;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]