From 0ab2b3f800bec94d7f054e15fe9ae1b9cd895eca Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:59:53 +0200 Subject: [PATCH] VstdLib: CGaussianRandomStream constification --- src/vstdlib/random.cpp | 6 +++--- src/vstdlib/random.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vstdlib/random.cpp b/src/vstdlib/random.cpp index 6ced4a21..a83f74c9 100644 --- a/src/vstdlib/random.cpp +++ b/src/vstdlib/random.cpp @@ -175,7 +175,7 @@ int CUniformRandomStream::RandomShortMax() // gaussian-distributed numbers at once) // //----------------------------------------------------------------------------- -CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* pUniformStream) +CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* const pUniformStream) { AttachToStream(pUniformStream); } @@ -184,7 +184,7 @@ CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* pUniformStrea //----------------------------------------------------------------------------- // Attaches to a random uniform stream //----------------------------------------------------------------------------- -void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream) +void CGaussianRandomStream::AttachToStream(IUniformRandomStream* const pUniformStream) { AUTO_LOCK( m_mutex ); @@ -196,7 +196,7 @@ void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream) //----------------------------------------------------------------------------- // Generates random numbers //----------------------------------------------------------------------------- -float CGaussianRandomStream::RandomFloat(float flMean, float flStdDev) +float CGaussianRandomStream::RandomFloat(const float flMean, const float flStdDev) { AUTO_LOCK( m_mutex ); diff --git a/src/vstdlib/random.h b/src/vstdlib/random.h index dddf6e96..86acf9a8 100644 --- a/src/vstdlib/random.h +++ b/src/vstdlib/random.h @@ -72,13 +72,13 @@ class CGaussianRandomStream public: // Passing in NULL will cause the gaussian stream to use the // installed global random number generator - CGaussianRandomStream(IUniformRandomStream* pUniformStream = NULL); + CGaussianRandomStream(IUniformRandomStream* const pUniformStream = NULL); // Attaches to a random uniform stream - void AttachToStream(IUniformRandomStream* pUniformStream = NULL); + void AttachToStream(IUniformRandomStream* const pUniformStream = NULL); // Generates random numbers - float RandomFloat(float flMean = 0.0f, float flStdDev = 1.0f); + float RandomFloat(const float flMean = 0.0f, const float flStdDev = 1.0f); private: IUniformRandomStream* m_pUniformStream;