Index: src/bignum.cc |
=================================================================== |
--- src/bignum.cc (revision 6654) |
+++ src/bignum.cc (working copy) |
@@ -67,7 +67,7 @@ |
int needed_bigits = kUInt64Size / kBigitSize + 1; |
EnsureCapacity(needed_bigits); |
for (int i = 0; i < needed_bigits; ++i) { |
- bigits_[i] = value & kBigitMask; |
+ bigits_[i] = static_cast<Chunk>(value & kBigitMask); |
value = value >> kBigitSize; |
} |
used_digits_ = needed_bigits; |
@@ -266,7 +266,7 @@ |
} |
while (carry != 0) { |
EnsureCapacity(used_digits_ + 1); |
- bigits_[used_digits_] = carry & kBigitMask; |
+ bigits_[used_digits_] = static_cast<Chunk>(carry & kBigitMask); |
used_digits_++; |
carry >>= kBigitSize; |
} |
@@ -287,13 +287,13 @@ |
uint64_t product_low = low * bigits_[i]; |
uint64_t product_high = high * bigits_[i]; |
uint64_t tmp = (carry & kBigitMask) + product_low; |
- bigits_[i] = tmp & kBigitMask; |
+ bigits_[i] = static_cast<Chunk>(tmp & kBigitMask); |
carry = (carry >> kBigitSize) + (tmp >> kBigitSize) + |
(product_high << (32 - kBigitSize)); |
} |
while (carry != 0) { |
EnsureCapacity(used_digits_ + 1); |
- bigits_[used_digits_] = carry & kBigitMask; |
+ bigits_[used_digits_] = static_cast<Chunk>(carry & kBigitMask); |
used_digits_++; |
carry >>= kBigitSize; |
} |
@@ -748,7 +748,8 @@ |
for (int i = 0; i < other.used_digits_; ++i) { |
DoubleChunk product = static_cast<DoubleChunk>(factor) * other.bigits_[i]; |
DoubleChunk remove = borrow + product; |
- Chunk difference = bigits_[i + exponent_diff] - (remove & kBigitMask); |
+ Chunk difference = |
+ bigits_[i + exponent_diff] - static_cast<Chunk>(remove & kBigitMask); |
bigits_[i + exponent_diff] = difference & kBigitMask; |
borrow = static_cast<Chunk>((difference >> (kChunkSize - 1)) + |
(remove >> kBigitSize)); |