diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-10-10 13:58:59 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-10-13 10:20:47 +0200 |
| commit | bc67403cb39d94f1ae2b96bd0b86947df0783182 (patch) | |
| tree | d7efd7be3b501a9185fbd321592065e7aea69222 /sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp | |
| parent | ec5a625b1f81d03c813bcce168549bfbb7b8f314 (diff) | |
shiboken6: Port some loop variables to qsizetype
Where possible, used range-based for. Otherwise, use qsizetype
for loop variables.
Change-Id: I4773bee8468ce73722656ec73845369b7d40d4cd
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp index 3d5b04fd2..6955e4ec2 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangutils.cpp @@ -166,16 +166,17 @@ QList<Diagnostic> getDiagnostics(CXTranslationUnit tu) return result; } -QPair<int, int> parseTemplateArgumentList(const QString &l, - const TemplateArgumentHandler &handler, - int from) +QPair<qsizetype, qsizetype> + parseTemplateArgumentList(const QString &l, + const TemplateArgumentHandler &handler, + qsizetype from) { - const int ltPos = l.indexOf(u'<', from); + const auto ltPos = l.indexOf(u'<', from); if (ltPos == - 1) return qMakePair(-1, -1); - int startPos = ltPos + 1; + auto startPos = ltPos + 1; int level = 1; - for (int p = startPos, end = l.size(); p < end; ) { + for (qsizetype p = startPos, end = l.size(); p < end; ) { const char c = l.at(p).toLatin1(); switch (c) { case ',': @@ -256,9 +257,9 @@ QDebug operator<<(QDebug s, const Diagnostic &d) if (d.source != Diagnostic::Clang) s << " [other]"; - if (const int childMessagesCount = d.childMessages.size()) { + if (const auto childMessagesCount = d.childMessages.size()) { s << '\n'; - for (int i = 0; i < childMessagesCount; ++i) + for (qsizetype i = 0; i < childMessagesCount; ++i) s << " " << d.childMessages.at(i) << '\n'; } |
