aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-22 01:00:00 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-22 01:19:26 +0800
commitd8a3034999ca213ac75b4110a875d688b75fed5f (patch)
tree585ad5f1108ce8a8436f9c44d27bdaf2ef0dd280 /libempathy
parent0f12ed5628589596f4a2c02648ee66a9413c3f2a (diff)
downloadgsoc2013-empathy-d8a3034999ca213ac75b4110a875d688b75fed5f.tar.gz
gsoc2013-empathy-d8a3034999ca213ac75b4110a875d688b75fed5f.tar.zst
gsoc2013-empathy-d8a3034999ca213ac75b4110a875d688b75fed5f.zip
empathy-account-settings: fix CLAMP usage
CLAMP syntax is (x, low, high), not (low, x, high). Also add some cast to fix compiler warnings.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-account-settings.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index ec349ee92..5069691a2 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -691,13 +691,15 @@ empathy_account_settings_get_int32 (EmpathyAccountSettings *settings,
ret = g_value_get_int (v);
break;
case G_TYPE_UINT:
- ret = CLAMP (G_MININT32, g_value_get_uint (v), G_MAXINT32);
+ ret = CLAMP (g_value_get_uint (v), (guint) G_MININT32,
+ G_MAXINT32);
break;
case G_TYPE_INT64:
- ret = CLAMP (G_MININT32, g_value_get_int64 (v), G_MAXINT32);
+ ret = CLAMP (g_value_get_int64 (v), G_MININT32, G_MAXINT32);
break;
case G_TYPE_UINT64:
- ret = CLAMP (G_MININT32, g_value_get_uint64 (v), G_MAXINT32);
+ ret = CLAMP (g_value_get_uint64 (v), (guint64) G_MININT32,
+ G_MAXINT32);
break;
default:
ret = 0;
@@ -733,7 +735,7 @@ empathy_account_settings_get_int64 (EmpathyAccountSettings *settings,
ret = g_value_get_int64 (v);
break;
case G_TYPE_UINT64:
- ret = CLAMP (G_MININT64, g_value_get_uint64 (v), G_MAXINT64);
+ ret = CLAMP (g_value_get_uint64 (v), (guint64) G_MININT64, G_MAXINT64);
break;
default:
ret = 0;
@@ -766,10 +768,10 @@ empathy_account_settings_get_uint32 (EmpathyAccountSettings *settings,
ret = g_value_get_uint (v);
break;
case G_TYPE_INT64:
- ret = CLAMP (0, g_value_get_int64 (v), G_MAXUINT32);
+ ret = CLAMP (g_value_get_int64 (v), 0, G_MAXUINT32);
break;
case G_TYPE_UINT64:
- ret = CLAMP (0, g_value_get_uint64 (v), G_MAXUINT32);
+ ret = MIN (g_value_get_uint64 (v), G_MAXUINT32);
break;
default:
ret = 0;
@@ -806,7 +808,7 @@ empathy_account_settings_get_uint64 (EmpathyAccountSettings *settings,
ret = MAX (0, g_value_get_int64 (v));
break;
case G_TYPE_UINT64:
- ret = CLAMP (0, g_value_get_uint64 (v), G_MAXUINT64);
+ ret = g_value_get_uint64 (v);
break;
default:
ret = 0;