From fe23dc2c107f397ba60ae300e1e34f073516e6c1 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 9 Jan 2012 18:16:53 +0100 Subject: [PATCH] gtkscale: fix bogus compare func The GtkScaleMark values are gdouble, a simple a-b compare func would fail for values with the same integer value. This breaks the sorting and causes random marker label placement. --- gtk/gtkscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 979f45f66b..74370c6949 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -1487,7 +1487,7 @@ compare_marks (gpointer a, gpointer b) ma = a; mb = b; - return (gint) (ma->value - mb->value); + return (ma->value > mb->value) ? 1 : ((ma->value == mb->value) ? 0 : -1); } /**