summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.h
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-04-24 12:25:07 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-04 17:57:46 +0200
commitdcdd837a5699a840036f3a0a760e05ff552d2193 (patch)
tree223f12a690ed8f59f12bbd32067250b06d9909df /src/corelib/tools/qbytearray.h
parent9a140d65217e22324d3f75d7c6e48eeca84f5c71 (diff)
Replace QByteArrayData class by typedef.
QByteArrayData was binary compatible with QArrayData, but we do not need a separate class, QArrayData should be sufficient. Preferably we would use QTypedArrayData<char> but it is not POD, therefore it can not be initialized with {} syntax. Change-Id: I1edd7b4f236b06d8f2dbfd8a37a3f5699b6a2c07 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/corelib/tools/qbytearray.h')
-rw-r--r--src/corelib/tools/qbytearray.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 0f5ebcfb18..6d4c155c07 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -120,26 +120,7 @@ class QString;
class QDataStream;
template <typename T> class QList;
-struct QByteArrayData
-{
- // Keep in sync with QArrayData
-
- QtPrivate::RefCount ref;
- int size;
- uint alloc : 31;
- uint capacityReserved : 1;
-
- qptrdiff offset;
-
- inline char *data() { return reinterpret_cast<char *>(this) + offset; }
- inline const char *data() const { return reinterpret_cast<const char *>(this) + offset; }
-};
-
-Q_STATIC_ASSERT(sizeof(QArrayData) == sizeof(QByteArrayData));
-Q_STATIC_ASSERT(offsetof(QArrayData, ref) == offsetof(QByteArrayData, ref));
-Q_STATIC_ASSERT(offsetof(QArrayData, size) == offsetof(QByteArrayData, size));
-// Can't use offsetof on bitfield members alloc, capacityReserved
-Q_STATIC_ASSERT(offsetof(QArrayData, offset) == offsetof(QByteArrayData, offset));
+typedef QArrayData QByteArrayData;
template<int N> struct QStaticByteArrayData
{