From 66c8ec60ff44fa8f2fb0d3994ffccf4b033fdb70 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 22 Sep 2009 10:01:16 +0200 Subject: Fixes warnings in QMap Get rid of the pages of warning you get when compiling code that uses QtConcurrent::map for instance. qmap.h:607: warning: dereferencing pointer 'y' does break strict-aliasing rules qmap.h:605: note: initialized from here Reviewed-by: Peter Hartmann --- src/corelib/tools/qmap.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index c1be49a..688aca6 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -602,16 +602,15 @@ template Q_OUTOFLINE_TEMPLATE void QMap::freeData(QMapData *x) { if (QTypeInfo::isComplex || QTypeInfo::isComplex) { - QMapData::Node *y = reinterpret_cast(x); - QMapData::Node *cur = y; - QMapData::Node *next = cur->forward[0]; - while (next != y) { + QMapData *cur = x; + QMapData *next = cur->forward[0]; + while (next != x) { cur = next; next = cur->forward[0]; #if defined(_MSC_VER) && (_MSC_VER >= 1300) #pragma warning(disable:4189) #endif - Node *concreteNode = concrete(cur); + Node *concreteNode = concrete(reinterpret_cast(cur)); concreteNode->key.~Key(); concreteNode->value.~T(); #if defined(_MSC_VER) && (_MSC_VER >= 1300) -- cgit v0.12