kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16-epplets.git/commit/?id=effc4cc774d373ae3d56712ee9c3e260101de855

commit effc4cc774d373ae3d56712ee9c3e260101de855
Author: Kim Woelders <k...@woelders.dk>
Date:   Wed Dec 9 17:57:23 2020 +0100

    Use fabs(), not abs() on doubles
---
 epplets/esdcloak.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/epplets/esdcloak.c b/epplets/esdcloak.c
index 106e662..8ddf69e 100644
--- a/epplets/esdcloak.c
+++ b/epplets/esdcloak.c
@@ -463,9 +463,9 @@ draw_ball(void)
      {
        ball_x = rand() % 39;
        ball_y = rand() % 39;
-       while (abs(d_x) < 0.5)
+       while (fabs(d_x) < 0.5)
           d_x = ((double)rand() / RAND_MAX * 4) - 2.0;
-       while (abs(d_y) < 0.5)
+       while (fabs(d_y) < 0.5)
           d_y = ((double)rand() / RAND_MAX * 4) - 2.0;
        blank_buf();
        setup = 1;
@@ -623,7 +623,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
    line_width = (x2 - x1);
    line_height = (y2 - y1);
 
-   if (abs(line_width) > abs(line_height))
+   if (fabs(line_width) > fabs(line_height))
      {
        if (x1 > x2)
          {
@@ -639,7 +639,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
 
        /* This is currently broken. It is supposed to account
         * for lines that don't span more than one pixel */
-       if (abs(line_width) < 0.1)
+       if (fabs(line_width) < 0.1)
          {
             x2 = x1 + 0.5;
             x1 -= 0.5;
@@ -727,7 +727,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
          }
 
        /* This is currently broken */
-       if (abs(line_height) < 0.1)
+       if (fabs(line_height) < 0.1)
          {
             y2 = y1 + 0.5;
             y1 -= 0.5;

-- 


Reply via email to