From ad208edbdfc1f8e912945ac790168afd174fd80b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 18 Nov 2023 19:31:52 -0800 Subject: modules/flow: silences warnings about implicit cast clang gets upset about this, so make it explicit. --- src/modules/flow/flow.c | 2 +- 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; } -- cgit v1.2.3