From f8f501ec9853231805097a5dbaf0ea99196e8014 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 9 Sep 2011 11:10:48 +0200 Subject: Make QLinkedListData::shared_null const Similar to QList, QMap, QVector, QByteArray and QString, keep the shared_null in shareable memory and never modify it. Change-Id: I70b484d528c397a9d205b1418b6dc920c69dc725 Reviewed-on: http://codereview.qt-project.org/4532 Reviewed-by: Qt Sanity Bot Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qlinkedlist.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qlinkedlist.cpp') diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index 97298dde3d..16105530bf 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -43,9 +43,10 @@ QT_BEGIN_NAMESPACE -QLinkedListData QLinkedListData::shared_null = { - &QLinkedListData::shared_null, &QLinkedListData::shared_null, - Q_BASIC_ATOMIC_INITIALIZER(1), 0, true +const QLinkedListData QLinkedListData::shared_null = { + const_cast(&QLinkedListData::shared_null), + const_cast(&QLinkedListData::shared_null), + Q_REFCOUNT_INITIALIZER(-1), 0, true }; /*! \class QLinkedList -- cgit v1.2.3