Skip to content

Commit e8a3292

Browse files
Update double-conversion and reapply NO_LINTs.
Fixes a -Werror=strict-overflow in gcc 5.2.1. google/double-conversion@56a0457 BUG=http://dartbug.com/25630 [email protected] Review URL: https://codereview.chromium.org/1658343002 .
1 parent 6780481 commit e8a3292

File tree

7 files changed

+181
-88
lines changed

7 files changed

+181
-88
lines changed

runtime/third_party/double-conversion/src/bignum.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void Bignum::AssignDecimalString(Vector<const char> value) {
104104
const int kMaxUint64DecimalDigits = 19;
105105
Zero();
106106
int length = value.length();
107-
int pos = 0;
107+
unsigned int pos = 0;
108108
// Let's just say that each digit needs 4 bits.
109109
while (length >= kMaxUint64DecimalDigits) {
110110
uint64_t digits = ReadUInt64(value, pos, kMaxUint64DecimalDigits);

runtime/third_party/double-conversion/src/bignum.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class Bignum {
4949

5050
void AssignPowerUInt16(uint16_t base, int exponent);
5151

52-
void AddUInt16(uint16_t operand);
5352
void AddUInt64(uint64_t operand);
5453
void AddBignum(const Bignum& other);
5554
// Precondition: this >= other.

runtime/third_party/double-conversion/src/cached-powers.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ static const CachedPower kCachedPowers[] = {
131131
{UINT64_2PART_C(0xaf87023b, 9bf0ee6b), 1066, 340},
132132
};
133133

134-
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
135134
static const int kCachedPowersOffset = 348; // -1 * the first decimal_exponent.
136135
static const double kD_1_LOG2_10 = 0.30102999566398114; // 1 / lg(10)
137136
// Difference between the decimal exponents in the table above.
@@ -149,7 +148,7 @@ void PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
149148
int foo = kCachedPowersOffset;
150149
int index =
151150
(foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
152-
ASSERT(0 <= index && index < kCachedPowersLength);
151+
ASSERT(0 <= index && index < static_cast<int>(ARRAY_SIZE(kCachedPowers)));
153152
CachedPower cached_power = kCachedPowers[index];
154153
ASSERT(min_exponent <= cached_power.binary_exponent);
155154
(void) max_exponent; // Mark variable as used.

runtime/third_party/double-conversion/src/diy-fp.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DiyFp {
4242
static const int kSignificandSize = 64;
4343

4444
DiyFp() : f_(0), e_(0) {}
45-
DiyFp(uint64_t f, int e) : f_(f), e_(e) {}
45+
DiyFp(uint64_t significand, int exponent) : f_(significand), e_(exponent) {}
4646

4747
// this = this - other.
4848
// The exponents of both numbers must be the same and the significand of this
@@ -76,22 +76,22 @@ class DiyFp {
7676

7777
void Normalize() {
7878
ASSERT(f_ != 0);
79-
uint64_t f = f_;
80-
int e = e_;
79+
uint64_t significand = f_;
80+
int exponent = e_;
8181

8282
// This method is mainly called for normalizing boundaries. In general
8383
// boundaries need to be shifted by 10 bits. We thus optimize for this case.
8484
const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000);
85-
while ((f & k10MSBits) == 0) {
86-
f <<= 10;
87-
e -= 10;
85+
while ((significand & k10MSBits) == 0) {
86+
significand <<= 10;
87+
exponent -= 10;
8888
}
89-
while ((f & kUint64MSB) == 0) {
90-
f <<= 1;
91-
e--;
89+
while ((significand & kUint64MSB) == 0) {
90+
significand <<= 1;
91+
exponent--;
9292
}
93-
f_ = f;
94-
e_ = e;
93+
f_ = significand;
94+
e_ = exponent;
9595
}
9696

9797
static DiyFp Normalize(const DiyFp& a) {

0 commit comments

Comments
 (0)