From d0b856cfbb99b1f1833a18ff556d517a7e3f04d8 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 25 Dec 2013 17:31:09 -0800 Subject: Making the necessary changes to get libtommath, libtomcrypt and BigInt to compile under MSVC. --- src/BigInt.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/BigInt.cc') diff --git a/src/BigInt.cc b/src/BigInt.cc index 73bfe29..8ec1b12 100644 --- a/src/BigInt.cc +++ b/src/BigInt.cc @@ -61,6 +61,8 @@ Balau::BigInt & Balau::BigInt::operator=(const BigInt & v) throw (GeneralExcepti if (mp_copy(v.m_bi, m_bi) != CRYPT_OK) throw GeneralException("Error while calling mp_init_copy"); + + return *this; } void Balau::BigInt::set(uint64_t v) throw (GeneralException) { @@ -149,7 +151,7 @@ uint64_t Balau::BigInt::to_uint64() const throw (GeneralException) { int64_t Balau::BigInt::to_int64() const throw (GeneralException) { if (mp_count_bits(m_bi) > 63) throw GeneralException("BigInt too big to fit in a int64"); - uint64_t v = 0; + int64_t v = 0; int shift = 0; int digit = 0; while (shift <= 63) { @@ -175,7 +177,7 @@ uint32_t Balau::BigInt::to_uint32() const throw (GeneralException) { int32_t Balau::BigInt::to_int32() const throw (GeneralException) { if (mp_count_bits(m_bi) > 31) throw GeneralException("BigInt too big to fit in a uint32"); - uint64_t v = 0; + int64_t v = 0; int shift = 0; int digit = 0; while (shift <= 31) { -- cgit v1.2.3