[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Use 'fabs' for absolute values on doubles

noreply at xfce.org noreply at xfce.org
Sat Nov 10 12:56:56 CET 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit 7329025e261e4fa83c5916f529b4a7aa8875fff6
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Nov 10 06:56:51 2018 -0500

    Use 'fabs' for absolute values on doubles
---
 savers/floaters.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/savers/floaters.c b/savers/floaters.c
index 9cf3532..a99e3dd 100644
--- a/savers/floaters.c
+++ b/savers/floaters.c
@@ -419,7 +419,7 @@ screen_saver_floater_should_come_on_screen (ScreenSaver        *screen_saver,
     if (!screen_saver_floater_is_off_canvas (screen_saver, floater))
         return FALSE;
 
-    if ((abs (performance_ratio - .5) >= G_MINDOUBLE) &&
+    if ((fabs (performance_ratio - .5) >= G_MINDOUBLE) &&
             (g_random_double () > .5))
     {
         if (duration)
@@ -583,7 +583,7 @@ screen_saver_floater_create_path (ScreenSaver        *screen_saver,
     performance_ratio =
         screen_saver_get_frames_per_second (screen_saver) / OPTIMAL_FRAME_RATE;
 
-    if (abs (performance_ratio) <= G_MINDOUBLE)
+    if (fabs (performance_ratio) <= G_MINDOUBLE)
         performance_ratio = 1.0;
 
     if (screen_saver_floater_should_bubble_up (screen_saver, floater, performance_ratio, &duration))
@@ -733,7 +733,7 @@ screen_saver_floater_do_draw (ScreenSaver        *screen_saver,
 
     cairo_save (context);
 
-    if (screen_saver->should_do_rotations && (abs (floater->angle) > G_MINDOUBLE))
+    if (screen_saver->should_do_rotations && (fabs (floater->angle) > G_MINDOUBLE))
     {
         floater->bounds.width = G_SQRT2 * source->width + 2;
         floater->bounds.height = G_SQRT2 * source->height + 2;
@@ -1002,7 +1002,7 @@ compare_floaters (ScreenSaverFloater *a,
 {
     if (a->scale > b->scale)
         return 1;
-    else if (abs (a->scale - b->scale) <= G_MINDOUBLE)
+    else if (fabs (a->scale - b->scale) <= G_MINDOUBLE)
         return 0;
     else
         return -1;
@@ -1134,7 +1134,7 @@ screen_saver_do_update_stats (ScreenSaver *screen_saver)
         screen_saver_get_timestamp (screen_saver);
     screen_saver->last_calculated_stats_time = last_calculated_stats_time;
 
-    if (abs (last_calculated_stats_time) <= G_MINDOUBLE)
+    if (fabs (last_calculated_stats_time) <= G_MINDOUBLE)
         return TRUE;
 
     seconds_since_last_stats_update =

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list