diff options
author | Dan Brown <[email protected]> | 2016-04-27 15:21:26 -0700 |
---|---|---|
committer | Dan Brown <[email protected]> | 2016-04-27 15:21:26 -0700 |
commit | a0a2b66b3b6ba9dd94f924ef9639570f4a4ae2b6 (patch) | |
tree | c4fdfd8e588a2550a0d2b6f5c41d1cdffffcacc6 /src/lib/math/numbertheory | |
parent | b55e9bca0c747154aeeb188df9a8a6eda6d65124 (diff) |
Add explicit static_cast operations to eliminate implicit cast compiler warnings.
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r-- | src/lib/math/numbertheory/make_prm.cpp | 2 | ||||
-rw-r--r-- | src/lib/math/numbertheory/numthry.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/math/numbertheory/make_prm.cpp b/src/lib/math/numbertheory/make_prm.cpp index 3d82adf06..acd187063 100644 --- a/src/lib/math/numbertheory/make_prm.cpp +++ b/src/lib/math/numbertheory/make_prm.cpp @@ -66,7 +66,7 @@ BigInt random_prime(RandomNumberGenerator& rng, secure_vector<u16bit> sieve(sieve_size); for(size_t j = 0; j != sieve.size(); ++j) - sieve[j] = p % PRIMES[j]; + sieve[j] = static_cast<u16bit>(p % PRIMES[j]); size_t counter = 0; while(true) diff --git a/src/lib/math/numbertheory/numthry.cpp b/src/lib/math/numbertheory/numthry.cpp index ae2d33524..6c3d2c931 100644 --- a/src/lib/math/numbertheory/numthry.cpp +++ b/src/lib/math/numbertheory/numthry.cpp @@ -446,7 +446,7 @@ bool is_prime(const BigInt& n, RandomNumberGenerator& rng, // Fast path testing for small numbers (<= 65521) if(n <= PRIMES[PRIME_TABLE_SIZE-1]) { - const u16bit num = n.word_at(0); + const u16bit num = static_cast<u16bit>(n.word_at(0)); return std::binary_search(PRIMES, PRIMES + PRIME_TABLE_SIZE, num); } |