summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2020-12-09 17:57:23 +0100
committerKim Woelders <kim@woelders.dk>2020-12-09 18:05:49 +0100
commiteffc4cc774d373ae3d56712ee9c3e260101de855 (patch)
tree22d7a329e9d333fee184052026b90971909aade9
parent9b37aee24760887385276e03330e825a4047c85c (diff)
Use fabs(), not abs() on doublesHEADmaster
-rw-r--r--epplets/esdcloak.c10
1 files 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)
463 { 463 {
464 ball_x = rand() % 39; 464 ball_x = rand() % 39;
465 ball_y = rand() % 39; 465 ball_y = rand() % 39;
466 while (abs(d_x) < 0.5) 466 while (fabs(d_x) < 0.5)
467 d_x = ((double)rand() / RAND_MAX * 4) - 2.0; 467 d_x = ((double)rand() / RAND_MAX * 4) - 2.0;
468 while (abs(d_y) < 0.5) 468 while (fabs(d_y) < 0.5)
469 d_y = ((double)rand() / RAND_MAX * 4) - 2.0; 469 d_y = ((double)rand() / RAND_MAX * 4) - 2.0;
470 blank_buf(); 470 blank_buf();
471 setup = 1; 471 setup = 1;
@@ -623,7 +623,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
623 line_width = (x2 - x1); 623 line_width = (x2 - x1);
624 line_height = (y2 - y1); 624 line_height = (y2 - y1);
625 625
626 if (abs(line_width) > abs(line_height)) 626 if (fabs(line_width) > fabs(line_height))
627 { 627 {
628 if (x1 > x2) 628 if (x1 > x2)
629 { 629 {
@@ -639,7 +639,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
639 639
640 /* This is currently broken. It is supposed to account 640 /* This is currently broken. It is supposed to account
641 * for lines that don't span more than one pixel */ 641 * for lines that don't span more than one pixel */
642 if (abs(line_width) < 0.1) 642 if (fabs(line_width) < 0.1)
643 { 643 {
644 x2 = x1 + 0.5; 644 x2 = x1 + 0.5;
645 x1 -= 0.5; 645 x1 -= 0.5;
@@ -727,7 +727,7 @@ aa_line(int x1, int y1, int x2, int y2, unsigned char b,
727 } 727 }
728 728
729 /* This is currently broken */ 729 /* This is currently broken */
730 if (abs(line_height) < 0.1) 730 if (fabs(line_height) < 0.1)
731 { 731 {
732 y2 = y1 + 0.5; 732 y2 = y1 + 0.5;
733 y1 -= 0.5; 733 y1 -= 0.5;