From 0c1c6d7c244e062cd7aebac6145341aa9005bd3f Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 1 Dec 2023 03:17:56 +0000 Subject: [PATCH] [*] Formatting regressions (+ 1x double-based RNG regression) --- Source/RNG/AuRandomDevice.cpp | 6 +++--- Source/Threading/Primitives/AuConditionEx.cpp | 4 ++-- Source/Threading/Primitives/AuRWLock.cpp | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/RNG/AuRandomDevice.cpp b/Source/RNG/AuRandomDevice.cpp index 015c2aba..a044e9b4 100644 --- a/Source/RNG/AuRandomDevice.cpp +++ b/Source/RNG/AuRandomDevice.cpp @@ -282,7 +282,7 @@ namespace Aurora::RNG double RandomDevice::NextDecimal() { - return this->UniformFloatInRange(0.0, 1.0); + return this->UniformFloatInRange(DBL_EPSILON, 1.0); } AuUInt32 RandomDevice::NextIndex(AuUInt32 uCount /* = max + 1*/) @@ -299,8 +299,8 @@ namespace Aurora::RNG double RandomDevice::NextNumber(double dMin, double dMax) { - auto dRange = dMin - dMin; - return this->UniformFloatInRange(0.0, dRange) + dMin; + auto dRange = dMax - dMin; + return this->UniformFloatInRange(DBL_EPSILON, dRange + DBL_EPSILON) + dMin - DBL_EPSILON; } AuMemoryViewRead RandomDevice::ToSeed() diff --git a/Source/Threading/Primitives/AuConditionEx.cpp b/Source/Threading/Primitives/AuConditionEx.cpp index f689d29b..368853dc 100644 --- a/Source/Threading/Primitives/AuConditionEx.cpp +++ b/Source/Threading/Primitives/AuConditionEx.cpp @@ -45,7 +45,7 @@ namespace Aurora::Threading::Primitives } bool SemaphoreConditionVariableImpl::WaitForSignalAbsNS(const AuSPtr &pWaitable, - AuUInt64 uRelativeNanoseconds) + AuUInt64 uNanoseconds) { AuAtomicAdd(&this->uWaiters_, 1u); @@ -54,7 +54,7 @@ namespace Aurora::Threading::Primitives pWaitable->Unlock(); } - auto bSuccess = this->s_.LockAbsNS(uRelativeNanoseconds); + auto bSuccess = this->s_.LockAbsNS(uNanoseconds); if (!bSuccess) { auto uWaiters = this->uWaiters_; diff --git a/Source/Threading/Primitives/AuRWLock.cpp b/Source/Threading/Primitives/AuRWLock.cpp index f0650408..b185de6f 100644 --- a/Source/Threading/Primitives/AuRWLock.cpp +++ b/Source/Threading/Primitives/AuRWLock.cpp @@ -934,7 +934,6 @@ namespace Aurora::Threading::Primitives return &this->write_; } - template bool RWLockImpl::CheckSelfThreadIsWriter() {