summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qxmlstream.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-06 09:35:42 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-07 00:51:23 +0200
commitb94ec982c1bbc9cf4e0efdbd0c4b8f14ec4ebdcc (patch)
tree365d506a365a0d659cd90c64c424ea9ef17c8b43 /src/corelib/serialization/qxmlstream.cpp
parent5beb4f85163fa7b79673e41568944fcc002e0d2b (diff)
QXmlStreamReader: port Value::len from int to qsizetype
It's a stretch of characters in a QString, so it has to be qsizetype. This enlarges the Value struct further; created QTBUG-103306 to track ideas to shrink it again. Pick-to: 6.3 6.2 Fixes: QTBUG-102465 Change-Id: I753cfd801030c834989452eb5422b2cd72d4ef16 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/serialization/qxmlstream.cpp')
-rw-r--r--src/corelib/serialization/qxmlstream.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index 3323ff07073..5e3e07f6eed 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -1020,7 +1020,7 @@ bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, b
}
textBuffer += QLatin1StringView(str, n);
if (requireSpace) {
- int s = fastScanSpace();
+ const qsizetype s = fastScanSpace();
if (!s || atEnd) {
qsizetype pos = textBuffer.size() - n - s;
putString(textBuffer, pos);
@@ -1132,9 +1132,9 @@ bool QXmlStreamReaderPrivate::scanAttType()
encountered.
*/
-inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
+inline qsizetype QXmlStreamReaderPrivate::fastScanLiteralContent()
{
- int n = 0;
+ qsizetype n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
switch (ushort(c)) {
@@ -1182,9 +1182,9 @@ inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
return n;
}
-inline int QXmlStreamReaderPrivate::fastScanSpace()
+inline qsizetype QXmlStreamReaderPrivate::fastScanSpace()
{
- int n = 0;
+ qsizetype n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
switch (c) {
@@ -1215,9 +1215,9 @@ inline int QXmlStreamReaderPrivate::fastScanSpace()
Used for text nodes essentially. That is, characters appearing
inside elements.
*/
-inline int QXmlStreamReaderPrivate::fastScanContentCharList()
+inline qsizetype QXmlStreamReaderPrivate::fastScanContentCharList()
{
- int n = 0;
+ qsizetype n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
switch (ushort(c)) {
@@ -1279,9 +1279,9 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
return n;
}
-inline int QXmlStreamReaderPrivate::fastScanName(qint16 *prefix)
+inline qsizetype QXmlStreamReaderPrivate::fastScanName(qint16 *prefix)
{
- int n = 0;
+ qsizetype n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
if (n >= 4096) {
@@ -1400,9 +1400,9 @@ static inline NameChar fastDetermineNameChar(QChar ch)
return NotName;
}
-inline int QXmlStreamReaderPrivate::fastScanNMTOKEN()
+inline qsizetype QXmlStreamReaderPrivate::fastScanNMTOKEN()
{
- int n = 0;
+ qsizetype n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
if (fastDetermineNameChar(QChar(c)) == NotName) {