diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-07-25 04:52:24 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-07-25 04:52:24 -0400 |
commit | e4c402ace907100cc1e71dabda7055034efaf06e (patch) | |
tree | c10bc9ac1dffbf1302822e54fadebea4d18f7fac /rng.cpp | |
parent | 12382a14bef384f12b739d096beb556ba04bd199 (diff) | |
download | cryptopp-git-e4c402ace907100cc1e71dabda7055034efaf06e.tar.gz |
Clear truncation warning in rng.cpp (PR #867)
Diffstat (limited to 'rng.cpp')
-rw-r--r-- | rng.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -40,15 +40,14 @@ void LC_RNG::GenerateBlock(byte *output, size_t size) {
while (size--)
{
- word32 hi = seed/q;
- word32 lo = seed%q;
-
- sword64 test = a*lo - r*hi;
+ const word32 hi = seed/q;
+ const word32 lo = seed%q;
+ const sword64 test = a*lo - r*hi;
if (test > 0)
- seed = test;
+ seed = static_cast<word32>(test);
else
- seed = test+ m;
+ seed = static_cast<word32>(test + m);
*output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3)));
}
|