From 943ae90744720e6b66a1f05d2a5713a9ad4bd9c6 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 20 Aug 2013 11:12:18 +0200 Subject: [PATCH] QHash: fix compilation with gcc-4.2.1 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The anonymous union isn't supported and can be replaced with a reinterpret_cast. Change-Id: Ic76a31f36e61d910db16312d7a6c4bdc728aa825 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Oswald Buddenhagen Reviewed-by: Olivier Goffart --- src/corelib/tools/qhash.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 25029afe1f5..ce9ab33903f 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(node) == d); #else Q_UNUSED(it); return true;