diff options
author | David Faure <david.faure@kdab.com> | 2013-08-20 11:12:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-21 21:08:01 +0200 |
commit | 943ae90744720e6b66a1f05d2a5713a9ad4bd9c6 (patch) | |
tree | f39dd54b15eb324c2e7643175d6c4922e68e6f47 /src/corelib/tools | |
parent | fcd212e7ba84647005996ceb30a3c768d401d1d6 (diff) |
QHash: fix compilation with gcc-4.2.1 (Mac OS X)
The anonymous union isn't supported and can be replaced with a reinterpret_cast.
Change-Id: Ic76a31f36e61d910db16312d7a6c4bdc728aa825
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qhash.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 25029afe1f..ce9ab33903 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -513,15 +513,10 @@ private: bool isValidIterator(const iterator &it) const { #if defined(QT_DEBUG) && !defined(Q_HASH_NO_ITERATOR_DEBUG) - union { - QHashData *iteratorHashData; - QHashData::Node *node; - }; - node = it.i; + QHashData::Node *node = it.i; while (node->next) node = node->next; - - return (iteratorHashData == d); + return (static_cast<void *>(node) == d); #else Q_UNUSED(it); return true; |