mate-desktop / mate-screensaver

MATE screen saver and locker
https://mate-desktop.org
GNU General Public License v2.0
48 stars 40 forks source link

floaters: use fabs instead of abs for doubles #218

Closed rbuj closed 4 years ago

rbuj commented 4 years ago
floaters.c: In function ‘screen_saver_floater_should_come_on_screen’:
floaters.c:420:7: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘double’ [-Wabsolute-value]
  420 |  if ((abs (performance_ratio - .5) >= G_MINDOUBLE) &&
      |       ^~~

floaters.c: In function ‘screen_saver_floater_create_path’:
floaters.c:585:6: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘gdouble’ {aka ‘double’} [-Wabsolute-value]
  585 |  if (abs (performance_ratio) <= G_MINDOUBLE)
      |      ^~~

floaters.c: In function ‘screen_saver_floater_do_draw’:
floaters.c:735:44: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘gdouble’ {aka ‘double’} [-Wabsolute-value]
  735 |  if (screen_saver->should_do_rotations && (abs (floater->angle) > G_MINDOUBLE))
      |                                            ^~~

floaters.c: In function ‘compare_floaters’:
floaters.c:1004:11: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘gdouble’ {aka ‘double’} [-Wabsolute-value]
 1004 |  else if (abs (a->scale - b->scale) <= G_MINDOUBLE)
      |           ^~~

floaters.c: In function ‘screen_saver_do_update_stats’:
floaters.c:1136:6: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘gdouble’ {aka ‘double’} [-Wabsolute-value]
 1136 |  if (abs (last_calculated_stats_time) <= G_MINDOUBLE)
      |      ^~~