diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-24 16:10:15 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-24 16:10:15 +0100 |
commit | 3b5c0bc0780f1749fed7c07bd8b691400a0282b7 (patch) | |
tree | 1022f5553ad5a0aca9b5f3b49ca38a01c2329d20 /src/corelib/tools/qhash.h | |
parent | c79918733a194ebbe5a2fe1617c884659f3e4b9f (diff) | |
parent | 21f1738a94fc8544ece04b3b1ee03a11986fe59b (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/gui/image/qjpeghandler.cpp
Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r-- | src/corelib/tools/qhash.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 7a421a4586..67924c0888 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -52,6 +52,12 @@ #include <initializer_list> #endif +#if defined(Q_CC_MSVC) +#pragma warning( push ) +#pragma warning( disable : 4311 ) // disable pointer truncation warning +#pragma warning( disable : 4127 ) // conditional expression is constant +#endif + QT_BEGIN_NAMESPACE class QBitArray; @@ -95,18 +101,10 @@ Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QLatin1String key, uint seed = 0) Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(const QString &key) Q_DECL_NOTHROW; Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(const QStringRef &key) Q_DECL_NOTHROW; -#if defined(Q_CC_MSVC) -#pragma warning( push ) -#pragma warning( disable : 4311 ) // disable pointer truncation warning -#endif template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW { return qHash(reinterpret_cast<quintptr>(key), seed); } -#if defined(Q_CC_MSVC) -#pragma warning( pop ) -#endif - template<typename T> inline uint qHash(const T &t, uint seed) Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t))) { return (qHash(t) ^ seed); } @@ -214,6 +212,9 @@ struct QHashNode inline QHashNode(const Key &key0, const T &value0, uint hash, QHashNode *n) : next(n), h(hash), key(key0), value(value0) {} inline bool same_key(uint h0, const Key &key0) const { return h0 == h && key0 == key; } + +private: + Q_DISABLE_COPY(QHashNode) }; template <class Key, class T> @@ -224,6 +225,9 @@ struct QHashDummyNode const Key key; inline QHashDummyNode(const Key &key0, uint hash, QHashNode<Key, T> *n) : next(n), h(hash), key(key0) {} + +private: + Q_DISABLE_COPY(QHashDummyNode) }; @@ -1087,4 +1091,8 @@ Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash) QT_END_NAMESPACE +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif + #endif // QHASH_H |