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>
This commit is contained in:
David Faure 2013-08-20 11:12:18 +02:00 committed by The Qt Project
parent fcd212e7ba
commit 943ae90744

View File

@ -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;