[libwnck] Promote single precision floats to doubles



commit 1eee750bec5b6532ce7b8286f41cd481008d4e2d
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Nov 11 20:11:05 2017 +0000

    Promote single precision floats to doubles
    
    The AX_COMPILER_FLAGS m4 macro has suddenly gained the extremely
    unhelpful `-Werror=double-promotion` default compiler flag, thus
    breaking the build.

 libwnck/tasklist.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 0cf9844..83a5fbe 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -396,17 +396,18 @@ wnck_task_button_glow (WnckTask *task)
   if (task->button_glow == 0)
     {
       /* we're in "has stopped glowing" mode */
-      task->glow_factor = fade_opacity * 0.5;
+      task->glow_factor = (gdouble) fade_opacity * 0.5;
       stopped = TRUE;
     }
   else
     {
-      task->glow_factor = fade_opacity * (0.5 -
-                                          0.5 * cos ((now - task->glow_start_time) *
-                                                     M_PI * 2.0 / loop_time));
+      task->glow_factor =
+        (gdouble) fade_opacity * (0.5 -
+                                  0.5 * cos ((now - task->glow_start_time) *
+                                             M_PI * 2.0 / (gdouble) loop_time));
 
-      if (now - task->start_needs_attention > loop_time * 1.0 * fade_max_loops)
-        stopped = ABS (task->glow_factor - fade_opacity * 0.5) < 0.05;
+      if (now - task->start_needs_attention > (gdouble) loop_time * 1.0 * fade_max_loops)
+        stopped = ABS (task->glow_factor - (gdouble) fade_opacity * 0.5) < 0.05;
       else
         stopped = FALSE;
     }


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