VstdLib: CGaussianRandomStream constification

This commit is contained in:
Kawe Mazidjatari 2024-07-30 11:59:53 +02:00
parent 31eac6bcc4
commit 0ab2b3f800
2 changed files with 6 additions and 6 deletions

View File

@ -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 );

View File

@ -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;