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:
14
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
14
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
@@ -440,13 +440,13 @@ void CloneName::visit(const AnonymousNameId *name)
|
||||
void CloneName::visit(const TemplateNameId *name)
|
||||
{
|
||||
std::vector<FullySpecifiedType> args(name->templateArgumentCount());
|
||||
for (unsigned i = 0; i < args.size(); ++i)
|
||||
for (int i = 0; i < int(args.size()); ++i)
|
||||
args[i] = _clone->type(name->templateArgumentAt(i), _subst);
|
||||
if (args.empty())
|
||||
_name = _control->templateNameId(_clone->identifier(name->identifier()), name->isSpecialization());
|
||||
else
|
||||
_name = _control->templateNameId(_clone->identifier(name->identifier()), name->isSpecialization(),
|
||||
&args[0], unsigned(args.size()));
|
||||
&args[0], int(args.size()));
|
||||
}
|
||||
|
||||
void CloneName::visit(const DestructorNameId *name)
|
||||
@@ -474,9 +474,9 @@ void CloneName::visit(const SelectorNameId *name)
|
||||
{
|
||||
CPP_CHECK(name->nameCount() > 0);
|
||||
std::vector<const Name *> names(name->nameCount());
|
||||
for (unsigned i = 0; i < names.size(); ++i)
|
||||
for (int i = 0; i < int(names.size()); ++i)
|
||||
names[i] = _clone->name(name->nameAt(i), _subst);
|
||||
_name = _control->selectorNameId(&names[0], unsigned(names.size()), name->hasArguments());
|
||||
_name = _control->selectorNameId(&names[0], int(names.size()), name->hasArguments());
|
||||
}
|
||||
|
||||
|
||||
@@ -518,16 +518,16 @@ Symbol *Clone::symbol(Symbol *symbol, Subst *subst)
|
||||
return _symbol(symbol, subst);
|
||||
}
|
||||
|
||||
Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args, unsigned argc, Subst *s)
|
||||
Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args, int argc, Subst *s)
|
||||
{
|
||||
Subst subst(_control, s);
|
||||
for (unsigned i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
|
||||
for (int i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
|
||||
Symbol *formal = templ->templateParameterAt(i);
|
||||
FullySpecifiedType actual = args[i];
|
||||
subst.bind(name(formal->name(), 0), actual);
|
||||
}
|
||||
if (argc < templ->templateParameterCount()) {
|
||||
for (unsigned i = argc; i < templ->templateParameterCount(); ++i) {
|
||||
for (int i = argc; i < templ->templateParameterCount(); ++i) {
|
||||
Symbol *formal = templ->templateParameterAt(i);
|
||||
if (TypenameArgument *tn = formal->asTypenameArgument())
|
||||
subst.bind(name(formal->name(), &subst), type(tn->type(), &subst));
|
||||
|
||||
Reference in New Issue
Block a user