diff options
author | Diane Trout <diane@ghic.org> | 2016-04-13 16:27:01 -0700 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-04-15 09:32:38 -0500 |
commit | 2c9df052d8993590f9d2cc2bf596a07241a59ad4 (patch) | |
tree | d8f19a65a6131ad11028124854410787a259c97a /tp-account-widgets | |
parent | 3ab6598170ebbf01394831e997a4a846fecaa01a (diff) | |
download | telepathy-account-widgets-2c9df052d8993590f9d2cc2bf596a07241a59ad4.tar.gz |
Use MIN instead of CLAMP for unsigned int types.
CLAMP tested that the unsigned variable was > 0, which gcc 5.3.1
generates a warning pointing out that will always be true.
Using MIN guarantees the variable will be in the range
0..G_MAXINT(31|64)
https://bugzilla.gnome.org/show_bug.cgi?id=765022
Diffstat (limited to 'tp-account-widgets')
-rw-r--r-- | tp-account-widgets/tpaw-account-settings.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tp-account-widgets/tpaw-account-settings.c b/tp-account-widgets/tpaw-account-settings.c index c8bea64c..0ccff207 100644 --- a/tp-account-widgets/tpaw-account-settings.c +++ b/tp-account-widgets/tpaw-account-settings.c @@ -880,11 +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), 0, G_MAXINT32); + ret = MIN (g_variant_get_uint32 (v), 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), 0, G_MAXINT32); + ret = MIN (g_variant_get_uint64 (v), G_MAXINT32); else { gchar *tmp; @@ -918,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), 0, G_MAXINT64); + ret = MIN (g_variant_get_uint64 (v), G_MAXINT64); else { gchar *tmp; |