qlocale_tools_p.h: fix -Wfloat-equal
Compilers _do_ grumble, after all: qlocale_tools_p.h:68:14: warning: comparing floating point with == or != is unsafe [-Wfloat-equal] return d == 0; // Amusingly, compilers do not grumble. ~ ^ ~ Fix by using the public qIsNull(double) function, which has suppressions and was designed for this task. Amends f645bb8880df3cb7c9e51e6c3398485292926a3c. Pick-to: 6.7 6.5 Task-number: QTBUG-126219 Change-Id: I33f1fcb4c8c2ee30ad9a36cb46b806ef253e8062 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit aac83724013a1f226d2bf4b923447eb1b0e5c493) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b291e7eb46
commit
d96ce5eb0d
@ -65,7 +65,7 @@ void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision,
|
||||
|
||||
[[nodiscard]] constexpr inline bool isZero(double d)
|
||||
{
|
||||
return d == 0; // Amusingly, compilers do not grumble.
|
||||
return qIsNull(d);
|
||||
}
|
||||
|
||||
// Enough space for the digits before the decimal separator:
|
||||
|
Loading…
x
Reference in New Issue
Block a user