summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-09-09 11:02:06 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-23 13:42:08 +0200
commitea546c05f13858ca99bb3d8342131cae39d627c2 (patch)
tree2d69352048498045bbf09e2094a8d6ffad0c5ff6 /src/corelib/tools/qbytearray.cpp
parentceb3a071d2e5bf4f3c6ea30dec983c3852959ed9 (diff)
QByteArray's shared_null and shared_empty should be const
QByteArray::squeeze() needs to make sure to detach if the data is shared, otherwise it would end up crashing when squeeze() is called on a QByteArray using the shared_null or shared_empty. Change-Id: I89c178659d8c7448681304f050fd69e17b2387de Reviewed-on: http://codereview.qt-project.org/4528 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 11ebd8a103..fc4f4dc67f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -614,10 +614,10 @@ static inline char qToLower(char c)
return c;
}
-QConstByteArrayData<1> QByteArray::shared_null = { { Q_REFCOUNT_INITIALIZER(-1),
- 0, 0, 0, { 0 } }, { 0 } };
-QConstByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALIZER(-1),
- 0, 0, 0, { 0 } }, { 0 } };
+const QConstByteArrayData<1> QByteArray::shared_null = { { Q_REFCOUNT_INITIALIZER(-1),
+ 0, 0, 0, { 0 } }, { 0 } };
+const QConstByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALIZER(-1),
+ 0, 0, 0, { 0 } }, { 0 } };
/*!
\class QByteArray