mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 19:30:10 +00:00
gtk-demo, testgtk: Don't pass an integer to fabs
It looks like a mistake which compilers are likely to warn.
This commit is contained in:
parent
f57c1a2901
commit
2a87caf529
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user