From 864f7a0ceb89bd28b842ec5e0d0ed6abf112be9c Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 13 Mar 2006 13:26:41 +0000 Subject: fix MSVC 2005 warnings git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@217 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- nbtheory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nbtheory.cpp') 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 &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; -- cgit v1.2.1