medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 16e8cc34eac3c9edeea208e2f2b1438e324bef58
parent 1d8d3d821527ba498e32fae6c1b96aadaf5fbb9b
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri Dec 30 12:56:02 +0200

Fix the last MSVC warning

Diffstat:
rng/rng_utils.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rng/rng_utils.h b/rng/rng_utils.h @@ -44,7 +44,7 @@ u32 rng_uniform( T * rng, u32 upper_bound ) { if( upper_bound < 2 ) return 0; /* 2**32 % x == (2**32 - x) % x */ - u32 min = -upper_bound % upper_bound; + u32 min = (~upper_bound + 1) % upper_bound; /* * This could theoretically loop forever but each retry has