From 5b76be7e2bbd6f6d1eccc3a52a4595223c0620a1 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 29 Oct 2020 13:26:04 +0100 Subject: Fix two missing conversions from in to qsizetype Change-Id: I08ac9a0eb5dfb17f2b6cfaca9e3f3d7375c02bd4 Reviewed-by: Lars Knoll --- src/corelib/text/qstringconverter.cpp | 2 +- src/corelib/tools/qmessageauthenticationcode.cpp | 2 +- src/corelib/tools/qmessageauthenticationcode.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index e8323745d2..e66f512ed8 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1217,7 +1217,7 @@ static QString convertToUnicodeCharByChar(QByteArrayView in, QStringConverter::S copyLocation = state->remainingChars; extra += copyLocation; } - int newLength = length + extra; + qsizetype newLength = length + extra; char *mbcs = new char[newLength]; //ensure that we have a NULL terminated string mbcs[newLength-1] = 0; diff --git a/src/corelib/tools/qmessageauthenticationcode.cpp b/src/corelib/tools/qmessageauthenticationcode.cpp index addd19d72e..5f86afc537 100644 --- a/src/corelib/tools/qmessageauthenticationcode.cpp +++ b/src/corelib/tools/qmessageauthenticationcode.cpp @@ -213,7 +213,7 @@ void QMessageAuthenticationCode::setKey(const QByteArray &key) /*! Adds the first \a length chars of \a data to the message. */ -void QMessageAuthenticationCode::addData(const char *data, int length) +void QMessageAuthenticationCode::addData(const char *data, qsizetype length) { d->initMessageHash(); d->messageHash.addData(data, length); diff --git a/src/corelib/tools/qmessageauthenticationcode.h b/src/corelib/tools/qmessageauthenticationcode.h index a13a3d2acf..343bf9d617 100644 --- a/src/corelib/tools/qmessageauthenticationcode.h +++ b/src/corelib/tools/qmessageauthenticationcode.h @@ -59,7 +59,7 @@ public: void setKey(const QByteArray &key); - void addData(const char *data, int length); + void addData(const char *data, qsizetype length); void addData(const QByteArray &data); bool addData(QIODevice *device); -- cgit v1.2.3