diff options
author | Mate Barany <mate.barany@qt.io> | 2022-07-07 10:59:14 +0200 |
---|---|---|
committer | Mate Barany <mate.barany@qt.io> | 2022-07-07 20:31:01 +0200 |
commit | 0d5d914dbfdd28f8c4d41200c3a5219e85b9c0cf (patch) | |
tree | 3e2a5380daac72fb871f064a5ca0bb6365300260 /src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp | |
parent | cd3a6fa41497ba6f3dac123536d22b88c61c17a2 (diff) |
qdbuscpp2xml: Finish migration to qsizetype
Inspect and change int types to qsizetypes where necessary.
Fixes: QTBUG-103550
Change-Id: Ib92553ab214d06c8daecaa0c48ae2c2e4e32fdb7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp')
-rw-r--r-- | src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp index 90fa13503d..6a9ea0c81e 100644 --- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp +++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp @@ -116,7 +116,7 @@ static QString addFunction(const FunctionDef &mm, bool isSignal = false) { return QString(); // signal with QDBusMessage argument? bool isScriptable = mm.isScriptable; - for (int j = 1; j < types.count(); ++j) { + for (qsizetype j = 1; j < types.count(); ++j) { // input parameter for a slot or output for a signal if (types.at(j) == QDBusMetaTypeId::message()) { isScriptable = true; @@ -333,7 +333,7 @@ static std::deque<CustomType> s_customTypes; static void parseCmdLine(QStringList &arguments) { flags = 0; - for (int i = 0; i < arguments.count(); ++i) { + for (qsizetype i = 0; i < arguments.count(); ++i) { const QString arg = arguments.at(i); if (arg == "--help"_L1) @@ -379,7 +379,7 @@ static void parseCmdLine(QStringList &arguments) } else { const QByteArray arg = arguments.takeAt(i + 1).toUtf8(); // lastIndexOf because the C++ type could contain '=' while the DBus type can't - const int separator = arg.lastIndexOf('='); + const qsizetype separator = arg.lastIndexOf('='); if (separator == -1) { printf("-t expects a type=dbustype argument, but no '=' was found\n"); exit(1); @@ -431,9 +431,7 @@ int main(int argc, char **argv) QList<ClassDef> classes; - for (int i = 0; i < args.count(); ++i) { - const QString arg = args.at(i); - + for (const auto &arg: std::as_const(args)) { if (arg.startsWith(u'-')) continue; |