forked from qt-creator/qt-creator
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:
@@ -67,7 +67,7 @@ public:
|
||||
bool visit(CPlusPlus::Function * f) override;
|
||||
|
||||
private:
|
||||
const size_t m_length;
|
||||
const int m_length;
|
||||
const char *m_name;
|
||||
|
||||
FunctionList m_matches;
|
||||
@@ -82,8 +82,8 @@ SearchFunction::SearchFunction(const char *name) :
|
||||
SearchFunction::FunctionList SearchFunction::operator()(const DocumentPtr &doc)
|
||||
{
|
||||
m_matches.clear();
|
||||
const unsigned globalSymbolCount = doc->globalSymbolCount();
|
||||
for (unsigned i = 0; i < globalSymbolCount; ++i)
|
||||
const int globalSymbolCount = doc->globalSymbolCount();
|
||||
for (int i = 0; i < globalSymbolCount; ++i)
|
||||
accept(doc->globalSymbolAt(i));
|
||||
return m_matches;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ bool SearchFunction::visit(CPlusPlus::Function * f)
|
||||
if (const CPlusPlus::Name *name = f->name())
|
||||
if (const CPlusPlus::Identifier *id = name->identifier())
|
||||
if (id->size() == m_length)
|
||||
if (!qstrncmp(m_name, id->chars(), uint(m_length)))
|
||||
if (!qstrncmp(m_name, id->chars(), m_length))
|
||||
m_matches.push_back(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user