diff options
| author | Tyge Løvset <[email protected]> | 2020-08-29 23:31:21 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-08-29 23:31:21 +0200 |
| commit | c15b39eed1f7041b1fb84a72da4e4e0fae1318a8 (patch) | |
| tree | 771744253a9c1739b3cb90af254d88030a1dbc6c /stc | |
| parent | 8efecc5d6b8d4dcd6a7bdf9540a11355b4631782 (diff) | |
| download | STC-modified-c15b39eed1f7041b1fb84a72da4e4e0fae1318a8.tar.gz STC-modified-c15b39eed1f7041b1fb84a72da4e4e0fae1318a8.zip | |
Cleanup and fix mapmap example.
Diffstat (limited to 'stc')
| -rw-r--r-- | stc/crandom.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stc/crandom.h b/stc/crandom.h index 5821b4e7..d1a85395 100644 --- a/stc/crandom.h +++ b/stc/crandom.h @@ -59,7 +59,7 @@ STC_INLINE float crand_f32(crand_rng32_t* rng) { /* int random number generator in range [low, high] */
STC_INLINE crand_uniform_i32_t crand_uniform_i32_init(crand_rng32_t rng, int32_t low, int32_t high) {
- crand_uniform_i32_t dist = {rng, low, high - low + 1}; return dist;
+ crand_uniform_i32_t dist = {rng, low, (uint32_t) (high - low + 1)}; return dist;
}
STC_INLINE int32_t crand_uniform_i32(crand_uniform_i32_t* dist) {
return dist->offset + (int32_t) (((uint64_t) crand_i32(&dist->rng) * dist->range) >> 32);
@@ -100,7 +100,7 @@ STC_INLINE double crand_f64(crand_rng64_t* rng) { /* int random number generator in range [low, high] */
STC_INLINE crand_uniform_i64_t crand_uniform_i64_init(crand_rng64_t rng, int64_t low, int64_t high) {
- crand_uniform_i64_t dist = {rng, low, high - low + 1}; return dist;
+ crand_uniform_i64_t dist = {rng, low, (uint64_t) (high - low + 1)}; return dist;
}
#if defined(_MSC_VER) && defined(_WIN64)
|
