From 69014b6cd62ed3fb2f57f9ad04d29a06411c55aa Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 13 Aug 2020 14:47:31 +0200 Subject: 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 --- src/corelib/text/qbytearray.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') 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(data); -// } return *this; } -- cgit v1.2.3