Change meaning of offset in QByteArrayData
authorJoão Abecasis <joao.abecasis@nokia.com>
Fri, 17 Feb 2012 13:11:28 +0000 (14:11 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 20 Feb 2012 23:37:58 +0000 (00:37 +0100)
commit4c8a4058c359c8d163c643120426079fc80c8214
tree282de013f6e6caa4ee2071335bda367fbd944a4f
parentebeebe212624b0d6fb87266629dce20ee75391bd
Change meaning of offset in QByteArrayData

It used to be an index into the first element in 'd' that came after
'offset'. It is now the byte offset from the beginning of the
QByteArrayData structure.

By no longer using an actual array to access characters, we also steer
clear of GCC bug #43247:

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247

This aligns this data structure with QArrayData. The intention is to
have QVector, QString and QByteArray share the same memory layout and
possibly code.

Change-Id: I8546e5f51cd2161ba09bd4ada174b7f5e6f09db7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qbytearray.cpp
src/corelib/tools/qbytearray.h
tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp