Fix some 64-bit compilation issues.

[SVN r79362]
This commit is contained in:
John Maddock
2012-07-08 17:54:35 +00:00
parent 19ee491c55
commit 08ee67ccc2
3 changed files with 4 additions and 3 deletions

View File

@@ -1511,7 +1511,8 @@ void divide_unsigned_helper(cpp_int_backend<MinBits, Signed, Allocator>* result,
{
result->resize(r_order + 1);
pres = result->limbs();
pres[r_order] = 0; // just in case we don't set the most significant limb below.
if(result->size() > r_order)
pres[r_order] = 0; // just in case we don't set the most significant limb below.
}
do

View File

@@ -200,7 +200,7 @@ struct tommath_int
unsigned shift = radix == 8 ? 3 : 4;
unsigned block_count = DIGIT_BIT / shift;
unsigned block_shift = shift * block_count;
boost::uint32_t val, block;
unsigned long long val, block;
while(*s)
{
block = 0;

View File

@@ -138,7 +138,7 @@ int main()
#ifdef TEST_CPP_INT
test_miller_rabin<mp_number<cpp_int_backend<>, false> >("cpp_int (no Expression templates)");
test_miller_rabin<cpp_int>("cpp_int");
test_miller_rabin<mp_number<cpp_int_backend<64> > >("cpp_int (64-bit cache)");
test_miller_rabin<mp_number<cpp_int_backend<128> > >("cpp_int (128-bit cache)");
test_miller_rabin<mp_number<cpp_int_backend<256> > >("cpp_int (256-bit cache)");
test_miller_rabin<mp_number<cpp_int_backend<512> > >("cpp_int (512-bit cache)");
test_miller_rabin<mp_number<cpp_int_backend<1024> > >("cpp_int (1024-bit cache)");