From e7295c959b73cec09e36d3703d5619e8e7aa5fb1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 16 Dec 2016 12:56:23 -0800 Subject: Add -Wfloat-equal to Qt's header clean check Task-number: QTBUG-57649 Change-Id: I15b62e0f9cec482fbb40fffd1490d802c54bf0fe Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll --- src/corelib/tools/qrect.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index f973cf3494..4030cccbd5 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -662,12 +662,18 @@ Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) Q_DECL_NOTHROW { } +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wfloat-equal") +QT_WARNING_DISABLE_GCC("-Wfloat-equal") + Q_DECL_CONSTEXPR inline bool QRectF::isNull() const Q_DECL_NOTHROW { return w == 0. && h == 0.; } Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW { return w <= 0. || h <= 0.; } +QT_WARNING_POP + Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW { return w > 0. && h > 0.; } -- cgit v1.2.3