diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-22 08:01:16 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-22 09:18:41 (GMT) |
commit | 66c8ec60ff44fa8f2fb0d3994ffccf4b033fdb70 (patch) | |
tree | a3bc875ff8568e621204c96f0fa2be2e0a3fab72 /src/corelib/tools | |
parent | c2083211162b085848d95bf056143f389a4d7e30 (diff) | |
download | Qt-66c8ec60ff44fa8f2fb0d3994ffccf4b033fdb70.zip Qt-66c8ec60ff44fa8f2fb0d3994ffccf4b033fdb70.tar.gz Qt-66c8ec60ff44fa8f2fb0d3994ffccf4b033fdb70.tar.bz2 |
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
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qmap.h | 9 |
1 files 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 <class Key, class T> Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::freeData(QMapData *x) { if (QTypeInfo<Key>::isComplex || QTypeInfo<T>::isComplex) { - QMapData::Node *y = reinterpret_cast<QMapData::Node *>(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<QMapData::Node *>(cur)); concreteNode->key.~Key(); concreteNode->value.~T(); #if defined(_MSC_VER) && (_MSC_VER >= 1300) |