summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/double-conversion/cached-powers.cc
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-04-27 10:38:18 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-05-02 14:19:32 +0000
commit6a39e49a6cdeb28a04a3657bb6a22f848d5dfa9d (patch)
tree5378e376b96ebb38d7bd9b16c9d4e400fef217b9 /src/3rdparty/double-conversion/cached-powers.cc
parentfa854f214a3c812e5548ff55d179dd07ef99053b (diff)
Upgrade double-conversion to v3.0.0
This fixes their issue #41, a potential undefined behavior. We preserve the locally added "__ghs" clause as well as the _M_ARM_FP clause necessary for winrt in utils.h. [ChangeLog][Third-Party Code] double-conversion got updated to upstream version 3.0.0. Task-number: QTBUG-66561 Change-Id: Id79125bdeeaebb61dca2e2885d3370accce9030c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/3rdparty/double-conversion/cached-powers.cc')
-rw-r--r--src/3rdparty/double-conversion/cached-powers.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/3rdparty/double-conversion/cached-powers.cc b/src/3rdparty/double-conversion/cached-powers.cc
index 9536f26927..2b43f06412 100644
--- a/src/3rdparty/double-conversion/cached-powers.cc
+++ b/src/3rdparty/double-conversion/cached-powers.cc
@@ -131,7 +131,6 @@ static const CachedPower kCachedPowers[] = {
{UINT64_2PART_C(0xaf87023b, 9bf0ee6b), 1066, 340},
};
-static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
static const int kCachedPowersOffset = 348; // -1 * the first decimal_exponent.
static const double kD_1_LOG2_10 = 0.30102999566398114; // 1 / lg(10)
// Difference between the decimal exponents in the table above.
@@ -144,14 +143,12 @@ void PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
int max_exponent,
DiyFp* power,
int* decimal_exponent) {
- (void)max_exponent; // Silence unused parameter warning in release builds
- (void)kCachedPowersLength; // Silence unused parameter warning in release builds
int kQ = DiyFp::kSignificandSize;
double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10);
int foo = kCachedPowersOffset;
int index =
(foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
- ASSERT(0 <= index && index < kCachedPowersLength);
+ ASSERT(0 <= index && index < static_cast<int>(ARRAY_SIZE(kCachedPowers)));
CachedPower cached_power = kCachedPowers[index];
ASSERT(min_exponent <= cached_power.binary_exponent);
(void) max_exponent; // Mark variable as used.