From b3892cf644c693fef44b5daf55a0b66a667ac147 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 13 Dec 2021 23:18:26 +0100 Subject: Fix some -Wfloat-conversion warnings --- battstat/battstat-preferences.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'battstat/battstat-preferences.c') diff --git a/battstat/battstat-preferences.c b/battstat/battstat-preferences.c index 40d38f42..88f93919 100644 --- a/battstat/battstat-preferences.c +++ b/battstat/battstat-preferences.c @@ -91,15 +91,16 @@ spin_ptr_cb (GtkWidget *spin_ptr, gpointer data) { BattstatPreferences *dialog = data; + gdouble red_val = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin_ptr)); - dialog->battstat->red_val = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin_ptr)); + dialog->battstat->red_val = (guint) red_val; /* automatically calculate orangle and yellow values from the * red value */ - dialog->battstat->orange_val = dialog->battstat->red_val * ORANGE_MULTIPLIER; + dialog->battstat->orange_val = (guint) (ORANGE_MULTIPLIER * red_val); dialog->battstat->orange_val = MIN (dialog->battstat->orange_val, 100); - dialog->battstat->yellow_val = dialog->battstat->red_val * YELLOW_MULTIPLIER; + dialog->battstat->yellow_val = (guint) (YELLOW_MULTIPLIER * red_val); dialog->battstat->yellow_val = MIN (dialog->battstat->yellow_val, 100); g_settings_set_int (dialog->battstat->settings, -- cgit v1.2.1