From 3e3032cfa044268cee76735823755db274025021 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 13 Jun 2023 18:27:10 -0700 Subject: *: smattering of random small fixes to silence -Wall I thought the build was already using -Wall but that seems to not be the case, maybe got lost somewhere along the line or messed up in configure.ac After forcing a build with -Wall -Werror, these showed up. Fixed up in the obvious way, nothing too scary. --- src/modules/meta2d/v2f.h | 4 ++-- src/modules/meta2d/v3f.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/meta2d') diff --git a/src/modules/meta2d/v2f.h b/src/modules/meta2d/v2f.h index 088772d..8483f00 100644 --- a/src/modules/meta2d/v2f.h +++ b/src/modules/meta2d/v2f.h @@ -281,8 +281,8 @@ static inline v2f_t * v2f_trilerp(v2f_t *res, const v2f_t *aaa, const v2f_t *aba static inline v2f_t _v2f_rand(unsigned *seedp, const v2f_t *min, const v2f_t *max) { return (v2f_t){ - .x = min->x + (float)rand_r(seedp) * (1.f/RAND_MAX) * (max->x - min->x), - .y = min->y + (float)rand_r(seedp) * (1.f/RAND_MAX) * (max->y - min->y), + .x = min->x + (float)rand_r(seedp) * (1.f/(float)RAND_MAX) * (max->x - min->x), + .y = min->y + (float)rand_r(seedp) * (1.f/(float)RAND_MAX) * (max->y - min->y), }; } diff --git a/src/modules/meta2d/v3f.h b/src/modules/meta2d/v3f.h index d923ecc..b1d3f4c 100644 --- a/src/modules/meta2d/v3f.h +++ b/src/modules/meta2d/v3f.h @@ -300,9 +300,9 @@ static inline v3f_t * v3f_cross(v3f_t *res, const v3f_t *a, const v3f_t *b) static inline v3f_t _v3f_rand(unsigned *seedp, const v3f_t *min, const v3f_t *max) { return (v3f_t){ - .x = min->x + (float)rand_r(seedp) * (1.f/RAND_MAX) * (max->x - min->x), - .y = min->y + (float)rand_r(seedp) * (1.f/RAND_MAX) * (max->y - min->y), - .z = min->z + (float)rand_r(seedp) * (1.f/RAND_MAX) * (max->z - min->z), + .x = min->x + (float)rand_r(seedp) * (1.f/(float)RAND_MAX) * (max->x - min->x), + .y = min->y + (float)rand_r(seedp) * (1.f/(float)RAND_MAX) * (max->y - min->y), + .z = min->z + (float)rand_r(seedp) * (1.f/(float)RAND_MAX) * (max->z - min->z), }; } -- cgit v1.2.3