summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/flow/flow.c2
-rw-r--r--src/modules/flow/v3f.h6
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;
}
© All Rights Reserved