From c671c09b037277e9d61068d6f6dd97073217946d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 27 Jun 2016 18:47:15 +0200 Subject: Add missing Q_DECL_CONSTEXPR The functions were missing the constexpr specifier, and since the code was touched, the equality check was also updated to use qFuzzyCompare. Change-Id: Ib06c5e7927bef0ebe513a411e2bb79b433e3ccd7 Reviewed-by: Yoann Lopes --- src/multimedia/camera/qcamera.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index bec894b75..ae98ef4f4 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -65,17 +65,15 @@ static void qRegisterCameraMetaTypes() Q_CONSTRUCTOR_FUNCTION(qRegisterCameraMetaTypes) -static bool qt_sizeLessThan(const QSize &s1, const QSize &s2) +Q_DECL_CONSTEXPR static bool qt_sizeLessThan(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW { return (s1.width() * s1.height()) < (s2.width() * s2.height()); } -static bool qt_frameRateRangeLessThan(const QCamera::FrameRateRange &s1, const QCamera::FrameRateRange &s2) +Q_DECL_CONSTEXPR static bool qt_frameRateRangeLessThan(const QCamera::FrameRateRange &s1, const QCamera::FrameRateRange &s2) Q_DECL_NOTHROW { - if (s1.maximumFrameRate == s2.maximumFrameRate) - return s1.minimumFrameRate < s2.minimumFrameRate; - - return s1.maximumFrameRate < s2.maximumFrameRate; + return qFuzzyCompare(s1.maximumFrameRate, s2.maximumFrameRate) ? (s1.minimumFrameRate < s2.minimumFrameRate) + : (s1.maximumFrameRate < s2.maximumFrameRate); } /*! -- cgit v1.2.3