diff options
author | jstebbins <[email protected]> | 2008-10-17 22:36:01 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-10-17 22:36:01 +0000 |
commit | fa904997ddba784699a6e0858d62cfa93a7b6be7 (patch) | |
tree | cd77262b320accab16f5b1174b5630fbb8dda2d6 /gtk | |
parent | c169470e5c6d06fa8eec2835af1aaf4f6d210faa (diff) |
LinGui: fix a problem with converting strings to int values.
I wanted non-numeric strings to become MAXINT, but this wasn't happening.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1841 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/values.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/src/values.c b/gtk/src/values.c index d8dd74330..94b417f6d 100644 --- a/gtk/src/values.c +++ b/gtk/src/values.c @@ -87,21 +87,21 @@ ghb_value_int(const GValue *val) if (val == NULL) return 0; GValue xform = {0,}; - if (G_VALUE_TYPE(val) != G_TYPE_INT64) + if (G_VALUE_TYPE(val) != G_TYPE_INT) { - g_value_init(&xform, G_TYPE_INT64); + g_value_init(&xform, G_TYPE_INT); if (!g_value_transform(val, &xform)) { debug_show_type(G_VALUE_TYPE(val)); g_warning("int can't transform"); return 0; } - result = (gint)g_value_get_int64(&xform); + result = g_value_get_int(&xform); g_value_unset(&xform); } else { - result = (gint)g_value_get_int64(val); + result = g_value_get_int(val); } return result; } @@ -688,7 +688,7 @@ xform_string_int(const GValue *sval, GValue *ival) const gchar *str = g_value_get_string(sval); gint val = g_strtod(str, &end); if (*end) - val = ~0>>1; + val = (guint)(~0)>>1; g_value_set_int(ival, val); } @@ -699,7 +699,7 @@ xform_string_int64(const GValue *sval, GValue *ival) const gchar *str = g_value_get_string(sval); gint64 val = g_strtod(str, &end); if (*end) - val = ~0L>>1; + val = (guint64)(~0L)>>1; g_value_set_int64(ival, val); } |