Clear truncation warning in rng.cpp (PR #867)
parent
12382a14be
commit
e4c402ace9
11
rng.cpp
11
rng.cpp
|
|
@ -40,15 +40,14 @@ void LC_RNG::GenerateBlock(byte *output, size_t size)
|
||||||
{
|
{
|
||||||
while (size--)
|
while (size--)
|
||||||
{
|
{
|
||||||
word32 hi = seed/q;
|
const word32 hi = seed/q;
|
||||||
word32 lo = seed%q;
|
const word32 lo = seed%q;
|
||||||
|
const sword64 test = a*lo - r*hi;
|
||||||
sword64 test = a*lo - r*hi;
|
|
||||||
|
|
||||||
if (test > 0)
|
if (test > 0)
|
||||||
seed = test;
|
seed = static_cast<word32>(test);
|
||||||
else
|
else
|
||||||
seed = test+ m;
|
seed = static_cast<word32>(test + m);
|
||||||
|
|
||||||
*output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3)));
|
*output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue