[gnome-flashback] backends: fix double-promotion warnings



commit f1c2d92c46045114d724bccd5bf08e08234f5f88
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Sep 8 23:27:48 2018 +0300

    backends: fix double-promotion warnings

 backends/gf-monitor-config-store.c | 4 ++--
 backends/gf-monitor-manager.c      | 4 ++--
 backends/gf-monitor.c              | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/backends/gf-monitor-config-store.c b/backends/gf-monitor-config-store.c
index 3163856..3c1d3ab 100644
--- a/backends/gf-monitor-config-store.c
+++ b/backends/gf-monitor-config-store.c
@@ -1000,11 +1000,11 @@ handle_text (GMarkupParseContext  *context,
                            &parser->current_logical_monitor_config->scale, error))
             return;
 
-          if (parser->current_logical_monitor_config->scale <= 0.0)
+          if (parser->current_logical_monitor_config->scale <= 0.0f)
             {
               g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
                            "Logical monitor scale '%g' invalid",
-                           parser->current_logical_monitor_config->scale);
+                           (gdouble) parser->current_logical_monitor_config->scale);
               return;
             }
 
diff --git a/backends/gf-monitor-manager.c b/backends/gf-monitor-manager.c
index aede740..1958d12 100644
--- a/backends/gf-monitor-manager.c
+++ b/backends/gf-monitor-manager.c
@@ -676,7 +676,7 @@ find_monitor_mode_scale (GfMonitorManager            *manager,
 
   g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
                "Scale %g not valid for resolution %dx%d",
-               scale,
+               (gdouble) scale,
                monitor_mode_spec->width,
                monitor_mode_spec->height);
 
@@ -1580,7 +1580,7 @@ gf_monitor_manager_handle_get_current_state (GfDBusDisplayConfig   *skeleton,
                                  mode_id,
                                  mode_width,
                                  mode_height,
-                                 refresh_rate,
+                                 (gdouble) refresh_rate,
                                  (gdouble) preferred_scale,
                                  &supported_scales_builder,
                                  &mode_properties_builder);
diff --git a/backends/gf-monitor.c b/backends/gf-monitor.c
index e72dfe6..b7154e1 100644
--- a/backends/gf-monitor.c
+++ b/backends/gf-monitor.c
@@ -36,7 +36,7 @@
 #define MAXIMUM_SCALE_FACTOR 4.0f
 #define MINIMUM_LOGICAL_WIDTH 800
 #define MINIMUM_LOGICAL_HEIGHT 480
-#define MAXIMUM_REFRESH_RATE_DIFF 0.001
+#define MAXIMUM_REFRESH_RATE_DIFF 0.001f
 
 /* The minimum screen height at which we turn on a window-scale of 2;
  * below this there just isn't enough vertical real estate for GNOME
@@ -834,7 +834,7 @@ gf_monitor_calculate_supported_scales (GfMonitor                 *monitor,
   gfloat scale_steps;
   GArray *supported_scales;
 
-  scale_steps = 1.0 / (gfloat) SCALE_FACTORS_PER_INTEGER;
+  scale_steps = 1.0f / SCALE_FACTORS_PER_INTEGER;
   supported_scales = g_array_new (FALSE, FALSE, sizeof (gfloat));
 
   gf_monitor_mode_get_resolution (monitor_mode, &width, &height);
@@ -849,7 +849,7 @@ gf_monitor_calculate_supported_scales (GfMonitor                 *monitor,
           gfloat scale_value = i + j * scale_steps;
 
           if ((constraints & GF_MONITOR_SCALES_CONSTRAINT_NO_FRAC) &&
-              fmodf (scale_value, 1.0) != 0.0)
+              fmodf (scale_value, 1.0) != 0.0f)
             {
               continue;
             }


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