summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2022-06-17 14:50:11 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2022-06-27 14:02:47 +0200
commit2ba153dd5f450c008d49d30b5868abbca1974e28 (patch)
tree99a2cd1c0f3135c1356947f359c1f25822b31471 /src/network
parentf5138d3065c0d1856fcefb067fd44a949883dfde (diff)
QHttpHeaderParser: fix int/qsizetype nags
These values won't extend past MAX_INT but it may produce warnings nonetheless. Found by clang-tidy. Pick-to: 6.4 6.3 Task-number: QTBUG-104452 Change-Id: Icd8aa80a318274be00a3b32ad26a92745903cecb Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpheaderparser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/access/qhttpheaderparser.cpp b/src/network/access/qhttpheaderparser.cpp
index debb6e5cc3..558f8dbd5c 100644
--- a/src/network/access/qhttpheaderparser.cpp
+++ b/src/network/access/qhttpheaderparser.cpp
@@ -54,7 +54,7 @@ bool QHttpHeaderParser::parseHeaders(QByteArrayView header)
QList<QPair<QByteArray, QByteArray>> result;
while (!header.empty()) {
- const int colon = header.indexOf(':');
+ const qsizetype colon = header.indexOf(':');
if (colon == -1) // if no colon check if empty headers
return result.empty() && (header == "\n" || header == "\r\n");
if (result.size() >= maxFieldCount)
@@ -66,7 +66,7 @@ bool QHttpHeaderParser::parseHeaders(QByteArrayView header)
QByteArray value;
qsizetype valueSpace = maxFieldSize - name.size() - 1;
do {
- const int endLine = header.indexOf('\n');
+ const qsizetype endLine = header.indexOf('\n');
Q_ASSERT(endLine != -1);
auto line = header.first(endLine); // includes space
valueSpace -= line.size() - (line.endsWith('\r') ? 1 : 0);
@@ -115,7 +115,7 @@ bool QHttpHeaderParser::parseStatus(QByteArrayView status)
minorVersion = status.at(dotPos + 1) - '0';
int i = spacePos;
- int j = status.indexOf(' ', i + 1);
+ qsizetype j = status.indexOf(' ', i + 1);
const QByteArrayView code = j > i ? status.sliced(i + 1, j - i - 1)
: status.sliced(i + 1);