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>
This commit is contained in:
hjk
2019-07-24 18:40:10 +02:00
parent eab0df22f9
commit 7ab6783e24
153 changed files with 3181 additions and 3194 deletions

View File

@@ -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;