Skip to content

Commit 7ff2753

Browse files
author
sourcehold
committed
improve code style
1 parent b5134e6 commit 7ff2753

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

src/OpenSHC/Random/RNG/populateRNG1040.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,24 @@ namespace Random {
1010
void RNG::populateRNG1040()
1111

1212
{
13-
int iVar1;
14-
int iVar2;
15-
short* _pRandomNumber;
1613

1714
MACRO_CALL(OpenSHC::Global_Func::SetRNGSeed)(this->seed);
1815
this->index2 = 0;
1916
this->index1 = 0;
20-
_pRandomNumber = &this->randomNumbers[0];
21-
iVar2 = 20000;
17+
short* _pRandomNumber = &this->randomNumbers[0];
18+
int n = 20000;
2219
do {
23-
iVar1 = MACRO_CALL(OpenSHC::OS_Func::_rand)();
24-
*_pRandomNumber = (short)iVar1;
25-
_pRandomNumber = _pRandomNumber + 1;
26-
iVar2 = iVar2 + -1;
27-
} while (iVar2 != 0);
20+
int random = MACRO_CALL(OpenSHC::OS_Func::_rand)();
21+
*_pRandomNumber = (short)random;
22+
_pRandomNumber += 1;
23+
n -= 1;
24+
} while (n != 0);
2825

2926
this->currentNumber2 = this->randomNumbers[this->index2];
30-
this->index2 = this->index2 + 1;
27+
this->index2 += 1;
3128

3229
this->currentNumber1 = this->randomNumbers[this->index1];
33-
this->index1 = this->index1 + 1;
30+
this->index1 += 1;
3431

3532
return;
3633
}

src/OpenSHC/Random/RNG/setTimeBasedSeed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Random {
1111

1212
{
1313

14-
__time64_t _Var1 = MACRO_CALL(OpenSHC::OS_Func::__time64)((__time64_t*)0x0);
15-
this->seed = (int)_Var1;
14+
__time64_t time = MACRO_CALL(OpenSHC::OS_Func::__time64)((__time64_t*)0x0);
15+
this->seed = (int)time;
1616
return;
1717
}
1818

0 commit comments

Comments
 (0)