tools: change xrand to normal rand c with static variable for seed call

This commit is contained in:
2025-05-07 23:26:48 +02:00
parent ab0c61c474
commit 26f9b93c70
+6 -2
View File
@@ -4,6 +4,7 @@
#define MMOD ((1 << (POW)) - 1)
#define SUBA 5
#define SUBB 8
#if 0
int xrand(){
int mod = MMOD; // (1 << 17) - 1;
int a = (1<<(POW-(SUBA))) - 1;
@@ -17,7 +18,9 @@ int xrand(){
xi = xii;
return xii;
/*
}
#else
int xrand(){
static bool init = true;
if(init){
init = false;
@@ -28,8 +31,9 @@ int xrand(){
}
int ret = rand ();
return ret ;
*/
}
#endif
int irand(){
int mod = MMOD; // (1 << 17) - 1;
int a = (1<<(POW-(SUBA))) - 1;