diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-08-13 14:47:31 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-08-28 21:28:47 +0200 |
commit | 69014b6cd62ed3fb2f57f9ad04d29a06411c55aa (patch) | |
tree | 4a47dd0ab7de4e2ae124438dc87f5512c8f28ca9 /src/corelib/text/qbytearray.cpp | |
parent | 1fb35832df6371ff53a39436fda7ababa7706df1 (diff) |
Use qsizetype for the size of QByteArray's raw data methods
A ### comment said to use int in setRawData(), which took a uint; but
the underlying QArrayDataPointer::fromRawData() takes a qsizetype, so
propagate that all the way.
Change-Id: Iba1f8d020c509b33f5c202c22c6a9bf85b3bab7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index b5894da8bb..e42cfc3be5 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -4195,15 +4195,10 @@ QByteArray QByteArray::number(double n, char f, int prec) */ QByteArray &QByteArray::setRawData(const char *data, qsizetype size) { - if (!data || !size) { + if (!data || !size) clear(); - } -// else if (d->isShared() || (d->flags() & Data::RawDataType) == 0) { + else *this = fromRawData(data, size); -// } else { -// d.size = size; -// d.data() = const_cast<char *>(data); -// } return *this; } |