diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-05-02 11:48:20 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2020-05-05 12:24:12 -0700 |
commit | ff6d2cb0d5779d81e89d94d65c8d164602fa2567 (patch) | |
tree | fc9bf0a0fbe3ce89a7ee831943d566cd77799910 /src/gui/util | |
parent | 64349c3fd5d6c2acabd1cfd5119a7060b017fdc0 (diff) | |
download | qtbase-ff6d2cb0d5779d81e89d94d65c8d164602fa2567.tar.gz |
Fix Clang 10 warning about LLONG_MAX being inexact in double
validator.cpp:707:19: error: implicit conversion from 'long long' to 'double' changes value from
9223372036854775807 to 9223372036854775808 [-Werror,- Wimplicit-int-float-conversion]
Task-number: QTBUG-83666
Pick-To: 5.15
Change-Id: I99ab0f318b1c43b89888fffd160b4a95a258423b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qvalidator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp index b968592c01..21641a76b4 100644 --- a/src/gui/util/qvalidator.cpp +++ b/src/gui/util/qvalidator.cpp @@ -693,8 +693,9 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL if (notation == QDoubleValidator::StandardNotation) { double max = qMax(qAbs(q->b), qAbs(q->t)); - if (max < double(LLONG_MAX)) { - qlonglong n = pow10(numDigits(qlonglong(max))); + qlonglong v; + if (convertDoubleTo(max, &v)) { + qlonglong n = pow10(numDigits(v)); // In order to get the highest possible number in the intermediate // range we need to get 10 to the power of the number of digits // after the decimal's and subtract that from the top number. |