From 4fe091d93cf3ec7b2d26b2e42de8cb8c45f8d3bf Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 1 Mar 2020 23:45:42 +0100 Subject: [PATCH] particle: explicitly cast RAND_MAX to float This silences a warning in clang-11 --- src/particle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/particle.c b/src/particle.c index 15ede03..84f1f4a 100644 --- a/src/particle.c +++ b/src/particle.c @@ -144,7 +144,7 @@ SYMBOL_EXPORT struct ParticleState SpawnParticleIn(float x, float y) { } SYMBOL_EXPORT struct ParticleState SpawnParticleBetween(float x1, float y1, float x2, float y2) { - float x = x1 + (x2 - x1) * rand() / RAND_MAX, y = y1 + (y2 - y1) * rand() / RAND_MAX; + float x = x1 + (x2 - x1) * rand() / (float)RAND_MAX, y = y1 + (y2 - y1) * rand() / (float)RAND_MAX; return SpawnParticleIn(x, y); }