diff options
author | bunnei <bunneidev@gmail.com> | 2021-02-09 03:08:08 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-02-19 01:16:24 +0100 |
commit | e7c33d1ad6b464a591279068f07a6b1de82109f6 (patch) | |
tree | baa5a1f9f2f05113c1b377aff3387c32616ee01c /src/core/hle/kernel/memory/system_control.cpp | |
parent | common: Add implementation of TinyMT (Mersenne Twister RNG). (diff) | |
download | yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar.gz yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar.bz2 yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar.lz yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar.xz yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.tar.zst yuzu-e7c33d1ad6b464a591279068f07a6b1de82109f6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/memory/system_control.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/kernel/memory/system_control.cpp b/src/core/hle/kernel/memory/system_control.cpp index 11d204bc2..e855696ad 100644 --- a/src/core/hle/kernel/memory/system_control.cpp +++ b/src/core/hle/kernel/memory/system_control.cpp @@ -25,16 +25,17 @@ u64 GenerateUniformRange(u64 min, u64 max, F f) { } } -u64 GenerateRandomU64ForInit() { +} // Anonymous namespace + +u64 GenerateRandomU64() { static std::random_device device; static std::mt19937 gen(device()); static std::uniform_int_distribution<u64> distribution(1, std::numeric_limits<u64>::max()); return distribution(gen); } -} // Anonymous namespace u64 GenerateRandomRange(u64 min, u64 max) { - return GenerateUniformRange(min, max, GenerateRandomU64ForInit); + return GenerateUniformRange(min, max, GenerateRandomU64); } } // namespace Kernel::Memory::SystemControl |