diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-11-18 19:31:52 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-11-18 19:31:52 -0800 |
commit | ad208edbdfc1f8e912945ac790168afd174fd80b (patch) | |
tree | 2c2642a89b741ea5450e744980e259a4557f475d | |
parent | 8e90d61ef72815b8b5957b5d680c4d8ab443116d (diff) |
modules/flow: silences warnings about implicit cast
clang gets upset about this, so make it explicit.
-rw-r--r-- | src/modules/flow/flow.c | 2 | ||||
-rw-r--r-- | src/modules/flow/v3f.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/flow/flow.c b/src/modules/flow/flow.c index 0d0c9cf..34159e3 100644 --- a/src/modules/flow/flow.c +++ b/src/modules/flow/flow.c @@ -93,7 +93,7 @@ static void flow_ff_populator(void *context, unsigned size, const ff_data_t *oth static inline float rand_within_range(unsigned *seed, float min, float max) { - return (min + ((float)rand_r(seed) * (1.0f/RAND_MAX)) * (max - min)); + return (min + ((float)rand_r(seed) * (1.0f/(float)RAND_MAX)) * (max - min)); } diff --git a/src/modules/flow/v3f.h b/src/modules/flow/v3f.h index f268cfc..0124a6b 100644 --- a/src/modules/flow/v3f.h +++ b/src/modules/flow/v3f.h @@ -217,9 +217,9 @@ static inline v3f_t v3f_floor(const v3f_t *v) static inline v3f_t v3f_rand(unsigned *seed, float min, float max) { - v3f_t res = v3f_init( (min + ((float)rand_r(seed) * (1.0f/RAND_MAX)) * (max - min)), - (min + ((float)rand_r(seed) * (1.0f/RAND_MAX)) * (max - min)), - (min + ((float)rand_r(seed) * (1.0f/RAND_MAX)) * (max - min))); + v3f_t res = v3f_init( (min + ((float)rand_r(seed) * (1.0f/(float)RAND_MAX)) * (max - min)), + (min + ((float)rand_r(seed) * (1.0f/(float)RAND_MAX)) * (max - min)), + (min + ((float)rand_r(seed) * (1.0f/(float)RAND_MAX)) * (max - min))); return res; } |