diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-09-09 11:08:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-26 07:50:20 +0200 |
commit | 564086b366427da27eb1573e82fda7ab62dc4a17 (patch) | |
tree | 46a1d6334f46ba1d7d4321f4e47829edea531453 /src/corelib/tools/qmap.cpp | |
parent | cc3bf12ef69c086069835585f298fe603e632aed (diff) |
Make QMapData::shared_null const
Similar to QVector, QByteArray and QString, keep the shared_null in
shareable memory and never modify it.
Change-Id: I062825684b79f2b01ec7ce65e0cf74f417b760b8
Reviewed-on: http://codereview.qt-project.org/4530
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/tools/qmap.cpp')
-rw-r--r-- | src/corelib/tools/qmap.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index aecc73c8dd..bd7c76c37a 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE -QMapData QMapData::shared_null = { - &shared_null, - { &shared_null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, 0, false, true, false, 0 +const QMapData QMapData::shared_null = { + const_cast<QMapData *>(&shared_null), + { const_cast<QMapData *>(&shared_null), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + Q_REFCOUNT_INITIALIZER(-1), 0, 0, 0, false, true, false, 0 }; QMapData *QMapData::createData() |