diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c index 310715c1f4..17266b3a24 100644 --- a/demos/gtk-demo/spinbutton.c +++ b/demos/gtk-demo/spinbutton.c @@ -33,14 +33,14 @@ hex_spin_output (GtkSpinButton *spin_button) { GtkAdjustment *adjustment; gchar *buf; - gint val; + gdouble val; adjustment = gtk_spin_button_get_adjustment (spin_button); - val = (gint) gtk_adjustment_get_value (adjustment); + val = gtk_adjustment_get_value (adjustment); if (fabs (val) < 1e-5) buf = g_strdup ("0x00"); else - buf = g_strdup_printf ("0x%.2X", val); + buf = g_strdup_printf ("0x%.2X", (gint) val); if (strcmp (buf, gtk_spin_button_get_text (spin_button))) gtk_spin_button_set_text (spin_button, buf); g_free (buf); diff --git a/tests/testgtk.c b/tests/testgtk.c index 626104bce3..7e5d683746 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -3240,14 +3240,14 @@ spin_button_hex_output_func (GtkSpinButton *spin_button) { GtkAdjustment *adjustment; static gchar buf[7]; - gint val; + gdouble val; adjustment = gtk_spin_button_get_adjustment (spin_button); - val = (gint) gtk_adjustment_get_value (adjustment); + val = gtk_adjustment_get_value (adjustment); if (fabs (val) < 1e-5) sprintf (buf, "0x00"); else - sprintf (buf, "0x%.2X", val); + sprintf (buf, "0x%.2X", (gint) val); if (strcmp (buf, gtk_spin_button_get_text (spin_button))) gtk_spin_button_set_text (spin_button, buf);