Port QUtf8BaseTraits to qsizetype

It's unclear why the the char8_t overloads have int sizes. At the time
60aa0d086886aea58d6b7a09484645ad1d92a220 added these, the uchar
overloads were already using qsizetype.

Task-number: QTBUG-103531
Change-Id: I8ed4c5462de29a7d48255e440e34bcd5114755fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ab512adf12a2ba36b51f36d7c998d1cbdcf6505a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2022-07-22 16:15:41 +02:00 committed by Qt Cherry-pick Bot
parent 8a28024a4b
commit 971e382bed

View File

@ -44,7 +44,7 @@ struct QUtf8BaseTraits
static uchar peekByte(const uchar *ptr, qsizetype n = 0)
{ return ptr[n]; }
static uchar peekByte(const char8_t *ptr, int n = 0)
static uchar peekByte(const char8_t *ptr, qsizetype n = 0)
{ return ptr[n]; }
static qptrdiff availableBytes(const uchar *ptr, const uchar *end)
@ -56,7 +56,7 @@ struct QUtf8BaseTraits
static void advanceByte(const uchar *&ptr, qsizetype n = 1)
{ ptr += n; }
static void advanceByte(const char8_t *&ptr, int n = 1)
static void advanceByte(const char8_t *&ptr, qsizetype n = 1)
{ ptr += n; }
static void appendUtf16(char16_t *&ptr, char16_t uc)