mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: ~500 more byte=>u8
This commit is contained in:
@ -99,7 +99,7 @@ pub fn (mut rng MT19937RNG) seed(seed_data []u32) {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut rng MT19937RNG) u8() byte {
|
||||
pub fn (mut rng MT19937RNG) u8() u8 {
|
||||
if rng.bytes_left >= 1 {
|
||||
rng.bytes_left -= 1
|
||||
value := u8(rng.buffer)
|
||||
|
@ -29,7 +29,7 @@ pub fn (mut rng MuslRNG) seed(seed_data []u32) {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut rng MuslRNG) u8() byte {
|
||||
pub fn (mut rng MuslRNG) u8() u8 {
|
||||
if rng.bytes_left >= 1 {
|
||||
rng.bytes_left -= 1
|
||||
value := u8(rng.buffer)
|
||||
|
@ -39,7 +39,7 @@ pub fn (mut rng PCG32RNG) seed(seed_data []u32) {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut rng PCG32RNG) u8() byte {
|
||||
pub fn (mut rng PCG32RNG) u8() u8 {
|
||||
if rng.bytes_left >= 1 {
|
||||
rng.bytes_left -= 1
|
||||
value := u8(rng.buffer)
|
||||
|
@ -16,7 +16,7 @@ import time
|
||||
pub interface PRNG {
|
||||
mut:
|
||||
seed(seed_data []u32)
|
||||
u8() byte
|
||||
u8() u8
|
||||
u16() u16
|
||||
u32() u32
|
||||
u64() u64
|
||||
@ -424,7 +424,7 @@ pub fn intn(max int) ?int {
|
||||
}
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
pub fn u8() byte {
|
||||
pub fn u8() u8 {
|
||||
return default_rng.u8()
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ pub fn (mut rng SplitMix64RNG) seed(seed_data []u32) {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut rng SplitMix64RNG) u8() byte {
|
||||
pub fn (mut rng SplitMix64RNG) u8() u8 {
|
||||
if rng.bytes_left >= 1 {
|
||||
rng.bytes_left -= 1
|
||||
value := u8(rng.buffer)
|
||||
|
@ -64,7 +64,7 @@ pub fn (r SysRNG) default_rand() int {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut r SysRNG) u8() byte {
|
||||
pub fn (mut r SysRNG) u8() u8 {
|
||||
if r.bytes_left >= 1 {
|
||||
r.bytes_left -= 1
|
||||
value := u8(r.buffer)
|
||||
|
@ -35,7 +35,7 @@ pub fn (mut rng WyRandRNG) seed(seed_data []u32) {
|
||||
|
||||
// byte returns a uniformly distributed pseudorandom 8-bit unsigned positive `byte`.
|
||||
[inline]
|
||||
pub fn (mut rng WyRandRNG) u8() byte {
|
||||
pub fn (mut rng WyRandRNG) u8() u8 {
|
||||
// Can we extract a value from the buffer?
|
||||
if rng.bytes_left >= 1 {
|
||||
rng.bytes_left -= 1
|
||||
|
Reference in New Issue
Block a user