mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Fixed syntax errors
This commit is contained in:
parent
5640bfc35c
commit
d3c9cd3b16
@ -40,8 +40,8 @@ namespace etl
|
||||
{
|
||||
// An attempt to come up with a reasonable non-zero seed,
|
||||
// based on the address of the instance.
|
||||
uintptr_t n = reinterpret_cast<uintptr_t>(this);
|
||||
uint32_t seed = static_cast<uint32_t>(n);
|
||||
uintptr_t n = reinterpret_cast<uintptr_t>(this);
|
||||
uint32_t seed = static_cast<uint32_t>(n);
|
||||
initialise(seed);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ namespace etl
|
||||
/// Initialises the sequence with a new seed value.
|
||||
///\param seed The new seed value.
|
||||
//***************************************************************************
|
||||
void random::initialize(uint32_t seed)
|
||||
void random::initialise(uint32_t seed)
|
||||
{
|
||||
state[0] = seed;
|
||||
state[1] = seed + 3;
|
||||
@ -69,17 +69,17 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Get the next random number.
|
||||
//***************************************************************************
|
||||
uint32_t random::operator()() constant
|
||||
uint32_t random::operator()()
|
||||
{
|
||||
uint32_t n = state[3];
|
||||
n ^= n << 11;
|
||||
n ^= n >> 8;
|
||||
state[3] = state[2];
|
||||
uint32_t n = state[3];
|
||||
n ^= n << 11;
|
||||
n ^= n >> 8;
|
||||
state[3] = state[2];
|
||||
state[2] = state[1];
|
||||
state[1] = state[0];
|
||||
n ^= state[0];
|
||||
n ^= state[0] >> 19;
|
||||
state[0] = n;
|
||||
n ^= state[0];
|
||||
n ^= state[0] >> 19;
|
||||
state[0] = n;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ namespace etl
|
||||
random();
|
||||
random(uint32_t seed);
|
||||
void initialise(uint32_t seed);
|
||||
uint32_t operator()() const;
|
||||
uint32_t operator()();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user