summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qxmlstream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qxmlstream.cpp')
-rw-r--r--src/corelib/serialization/qxmlstream.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index b58efaffea..dce95bd7df 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -969,7 +969,7 @@ inline uint QXmlStreamReaderPrivate::peekChar()
*/
bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)
{
- int pos = textBuffer.size();
+ const qsizetype pos = textBuffer.size();
const auto oldLineNumber = lineNumber;
uint c;
@@ -1017,7 +1017,7 @@ bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)
bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, bool requireSpace)
{
- int n = 0;
+ qsizetype n = 0;
while (str[n]) {
uint c = getChar();
if (c != ushort(str[n])) {
@@ -1030,12 +1030,11 @@ bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, b
}
++n;
}
- for (int i = 0; i < n; ++i)
- textBuffer += QChar(ushort(str[i]));
+ textBuffer += QLatin1String(str, n);
if (requireSpace) {
const qsizetype s = fastScanSpace();
if (!s || atEnd) {
- int pos = textBuffer.size() - n - s;
+ qsizetype pos = textBuffer.size() - n - s;
putString(textBuffer, pos);
textBuffer.resize(pos);
return false;
@@ -1241,7 +1240,7 @@ inline qsizetype QXmlStreamReaderPrivate::fastScanContentCharList()
return n;
case ']': {
isWhitespace = false;
- int pos = textBuffer.size();
+ const qsizetype pos = textBuffer.size();
textBuffer += QChar(ushort(c));
++n;
while ((c = getChar()) == ']') {
@@ -1356,7 +1355,7 @@ inline qsizetype QXmlStreamReaderPrivate::fastScanName(qint16 *prefix)
if (prefix)
*prefix = 0;
- int pos = textBuffer.size() - n;
+ qsizetype pos = textBuffer.size() - n;
putString(textBuffer, pos);
textBuffer.resize(pos);
return 0;
@@ -1427,7 +1426,7 @@ inline qsizetype QXmlStreamReaderPrivate::fastScanNMTOKEN()
}
}
- int pos = textBuffer.size() - n;
+ qsizetype pos = textBuffer.size() - n;
putString(textBuffer, pos);
textBuffer.resize(pos);
@@ -1479,7 +1478,7 @@ void QXmlStreamReaderPrivate::putReplacementInAttributeValue(QStringView s)
uint QXmlStreamReaderPrivate::getChar_helper()
{
- const int BUFFER_SIZE = 8192;
+ constexpr qsizetype BUFFER_SIZE = 8192;
characterOffset += readBufferPos;
readBufferPos = 0;
if (readBuffer.size())
@@ -1720,7 +1719,7 @@ void QXmlStreamReaderPrivate::checkPublicLiteral(QStringView publicId)
const ushort *data = reinterpret_cast<const ushort *>(publicId.constData());
uchar c = 0;
- int i;
+ qsizetype i;
for (i = publicId.size() - 1; i >= 0; --i) {
if (data[i] < 256)
switch ((c = data[i])) {
@@ -2307,7 +2306,7 @@ QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QStr
*/
QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value)
{
- int colon = qualifiedName.indexOf(QLatin1Char(':'));
+ qsizetype colon = qualifiedName.indexOf(QLatin1Char(':'));
m_name = qualifiedName.mid(colon + 1);
m_qualifiedName = qualifiedName;
m_value = value;