diff options
author | hjk <hjk@qt.io> | 2019-07-24 18:40:10 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-07-26 09:23:48 +0000 |
commit | 7ab6783e24c6a05a67f319817cd1bdd026a7ce43 (patch) | |
tree | 8b56ea311d333f45f300b915c3bd25a2b77b4aef /src/libs/3rdparty/cplusplus/Scope.cpp | |
parent | eab0df22f98fab37585e4513de836a06e4aa05d5 (diff) |
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/3rdparty/cplusplus/Scope.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Scope.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libs/3rdparty/cplusplus/Scope.cpp b/src/libs/3rdparty/cplusplus/Scope.cpp index 406a794c7e..a6aa43ca97 100644 --- a/src/libs/3rdparty/cplusplus/Scope.cpp +++ b/src/libs/3rdparty/cplusplus/Scope.cpp @@ -58,10 +58,10 @@ public: bool isEmpty() const; /// Returns the number of symbols is in the scope. - unsigned symbolCount() const; + int symbolCount() const; /// Returns the Symbol at the given position. - Symbol *symbolAt(unsigned index) const; + Symbol *symbolAt(int index) const; /// Returns the first Symbol in the scope. iterator firstSymbol() const; @@ -210,10 +210,10 @@ unsigned SymbolTable::hashValue(Symbol *symbol) const bool SymbolTable::isEmpty() const { return _symbolCount == -1; } -unsigned SymbolTable::symbolCount() const +int SymbolTable::symbolCount() const { return _symbolCount + 1; } -Symbol *SymbolTable::symbolAt(unsigned index) const +Symbol *SymbolTable::symbolAt(int index) const { if (! _symbols) return 0; @@ -226,7 +226,7 @@ SymbolTable::iterator SymbolTable::firstSymbol() const SymbolTable::iterator SymbolTable::lastSymbol() const { return _symbols + _symbolCount + 1; } -Scope::Scope(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name) +Scope::Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name) : Symbol(translationUnit, sourceLocation, name), _members(0), _startOffset(0), @@ -260,11 +260,11 @@ bool Scope::isEmpty() const { return _members ? _members->isEmpty() : true; } /// Returns the number of symbols is in the scope. -unsigned Scope::memberCount() const +int Scope::memberCount() const { return _members ? _members->symbolCount() : 0; } /// Returns the Symbol at the given position. -Symbol *Scope::memberAt(unsigned index) const +Symbol *Scope::memberAt(int index) const { return _members ? _members->symbolAt(index) : 0; } /// Returns the first Symbol in the scope. @@ -282,17 +282,17 @@ Symbol *Scope::find(OperatorNameId::Kind operatorId) const { return _members ? _members->lookat(operatorId) : 0; } /// Set the start offset of the scope -unsigned Scope::startOffset() const +int Scope::startOffset() const { return _startOffset; } -void Scope::setStartOffset(unsigned offset) +void Scope::setStartOffset(int offset) { _startOffset = offset; } /// Set the end offset of the scope -unsigned Scope::endOffset() const +int Scope::endOffset() const { return _endOffset; } -void Scope::setEndOffset(unsigned offset) +void Scope::setEndOffset(int offset) { _endOffset = offset; } } // namespace CPlusPlus |