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

@@ -41,30 +41,30 @@ class Macro;
class CPLUSPLUS_EXPORT MacroArgumentReference
{
unsigned _bytesOffset;
unsigned _bytesLength;
unsigned _utf16charsOffset;
unsigned _utf16charsLength;
int _bytesOffset;
int _bytesLength;
int _utf16charsOffset;
int _utf16charsLength;
public:
explicit MacroArgumentReference(unsigned bytesOffset = 0, unsigned bytesLength = 0,
unsigned utf16charsOffset = 0, unsigned utf16charsLength = 0)
explicit MacroArgumentReference(int bytesOffset = 0, int bytesLength = 0,
int utf16charsOffset = 0, int utf16charsLength = 0)
: _bytesOffset(bytesOffset)
, _bytesLength(bytesLength)
, _utf16charsOffset(utf16charsOffset)
, _utf16charsLength(utf16charsLength)
{ }
unsigned bytesOffset() const
int bytesOffset() const
{ return _bytesOffset; }
unsigned bytesLength() const
int bytesLength() const
{ return _bytesLength; }
unsigned utf16charsOffset() const
int utf16charsOffset() const
{ return _utf16charsOffset; }
unsigned utf16charsLength() const
int utf16charsLength() const
{ return _utf16charsLength; }
};
@@ -86,28 +86,28 @@ public:
virtual void macroAdded(const Macro &macro) = 0;
virtual void passedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
unsigned line, const Macro &macro) = 0;
virtual void failedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
virtual void passedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
int line, const Macro &macro) = 0;
virtual void failedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
const ByteArrayRef &name) = 0;
virtual void notifyMacroReference(unsigned bytesOffset, unsigned utf16charsOffset,
unsigned line, const Macro &macro) = 0;
virtual void notifyMacroReference(int bytesOffset, int utf16charsOffset,
int line, const Macro &macro) = 0;
virtual void startExpandingMacro(unsigned bytesOffset, unsigned utf16charsOffset,
unsigned line, const Macro &macro,
virtual void startExpandingMacro(int bytesOffset, int utf16charsOffset,
int line, const Macro &macro,
const QVector<MacroArgumentReference> &actuals
= QVector<MacroArgumentReference>()) = 0;
virtual void stopExpandingMacro(unsigned bytesOffset, const Macro &macro) = 0; // TODO: ?!
virtual void stopExpandingMacro(int bytesOffset, const Macro &macro) = 0; // TODO: ?!
/// Mark the given macro name as the include guard for the current file.
virtual void markAsIncludeGuard(const QByteArray &macroName) = 0;
/// Start skipping from the given utf16charsOffset.
virtual void startSkippingBlocks(unsigned utf16charsOffset) = 0;
virtual void stopSkippingBlocks(unsigned utf16charsOffset) = 0;
virtual void startSkippingBlocks(int utf16charsOffset) = 0;
virtual void stopSkippingBlocks(int utf16charsOffset) = 0;
virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
virtual void sourceNeeded(int line, const QString &fileName, IncludeType mode,
const QStringList &initialIncludes = QStringList()) = 0;
static inline bool isInjectedFile(const QString &fileName)