summaryrefslogtreecommitdiff
path: root/src/libs/qmljs
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/qmljs
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/qmljs')
-rw-r--r--src/libs/qmljs/qmljsfindexportedcpptypes.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
index 6bf17505d6..6dad8947b8 100644
--- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
+++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
@@ -57,7 +57,7 @@ class ContextProperty {
public:
QString name;
QString expression;
- unsigned line, column;
+ int line, column;
};
class FindExportsVisitor : protected ASTVisitor
@@ -245,7 +245,7 @@ protected:
if (StringLiteralAST *nameAst = skipStringCall(nameExp)->asStringLiteral())
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
if (!nameLit) {
- unsigned line, column;
+ int line, column;
translationUnit()->getTokenStartPosition(nameExp->firstToken(), &line, &column);
_messages += Document::DiagnosticMessage(
Document::DiagnosticMessage::Warning,
@@ -290,7 +290,7 @@ protected:
const Token end = _doc->translationUnit()->tokenAt(ast->firstToken());
// go through comments backwards to find the annotation closest to the call
- for (unsigned i = _doc->translationUnit()->commentCount(); i-- > 0; ) {
+ for (int i = _doc->translationUnit()->commentCount(); i-- > 0; ) {
const Token commentToken = _doc->translationUnit()->commentAt(i);
if (commentToken.utf16charsBegin() >= end.utf16charsBegin()
|| commentToken.utf16charsEnd() <= begin.utf16charsBegin()) {
@@ -305,7 +305,7 @@ protected:
}
if (packageName.isEmpty()) {
packageName = QmlJS::CppQmlTypes::defaultPackage;
- unsigned line, column;
+ int line, column;
translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column);
_messages += Document::DiagnosticMessage(
Document::DiagnosticMessage::Warning,
@@ -341,7 +341,7 @@ protected:
}
// we want to do lookup later, so also store the surrounding scope
- unsigned line, column;
+ int line, column;
translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column);
exportedType.scope = _doc->scopeAt(line, column);
@@ -483,7 +483,7 @@ protected:
if (StringLiteralAST *nameAst = skipStringCall(ast->expression_list->value)->asStringLiteral())
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
if (!nameLit) {
- unsigned line, column;
+ int line, column;
translationUnit()->getTokenStartPosition(ast->expression_list->value->firstToken(), &line, &column);
_messages += Document::DiagnosticMessage(
Document::DiagnosticMessage::Warning,
@@ -666,7 +666,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
// add the no-package export, so the cpp name can be used in properties
fmo->addExport(fmo->className(), QmlJS::CppQmlTypes::cppPackage, ComponentVersion());
- for (unsigned i = 0; i < klass->memberCount(); ++i) {
+ for (int i = 0; i < klass->memberCount(); ++i) {
Symbol *member = klass->memberAt(i);
if (!member->name())
continue;
@@ -678,7 +678,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
method.setMethodType(FakeMetaMethod::Signal);
else
method.setMethodType(FakeMetaMethod::Slot);
- for (unsigned a = 0, argc = func->argumentCount(); a < argc; ++a) {
+ for (int a = 0, argc = func->argumentCount(); a < argc; ++a) {
Symbol *arg = func->argumentAt(a);
QString name;
if (arg->name())
@@ -715,7 +715,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
continue;
FakeMetaEnum metaEnum(namePrinter.prettyName(e->name()));
- for (unsigned j = 0; j < e->memberCount(); ++j) {
+ for (int j = 0; j < e->memberCount(); ++j) {
Symbol *enumMember = e->memberAt(j);
if (!enumMember->name())
continue;