From 8e127d9df868952d41c8aa622b6d4ead8139a835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 12 Apr 2013 16:08:41 +0200 Subject: Add default value for qHash's 'seed' argument for QOpenGLVersionProfile/Status Although template inline uint qHash(const T &t, uint seed) from qhash.h is never instantiated because we have the two-argument version of qHash() for both QOpenGLVersionProfile and QOpenGLVersionStatus, we need the default argument, as the template in qhash.h uses noexcept, which is evaluated regardless of instantiation, and uses qHash(t) without a seed. This behavior seems to not be the case with Apple clang 4.2, but has been observed with Apple clang 4.1, Clang 3.2, and GCC 4.8. Change-Id: If70e93f64eb9675a7c3ef7897ced2c6aebbec2d6 Reviewed-by: Eike Ziller Reviewed-by: Olivier Goffart --- src/gui/kernel/qopenglcontext.h | 2 +- src/gui/opengl/qopenglversionfunctions.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 419fd541eb..bfdb8921af 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -101,7 +101,7 @@ private: QOpenGLVersionProfilePrivate* d; }; -inline uint qHash(const QOpenGLVersionProfile &v, uint seed) +inline uint qHash(const QOpenGLVersionProfile &v, uint seed = 0) { return qHash(static_cast(v.profile() * 1000) + v.version().first * 100 + v.version().second * 10, seed); diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h index 833c5adf9f..304b944de8 100644 --- a/src/gui/opengl/qopenglversionfunctions.h +++ b/src/gui/opengl/qopenglversionfunctions.h @@ -91,7 +91,7 @@ struct QOpenGLVersionStatus OpenGLStatus status; }; -inline uint qHash(const QOpenGLVersionStatus &v, uint seed) +inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) { return qHash(static_cast(v.status * 1000) + v.version.first * 100 + v.version.second * 10, seed); -- cgit v1.2.3