diff options
author | Paul Wicking <paul.wicking@qt.io> | 2019-12-05 16:45:24 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2019-12-11 07:14:13 +0100 |
commit | c76e840e47113514fa786093bb9dd4fadf432490 (patch) | |
tree | 321037ccf625b54b34e6a80299857931595cdd36 | |
parent | 7c0f505a3f86fd78e76018baa01626b043e43d87 (diff) | |
download | qttools-c76e840e47113514fa786093bb9dd4fadf432490.tar.gz |
QDoc: Get rid of unnecessary casts
Drop casting ints to int.
Change-Id: I571f3e245bfc97a7c0c7bea5bedbf0ed5ab04c60
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r-- | src/qdoc/doc.cpp | 16 | ||||
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 4 | ||||
-rw-r--r-- | src/qdoc/node.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/openedlist.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/tokenizer.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/yyindent.cpp | 8 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp index 8c82e0693..889ecf3c2 100644 --- a/src/qdoc/doc.cpp +++ b/src/qdoc/doc.cpp @@ -2135,7 +2135,7 @@ bool DocParser::expandMacro() QString cmdStr; int backslashPos = pos++; - while (pos < (int) input_.length() && input_[pos].isLetterOrNumber()) + while (pos < input_.length() && input_[pos].isLetterOrNumber()) cmdStr += input_[pos++]; endPos = pos; @@ -2301,9 +2301,9 @@ QString DocParser::getBracedArgument(bool verbatim) { QString arg; int delimDepth = 0; - if (pos < (int) input_.length() && input_[pos] == '{') { + if (pos < input_.length() && input_[pos] == '{') { pos++; - while (pos < (int) input_.length() && delimDepth >= 0) { + while (pos < input_.length() && delimDepth >= 0) { switch (input_[pos].unicode()) { case '{': delimDepth++; @@ -2443,7 +2443,7 @@ QString DocParser::getBracketedArgument() QString DocParser::getOptionalArgument() { skipSpacesOrOneEndl(); - if (pos + 1 < (int) input_.length() && input_[pos] == '\\' && + if (pos + 1 < input_.length() && input_[pos] == '\\' && input_[pos + 1].isLetterOrNumber()) { return QString(); } @@ -2636,7 +2636,7 @@ void DocParser::skipSpacesOnLine() void DocParser::skipSpacesOrOneEndl() { int firstEndl = -1; - while (pos < (int) input_.length() && input_[pos].isSpace()) { + while (pos < input_.length() && input_[pos].isSpace()) { QChar ch = input_[pos]; if (ch == '\n') { if (firstEndl == -1) { @@ -2773,7 +2773,7 @@ int DocParser::indentLevel(const QString &str) int minIndent = INT_MAX; int column = 0; - for (int i = 0; i < (int) str.length(); i++) { + for (int i = 0; i < str.length(); i++) { if (str[i] == '\n') { column = 0; } @@ -2794,7 +2794,7 @@ QString DocParser::unindent(int level, const QString &str) QString t; int column = 0; - for (int i = 0; i < (int) str.length(); i++) { + for (int i = 0; i < str.length(); i++) { if (str[i] == QLatin1Char('\n')) { t += '\n'; column = 0; @@ -3273,7 +3273,7 @@ void Doc::trimCStyleComment(Location &location, QString &str) int asterColumn = location.columnNo() + 1; int i; - for (i = 0; i < (int) str.length(); i++) { + for (i = 0; i < str.length(); i++) { if (m.columnNo() == asterColumn) { if (str[i] != '*') break; diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index ac3a3d041..415309157 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -3234,7 +3234,7 @@ void HtmlGenerator::generateSection(const NodeVector &nv, const Node *relative, out() << "<tr><td class=\"memItemLeft rightAlign topAlign\"> "; } else { - if (twoColumn && i == (int) (nv.count() + 1) / 2) + if (twoColumn && i == (nv.count() + 1) / 2) out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li class=\"fn\">"; } @@ -3293,7 +3293,7 @@ void HtmlGenerator::generateSectionList(const Section& section, out() << "<tr><td class=\"memItemLeft topAlign rightAlign\"> "; } else { - if (twoColumn && i == (int) (members.count() + 1) / 2) + if (twoColumn && i == (members.count() + 1) / 2) out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li class=\"fn\">"; } diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 054b6697f..08ec638d7 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -1359,7 +1359,7 @@ QString Node::cleanId(const QString &str) clean += QLatin1Char('a'); } - for (int i = 1; i < (int) name.length(); i++) { + for (int i = 1; i < name.length(); i++) { const QChar c = name[i]; const uint u = c.unicode(); if ((u >= 'a' && u <= 'z') || diff --git a/src/qdoc/openedlist.cpp b/src/qdoc/openedlist.cpp index ce9efb06e..a36e3b545 100644 --- a/src/qdoc/openedlist.cpp +++ b/src/qdoc/openedlist.cpp @@ -135,7 +135,7 @@ int OpenedList::fromAlpha(const QString &str) int n = 0; int u; - for (int i = 0; i < (int) str.length(); i++) { + for (int i = 0; i < str.length(); i++) { u = str[i].toLower().unicode(); if (u >= 'a' && u <= 'z') { n *= 26; diff --git a/src/qdoc/tokenizer.cpp b/src/qdoc/tokenizer.cpp index 45c33fa7c..af3837c3a 100644 --- a/src/qdoc/tokenizer.cpp +++ b/src/qdoc/tokenizer.cpp @@ -735,7 +735,7 @@ bool Tokenizer::isTrue(const QString &condition) X && Y || Z // the or (X || Y) && Z // the and */ - for (int i = 0; i < (int) condition.length() - 1; i++) { + for (int i = 0; i < condition.length() - 1; i++) { QChar ch = condition[i]; if (ch == QChar('(')) { parenDepth++; diff --git a/src/qdoc/yyindent.cpp b/src/qdoc/yyindent.cpp index 6e4b1a6ca..c78e132b6 100644 --- a/src/qdoc/yyindent.cpp +++ b/src/qdoc/yyindent.cpp @@ -126,7 +126,7 @@ static QRegExp *iflikeKeyword = nullptr; static QChar firstNonWhiteSpace(const QString &t) { int i = 0; - while (i < (int) t.length()) { + while (i < t.length()) { if (!t[i].isSpace()) return t[i]; i++; @@ -151,7 +151,7 @@ static bool isOnlyWhiteSpace(const QString &t) int columnForIndex(const QString &t, int index) { int col = 0; - if (index > (int) t.length()) + if (index > t.length()) index = t.length(); for (int i = 0; i < index; i++) { @@ -230,7 +230,7 @@ static QString trimmedCodeLine(const QString &t) int pos1 = label->pos(1); int stop = cap1.length(); - if (pos1 + stop < (int) trimmed.length() && ppIndentSize < stop) + if (pos1 + stop < trimmed.length() && ppIndentSize < stop) stop = ppIndentSize; int i = 0; @@ -238,7 +238,7 @@ static QString trimmedCodeLine(const QString &t) eraseChar(trimmed, pos1 + i, ' '); i++; } - while (i < (int) cap1.length()) { + while (i < cap1.length()) { eraseChar(trimmed, pos1 + i, ';'); i++; } |