diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-03-13 13:26:41 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-03-13 13:26:41 +0000 |
commit | 864f7a0ceb89bd28b842ec5e0d0ed6abf112be9c (patch) | |
tree | f30468f446dfdde7bc27bc6c82de67f227721b05 /nbtheory.cpp | |
parent | fc3a5e7e8f632112420df1d99f0d2080f19477d0 (diff) | |
download | cryptopp-864f7a0ceb89bd28b842ec5e0d0ed6abf112be9c.tar.gz |
fix MSVC 2005 warnings
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@217 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'nbtheory.cpp')
-rw-r--r-- | nbtheory.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nbtheory.cpp b/nbtheory.cpp index 97689bd..75edc14 100644 --- a/nbtheory.cpp +++ b/nbtheory.cpp @@ -319,7 +319,7 @@ bool PrimeSieve::NextCandidate(Integer &c) } else { - c = m_first + m_next*m_step; + c = m_first + long(m_next)*m_step; ++m_next; return true; } @@ -330,9 +330,9 @@ void PrimeSieve::SieveSingle(std::vector<bool> &sieve, word16 p, const Integer & if (stepInv) { size_t sieveSize = sieve.size(); - word j = word((word32(p-(first%p))*stepInv) % p); + size_t j = (word32(p-(first%p))*stepInv) % p; // if the first multiple of p is p, skip it - if (first.WordCount() <= 1 && first + step*j == p) + if (first.WordCount() <= 1 && first + step*long(j) == p) j += p; for (; j < sieveSize; j += p) sieve[j] = true; @@ -353,7 +353,7 @@ void PrimeSieve::DoSieve() if (m_delta == 0) { for (unsigned int i = 0; i < primeTableSize; ++i) - SieveSingle(m_sieve, primeTable[i], m_first, m_step, m_step.InverseMod(primeTable[i])); + SieveSingle(m_sieve, primeTable[i], m_first, m_step, (word16)m_step.InverseMod(primeTable[i])); } else { @@ -363,7 +363,7 @@ void PrimeSieve::DoSieve() for (unsigned int i = 0; i < primeTableSize; ++i) { word16 p = primeTable[i]; - word16 stepInv = m_step.InverseMod(p); + word16 stepInv = (word16)m_step.InverseMod(p); SieveSingle(m_sieve, p, m_first, m_step, stepInv); word16 halfStepInv = 2*stepInv < p ? 2*stepInv : 2*stepInv-p; |