1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

rand: fix warnings

This commit is contained in:
ka-weihe
2020-06-02 06:39:38 +02:00
committed by GitHub
parent 076089d3c5
commit 13c68eb81e
15 changed files with 90 additions and 448 deletions

View File

@@ -164,7 +164,7 @@ pub fn (mut rng WyRandRNG) intn(max int) int {
eprintln('max has to be positive.')
exit(1)
}
return int(rng.u32n(max))
return int(rng.u32n(u32(max)))
}
// rng.i64n(max) returns a pseudorandom int that lies in [0, max)
@@ -174,7 +174,7 @@ pub fn (mut rng WyRandRNG) i64n(max i64) i64 {
eprintln('max has to be positive.')
exit(1)
}
return i64(rng.u64n(max))
return i64(rng.u64n(u64(max)))
}
// rng.int_in_range(min, max) returns a pseudorandom int that lies in [min, max)