diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g index 713c5a17e0..ca798b46ac 100644 --- a/src/corelib/serialization/qxmlstream.g +++ b/src/corelib/serialization/qxmlstream.g @@ -873,7 +873,7 @@ processing_instruction ::= LANGLE QUESTIONMARK name space; /. case $rule_number: { setType(QXmlStreamReader::ProcessingInstruction); - int pos = sym(4).pos + sym(4).len; + const qsizetype pos = sym(4).pos + sym(4).len; processingInstructionTarget = symString(3); if (scanUntil("?>")) { processingInstructionData = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 2); @@ -925,7 +925,7 @@ comment ::= comment_start RANGLE; /. case $rule_number: { setType(QXmlStreamReader::Comment); - int pos = sym(1).pos + 4; + const qsizetype pos = sym(1).pos + 4; text = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } break; ./ @@ -937,7 +937,7 @@ cdata ::= langle_bang CDATA_START; setType(QXmlStreamReader::Characters); isCDATA = true; isWhitespace = false; - int pos = sym(2).pos; + const qsizetype pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } else { @@ -1216,7 +1216,7 @@ attribute ::= qname space_opt EQ space_opt attribute_value; } if (normalize) { // normalize attribute value (simplify and trim) - int pos = textBuffer.size(); + const qsizetype pos = textBuffer.size(); int n = 0; bool wasSpace = true; for (int i = 0; i < attribute.value.len; ++i) { diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h index b797fe830e..60558ab189 100644 --- a/src/corelib/serialization/qxmlstream_p.h +++ b/src/corelib/serialization/qxmlstream_p.h @@ -409,7 +409,7 @@ public: int tos; int stack_size; struct Value { - int pos; + qsizetype pos; // offset into textBuffer int len; int prefix; ushort c; diff --git a/src/corelib/serialization/qxmlstreamparser_p.h b/src/corelib/serialization/qxmlstreamparser_p.h index 0a3e60e233..a0ac276fd8 100644 --- a/src/corelib/serialization/qxmlstreamparser_p.h +++ b/src/corelib/serialization/qxmlstreamparser_p.h @@ -574,7 +574,7 @@ bool QXmlStreamReaderPrivate::parse() case 96: { setType(QXmlStreamReader::ProcessingInstruction); - int pos = sym(4).pos + sym(4).len; + const qsizetype pos = sym(4).pos + sym(4).len; processingInstructionTarget = symString(3); if (scanUntil("?>")) { processingInstructionData = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 2); @@ -613,7 +613,7 @@ bool QXmlStreamReaderPrivate::parse() case 100: { setType(QXmlStreamReader::Comment); - int pos = sym(1).pos + 4; + const qsizetype pos = sym(1).pos + 4; text = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } break; @@ -621,7 +621,7 @@ bool QXmlStreamReaderPrivate::parse() setType(QXmlStreamReader::Characters); isCDATA = true; isWhitespace = false; - int pos = sym(2).pos; + const qsizetype pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = XmlStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } else { @@ -779,7 +779,7 @@ bool QXmlStreamReaderPrivate::parse() } if (normalize) { // normalize attribute value (simplify and trim) - int pos = textBuffer.size(); + const qsizetype pos = textBuffer.size(); int n = 0; bool wasSpace = true; for (int i = 0; i < attribute.value.len; ++i) {