diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-07-18 09:45:00 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-07-18 09:45:00 -0400 |
commit | 14d0b514af4e70956ecc2fbf6fe4c2e745e144a8 (patch) | |
tree | cf16012bf900500d65c72410cec9de9a90cb8c6e /indra/llcommon/llrand.cpp | |
parent | 4b158580e5654615d2a5510267bf76392c9666fa (diff) |
SL-18837: Ditch inactive llrand.cpp LL_USE_SYSTEM_RAND code.
LL_USE_SYSTEM_RAND has been disabled since June 2008; that code only clutters
the implementation we actually use.
Diffstat (limited to 'indra/llcommon/llrand.cpp')
-rw-r--r-- | indra/llcommon/llrand.cpp | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/indra/llcommon/llrand.cpp b/indra/llcommon/llrand.cpp index 4e4345f37a..33afc50cf7 100644 --- a/indra/llcommon/llrand.cpp +++ b/indra/llcommon/llrand.cpp @@ -58,48 +58,12 @@ * to restore uniform distribution. */ +static LLRandLagFib2281 gRandomGenerator(LLUUID::getRandomSeed()); + +// no default implementation, only specific F64 and F32 specializations template <typename REAL> inline REAL ll_internal_random(); -// *NOTE: The system rand implementation is probably not correct. -#define LL_USE_SYSTEM_RAND 0 - -/***************************************************************************** -* The LL_USE_SYSTEM_RAND implementation has been disabled since June 2008. -*****************************************************************************/ -#if LL_USE_SYSTEM_RAND -#include <cstdlib> - -class LLSeedRand -{ -public: - LLSeedRand() - { -#if LL_WINDOWS - srand(LLUUID::getRandomSeed()); -#else - srand48(LLUUID::getRandomSeed()); -#endif - } -}; -static LLSeedRand sRandomSeeder; - -template <> -inline F64 ll_internal_random<F64>() -{ -#if LL_WINDOWS - return (F64)rand() / (F64)(RAND_MAX+1); -#else - return drand48(); -#endif -} - -/***************************************************************************** -* This is the implementation we've been using. -*****************************************************************************/ -#else // LL_USE_SYSTEM_RAND -static LLRandLagFib2281 gRandomGenerator(LLUUID::getRandomSeed()); - template <> inline F64 ll_internal_random<F64>() { @@ -111,11 +75,7 @@ inline F64 ll_internal_random<F64>() if(!((rv >= 0.0) && (rv < 1.0))) return fmod(rv, 1.0); return rv; } -#endif // LL_USE_SYSTEM_RAND -/***************************************************************************** -* Functions common to both implementations -*****************************************************************************/ template <> inline F32 ll_internal_random<F32>() { |