summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorNicolas Arnaud-Cormos <nicolas.arnaud-cormos.qnx@kdab.com>2012-05-23 09:36:21 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-23 21:25:25 +0200
commit5e905619285b538cd94882f44a39fe748206f1fb (patch)
tree7f5c5cbd1d75f54904bba2de9134c21456424414 /src/corelib/tools
parentf2b8a1237fb5f27957ab3dc7c84335c1dea90ce7 (diff)
Fix local variable is initialized but not referenced warning
The pragma needs to enclose the whole function. This change is not necessary in Qt 5 since QMap was rewritten. Change-Id: I63bb94ec09b9cb3c499938cde9c7fb690039406e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qmap.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 1b7c20bb4a..8e6def5985 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -634,6 +634,10 @@ Q_INLINE_TEMPLATE QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
return *this;
}
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4189)
+#endif
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::freeData(QMapData *x)
{
@@ -643,19 +647,16 @@ Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::freeData(QMapData *x)
while (next != x) {
cur = next;
next = cur->forward[0];
-#if defined(_MSC_VER)
-#pragma warning(disable:4189)
-#endif
Node *concreteNode = concrete(reinterpret_cast<QMapData::Node *>(cur));
concreteNode->key.~Key();
concreteNode->value.~T();
-#if defined(_MSC_VER)
-#pragma warning(default:4189)
-#endif
}
}
x->continueFreeData(payload());
}
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE int QMap<Key, T>::remove(const Key &akey)