From d3c9cd3b1696e8ef1557cc450c3ccd2d802e85a1 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 17 Jan 2017 23:03:23 +0000 Subject: [PATCH] Fixed syntax errors --- src/random.cpp | 22 +++++++++++----------- src/random.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/random.cpp b/src/random.cpp index 051bde79..7fc49e6e 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -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(this); - uint32_t seed = static_cast(n); + uintptr_t n = reinterpret_cast(this); + uint32_t seed = static_cast(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; } diff --git a/src/random.h b/src/random.h index cead31df..be900735 100644 --- a/src/random.h +++ b/src/random.h @@ -47,7 +47,7 @@ namespace etl random(); random(uint32_t seed); void initialise(uint32_t seed); - uint32_t operator()() const; + uint32_t operator()(); private: