summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2016-06-27 18:47:15 +0200
committerChristian Stromme <christian.stromme@qt.io>2016-11-01 12:44:09 +0000
commitc671c09b037277e9d61068d6f6dd97073217946d (patch)
tree85e138f3081f2758dff8ac65523f98ec19a4844c
parent800a069b05b7c839bf78eea5dccf061f3d4bf762 (diff)
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 <yoann.lopes@qt.io>
-rw-r--r--src/multimedia/camera/qcamera.cpp10
1 files 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);
}
/*!