1 parent
188cfae0d7
commit
5687cb512c
21 files changed
+108
-27
No files matched your search
@@ -67,7 +67,7 @@ wp_intern void seedOsGenerator(u64 seed) {
|
||||
seed = (u64)ts.tv_nsec;
|
||||
}
|
||||
|
||||
srand(seed);
|
||||
srand((u32)seed);
|
||||
}
|
||||
|
||||
wp_intern u64 genRandomNumber(void) {
|
||||
|
||||
@@ -13,7 +13,10 @@ WpXor256State wpPrngXorshiftInit(void) {
|
||||
|
||||
WpXor256State wpPrngXorshiftInitWithSeed(u64 seed) {
|
||||
WpSplitmix64State sm64;
|
||||
if (seed > 0) {
|
||||
|
||||
// NOTE (Abdelrahman): Extract into a variable to get rid of MSVC Spectre mitigation warnings
|
||||
b8 seed_not_zero = seed > 0;
|
||||
if (seed_not_zero) {
|
||||
sm64 = wpPrngSplitmix64InitWithSeed(seed);
|
||||
} else {
|
||||
sm64 = wpPrngSplitmix64Init();
|
||||
|
||||
Reference in new issue
Block a user