summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-10 09:18:55 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-10 12:46:23 +0200
commitc3d2e0e60adbe436a1c3f7a5b7501cad5af7fc82 (patch)
tree5899ddbc9a8109f66af7fd8ccacb6df8573e83b6 /src
parent90ad722fb294b9c8bc7bb83d507b9b47d4d09367 (diff)
Replace uses of QString::fromUtf16(ushort*) with (char16_t*)
Ditto fromUcs4(uint*) with fromUcs4(char32_t*). The ushort/uint forms will be deprecated. Change-Id: Ia4ce45ed8679951b24af13109e3e498f51fc3c89 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdir.cpp4
-rw-r--r--src/corelib/text/qregularexpression.cpp4
-rw-r--r--src/corelib/text/qstring.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 31a3eda5ed..eaef3434b3 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -2193,9 +2193,9 @@ QString qt_normalizePathSegments(const QString &name, QDirPrivate::PathNormaliza
return name;
int i = len - 1;
- QVarLengthArray<ushort> outVector(len);
+ QVarLengthArray<char16_t> outVector(len);
int used = len;
- ushort *out = outVector.data();
+ char16_t *out = outVector.data();
const ushort *p = name.utf16();
const ushort *prefix = p;
int up = 0;
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 25e2169b06..9d21da4277 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -1492,8 +1492,8 @@ QStringList QRegularExpression::namedCaptureGroups() const
result.append(QString());
for (unsigned int i = 0; i < namedCapturingTableEntryCount; ++i) {
- const ushort * const currentNamedCapturingTableRow =
- reinterpret_cast<const ushort *>(namedCapturingTable) + namedCapturingTableEntrySize * i;
+ const auto currentNamedCapturingTableRow =
+ reinterpret_cast<const char16_t *>(namedCapturingTable) + namedCapturingTableEntrySize * i;
const int index = *currentNamedCapturingTableRow;
result[index] = QString::fromUtf16(currentNamedCapturingTableRow + 1);
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index f099683e28..d12c535539 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -1168,8 +1168,8 @@ QT_WARNING_POP
inline QString QString::fromWCharArray(const wchar_t *string, int size)
{
- return sizeof(wchar_t) == sizeof(QChar) ? fromUtf16(reinterpret_cast<const ushort *>(string), size)
- : fromUcs4(reinterpret_cast<const uint *>(string), size);
+ return sizeof(wchar_t) == sizeof(QChar) ? fromUtf16(reinterpret_cast<const char16_t *>(string), size)
+ : fromUcs4(reinterpret_cast<const char32_t *>(string), size);
}
inline QString::QString() noexcept {}