summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/double-conversion/diy-fp.h
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/diy-fp.h
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/diy-fp.h')
-rw-r--r--src/3rdparty/double-conversion/diy-fp.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/3rdparty/double-conversion/diy-fp.h b/src/3rdparty/double-conversion/diy-fp.h
index 9dcf8fbdba..2edf34674e 100644
--- a/src/3rdparty/double-conversion/diy-fp.h
+++ b/src/3rdparty/double-conversion/diy-fp.h
@@ -42,7 +42,7 @@ class DiyFp {
static const int kSignificandSize = 64;
DiyFp() : f_(0), e_(0) {}
- DiyFp(uint64_t f, int e) : f_(f), e_(e) {}
+ DiyFp(uint64_t significand, int exponent) : f_(significand), e_(exponent) {}
// this = this - other.
// The exponents of both numbers must be the same and the significand of this
@@ -76,22 +76,22 @@ class DiyFp {
void Normalize() {
ASSERT(f_ != 0);
- uint64_t f = f_;
- int e = e_;
+ uint64_t significand = f_;
+ int exponent = e_;
// This method is mainly called for normalizing boundaries. In general
// boundaries need to be shifted by 10 bits. We thus optimize for this case.
const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000);
- while ((f & k10MSBits) == 0) {
- f <<= 10;
- e -= 10;
+ while ((significand & k10MSBits) == 0) {
+ significand <<= 10;
+ exponent -= 10;
}
- while ((f & kUint64MSB) == 0) {
- f <<= 1;
- e--;
+ while ((significand & kUint64MSB) == 0) {
+ significand <<= 1;
+ exponent--;
}
- f_ = f;
- e_ = e;
+ f_ = significand;
+ e_ = exponent;
}
static DiyFp Normalize(const DiyFp& a) {