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

@@ -33,13 +33,12 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT FindCdbBreakpoint: protected ASTVisitor
{
public:
static const unsigned NO_LINE_FOUND = 0;
static const int NO_LINE_FOUND = 0;
public:
FindCdbBreakpoint(TranslationUnit *unit);
unsigned operator()(unsigned line)
{ return searchFrom(line); }
int operator()(int line) { return searchFrom(line); }
/**
* Search for the next breakable line of code.
@@ -49,12 +48,12 @@ public:
* \return the next breakable code line (1-based), or \c NO_LINE_FOUND if
* no line could be found.
*/
unsigned searchFrom(unsigned line);
int searchFrom(int line);
protected:
void foundLine(unsigned tokenIndex);
unsigned endLine(unsigned tokenIndex) const;
unsigned endLine(AST *ast) const;
int endLine(unsigned tokenIndex) const;
int endLine(AST *ast) const;
protected:
using ASTVisitor::visit;
@@ -86,9 +85,9 @@ protected:
bool visit(ObjCSynchronizedStatementAST *ast);
private:
unsigned m_initialLine;
int m_initialLine;
unsigned m_breakpointLine;
int m_breakpointLine;
};
} // namespace CPlusPlus