summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/MatchingText.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-07-24 18:40:10 +0200
committerhjk <hjk@qt.io>2019-07-26 09:23:48 +0000
commit7ab6783e24c6a05a67f319817cd1bdd026a7ce43 (patch)
tree8b56ea311d333f45f300b915c3bd25a2b77b4aef /src/libs/cplusplus/MatchingText.cpp
parenteab0df22f98fab37585e4513de836a06e4aa05d5 (diff)
downloadqt-creator-7ab6783e24c6a05a67f319817cd1bdd026a7ce43.tar.gz
Standardize on int for line and column values
Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/libs/cplusplus/MatchingText.cpp')
-rw-r--r--src/libs/cplusplus/MatchingText.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/cplusplus/MatchingText.cpp b/src/libs/cplusplus/MatchingText.cpp
index 5aea683f1e..9e1ffdecb8 100644
--- a/src/libs/cplusplus/MatchingText.cpp
+++ b/src/libs/cplusplus/MatchingText.cpp
@@ -128,7 +128,7 @@ static int countSkippedChars(const QString &blockText, const QString &textToProc
return skippedChars;
}
-static const Token tokenAtPosition(const Tokens &tokens, const unsigned pos)
+static const Token tokenAtPosition(const Tokens &tokens, const int pos)
{
for (int i = tokens.size() - 1; i >= 0; --i) {
const Token tk = tokens.at(i);
@@ -450,7 +450,7 @@ bool MatchingText::contextAllowsElectricCharacters(const QTextCursor &cursor)
return false;
if (token.isStringLiteral() || token.isCharLiteral()) {
- const unsigned pos = cursor.selectionEnd() - cursor.block().position();
+ const int pos = cursor.selectionEnd() - cursor.block().position();
if (pos <= token.utf16charsEnd())
return false;
}
@@ -485,7 +485,7 @@ bool MatchingText::isInCommentHelper(const QTextCursor &cursor, Token *retToken)
int prevState = 0;
const Tokens tokens = getTokens(cursor, prevState);
- const unsigned pos = cursor.selectionEnd() - cursor.block().position();
+ const int pos = cursor.selectionEnd() - cursor.block().position();
if (tokens.isEmpty() || pos < tokens.first().utf16charsBegin())
return prevState > 0;
@@ -510,7 +510,7 @@ Kind MatchingText::stringKindAtCursor(const QTextCursor &cursor)
int prevState = 0;
const Tokens tokens = getTokens(cursor, prevState);
- const unsigned pos = cursor.selectionEnd() - cursor.block().position();
+ const int pos = cursor.selectionEnd() - cursor.block().position();
if (tokens.isEmpty() || pos <= tokens.first().utf16charsBegin())
return T_EOF_SYMBOL;