Skip to content

Commit 6f58e9f

Browse files
committed
gfx_voronoi: Fix warnings.
1 parent 5e25a9a commit 6f58e9f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/modules/gfx_voronoi.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
static int modno;
3535
static unsigned int frame;
3636
static oscore_time nexttick;
37-
static float delta0;
3837

3938
static uint16_t xmax;
4039
static uint16_t ymax;
@@ -92,15 +91,15 @@ static const uint8_t palette_size = sizeof(palette)/sizeof(RGB);
9291

9392
static inline float multiplicate_dist(float x1, float y1, float x2, float y2)
9493
{
95-
float dx = abs(x1 - x2);
96-
float dy = abs(y1 - y2);
94+
float dx = fabsf(x1 - x2);
95+
float dy = fabsf(y1 - y2);
9796
return dx * dy;
9897
}
9998

10099
static inline float sum_dist(float x1, float y1, float x2, float y2)
101100
{
102-
float dx = abs(x1 - x2);
103-
float dy = abs(y1 - y2);
101+
float dx = fabsf(x1 - x2);
102+
float dy = fabsf(y1 - y2);
104103

105104
return dx + dy;
106105
}
@@ -114,8 +113,8 @@ static inline float euklid_dist(float x1, float y1, float x2, float y2)
114113

115114
static inline float p3_dist(float x1, float y1, float x2, float y2)
116115
{
117-
float dx = abs(x1 - x2);
118-
float dy = abs(y1 - y2);
116+
float dx = fabsf(x1 - x2);
117+
float dy = fabsf(y1 - y2);
119118
return dx*dx*dx + dy*dy*dy;
120119
}
121120

@@ -128,8 +127,8 @@ static inline float p4_dist(float x1, float y1, float x2, float y2)
128127

129128
static inline float p5_dist(float x1, float y1, float x2, float y2)
130129
{
131-
float dx = abs(x1 - x2);
132-
float dy = abs(y1 - y2);
130+
float dx = fabsf(x1 - x2);
131+
float dy = fabsf(y1 - y2);
133132
return dx*dx*dx*dx*dx + dy*dy*dy*dy*dy;
134133
}
135134

0 commit comments

Comments
 (0)