[gtk+/gtk-3-2] gtkscale: fix bogus compare func



commit fe23dc2c107f397ba60ae300e1e34f073516e6c1
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon Jan 9 18:16:53 2012 +0100

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 979f45f..74370c6 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);
 }
 
 /**



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