forked from qt-creator/qt-creator
CppTools: Fix "! condition" coding style
Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -59,7 +59,7 @@ static void parse(QFutureInterface<void> &future,
|
||||
const bool isSourceFile = i < sourceCount;
|
||||
if (isSourceFile) {
|
||||
(void) preproc->run(conf);
|
||||
} else if (! processingHeaders) {
|
||||
} else if (!processingHeaders) {
|
||||
(void) preproc->run(conf);
|
||||
|
||||
processingHeaders = true;
|
||||
@@ -182,7 +182,7 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QStringList &sour
|
||||
m_synchronizer.clearFutures();
|
||||
|
||||
foreach (const QFuture<void> &future, futures) {
|
||||
if (! (future.isFinished() || future.isCanceled()))
|
||||
if (!(future.isFinished() || future.isCanceled()))
|
||||
m_synchronizer.addFuture(future);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +94,9 @@ public:
|
||||
protected:
|
||||
void process(Document::Ptr doc, QSet<Namespace *> *processed)
|
||||
{
|
||||
if (! doc)
|
||||
if (!doc)
|
||||
return;
|
||||
if (! processed->contains(doc->globalNamespace())) {
|
||||
if (!processed->contains(doc->globalNamespace())) {
|
||||
processed->insert(doc->globalNamespace());
|
||||
|
||||
foreach (const Document::Include &i, doc->includes())
|
||||
@@ -115,7 +115,7 @@ protected:
|
||||
|
||||
void addType(const Name *name)
|
||||
{
|
||||
if (! name) {
|
||||
if (!name) {
|
||||
return;
|
||||
|
||||
} else if (const QualifiedNameId *q = name->asQualifiedNameId()) {
|
||||
@@ -130,7 +130,7 @@ protected:
|
||||
|
||||
void addField(const Name *name)
|
||||
{
|
||||
if (! name) {
|
||||
if (!name) {
|
||||
return;
|
||||
|
||||
} else if (name->isNameId()) {
|
||||
@@ -142,7 +142,7 @@ protected:
|
||||
|
||||
void addFunction(const Name *name)
|
||||
{
|
||||
if (! name) {
|
||||
if (!name) {
|
||||
return;
|
||||
|
||||
} else if (name->isNameId()) {
|
||||
@@ -153,7 +153,7 @@ protected:
|
||||
|
||||
void addStatic(const Name *name)
|
||||
{
|
||||
if (! name) {
|
||||
if (!name) {
|
||||
return;
|
||||
|
||||
} else if (name->isNameId() || name->isTemplateNameId()) {
|
||||
@@ -196,7 +196,7 @@ protected:
|
||||
|
||||
if (symbol->isTypedef())
|
||||
addType(symbol->name());
|
||||
else if (! symbol->type()->isFunctionType() && symbol->enclosingScope()->isClass())
|
||||
else if (!symbol->type()->isFunctionType() && symbol->enclosingScope()->isClass())
|
||||
addField(symbol->name());
|
||||
|
||||
return true;
|
||||
@@ -333,7 +333,7 @@ void CheckSymbols::run()
|
||||
qSort(_macroUses.begin(), _macroUses.end(), sortByLinePredicate);
|
||||
_doc->clearDiagnosticMessages();
|
||||
|
||||
if (! isCanceled()) {
|
||||
if (!isCanceled()) {
|
||||
if (_doc->translationUnit()) {
|
||||
accept(_doc->translationUnit()->ast());
|
||||
_usages << QVector<Result>::fromList(_macroUses);
|
||||
@@ -473,7 +473,7 @@ bool CheckSymbols::visit(NamespaceAST *ast)
|
||||
{
|
||||
if (ast->identifier_token) {
|
||||
const Token &tok = tokenAt(ast->identifier_token);
|
||||
if (! tok.generated()) {
|
||||
if (!tok.generated()) {
|
||||
unsigned line, column;
|
||||
getTokenStartPosition(ast->identifier_token, &line, &column);
|
||||
Result use(line, column, tok.length(), CppHighlightingSupport::TypeUse);
|
||||
@@ -499,7 +499,7 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast)
|
||||
{
|
||||
NameAST *declrIdNameAST = 0;
|
||||
if (ast->declarator_list && !ast->declarator_list->next) {
|
||||
if (ast->symbols && ! ast->symbols->next && !ast->symbols->value->isGenerated()) {
|
||||
if (ast->symbols && !ast->symbols->next && !ast->symbols->value->isGenerated()) {
|
||||
Symbol *decl = ast->symbols->value;
|
||||
if (NameAST *nameAST = declaratorId(ast->declarator_list->value)) {
|
||||
if (Function *funTy = decl->type()->asFunctionType()) {
|
||||
@@ -559,7 +559,7 @@ bool CheckSymbols::visit(ElaboratedTypeSpecifierAST *ast)
|
||||
bool CheckSymbols::visit(MemberAccessAST *ast)
|
||||
{
|
||||
accept(ast->base_expression);
|
||||
if (! ast->member_name)
|
||||
if (!ast->member_name)
|
||||
return false;
|
||||
|
||||
if (const Name *name = ast->member_name->name) {
|
||||
@@ -711,7 +711,7 @@ QByteArray CheckSymbols::textOf(AST *ast) const
|
||||
|
||||
void CheckSymbols::checkNamespace(NameAST *name)
|
||||
{
|
||||
if (! name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
unsigned line, column;
|
||||
@@ -730,13 +730,13 @@ void CheckSymbols::checkNamespace(NameAST *name)
|
||||
|
||||
bool CheckSymbols::hasVirtualDestructor(Class *klass) const
|
||||
{
|
||||
if (! klass)
|
||||
if (!klass)
|
||||
return false;
|
||||
const Identifier *id = klass->identifier();
|
||||
if (! id)
|
||||
if (!id)
|
||||
return false;
|
||||
for (Symbol *s = klass->find(id); s; s = s->next()) {
|
||||
if (! s->name())
|
||||
if (!s->name())
|
||||
continue;
|
||||
if (s->name()->isDestructorNameId()) {
|
||||
if (Function *funTy = s->type()->asFunctionType()) {
|
||||
@@ -754,9 +754,9 @@ bool CheckSymbols::hasVirtualDestructor(ClassOrNamespace *binding) const
|
||||
QList<ClassOrNamespace *> todo;
|
||||
todo.append(binding);
|
||||
|
||||
while (! todo.isEmpty()) {
|
||||
while (!todo.isEmpty()) {
|
||||
ClassOrNamespace *b = todo.takeFirst();
|
||||
if (b && ! processed.contains(b)) {
|
||||
if (b && !processed.contains(b)) {
|
||||
processed.insert(b);
|
||||
foreach (Symbol *s, b->symbols()) {
|
||||
if (Class *k = s->asClass()) {
|
||||
@@ -775,7 +775,7 @@ bool CheckSymbols::hasVirtualDestructor(ClassOrNamespace *binding) const
|
||||
void CheckSymbols::checkName(NameAST *ast, Scope *scope)
|
||||
{
|
||||
if (ast && ast->name) {
|
||||
if (! scope)
|
||||
if (!scope)
|
||||
scope = enclosingScope();
|
||||
|
||||
if (ast->asDestructorName() != 0) {
|
||||
@@ -796,7 +796,7 @@ void CheckSymbols::checkName(NameAST *ast, Scope *scope)
|
||||
}
|
||||
}
|
||||
} else if (maybeType(ast->name) || maybeStatic(ast->name)) {
|
||||
if (! maybeAddTypeOrStatic(_context.lookup(ast->name, scope), ast)) {
|
||||
if (!maybeAddTypeOrStatic(_context.lookup(ast->name, scope), ast)) {
|
||||
// it can be a local variable
|
||||
if (maybeField(ast->name))
|
||||
maybeAddField(_context.lookup(ast->name, scope), ast);
|
||||
@@ -895,7 +895,7 @@ ClassOrNamespace *CheckSymbols::checkNestedName(QualifiedNameAST *ast)
|
||||
}
|
||||
|
||||
accept(template_id->template_argument_list);
|
||||
if (! binding)
|
||||
if (!binding)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1026,7 +1026,7 @@ bool CheckSymbols::visit(FunctionDefinitionAST *ast)
|
||||
_astStack.append(thisFunction);
|
||||
|
||||
bool processEntireDeclr = true;
|
||||
if (ast->declarator && ast->symbol && ! ast->symbol->isGenerated()) {
|
||||
if (ast->declarator && ast->symbol && !ast->symbol->isGenerated()) {
|
||||
Function *fun = ast->symbol;
|
||||
if (NameAST *declId = declaratorId(ast->declarator)) {
|
||||
processEntireDeclr = false;
|
||||
@@ -1077,7 +1077,7 @@ bool CheckSymbols::visit(FunctionDefinitionAST *ast)
|
||||
|
||||
void CheckSymbols::addUse(NameAST *ast, Kind kind)
|
||||
{
|
||||
if (! ast)
|
||||
if (!ast)
|
||||
return;
|
||||
|
||||
if (QualifiedNameAST *q = ast->asQualifiedName())
|
||||
@@ -1085,7 +1085,7 @@ void CheckSymbols::addUse(NameAST *ast, Kind kind)
|
||||
if (DestructorNameAST *dtor = ast->asDestructorName())
|
||||
ast = dtor->unqualified_name;
|
||||
|
||||
if (! ast)
|
||||
if (!ast)
|
||||
return; // nothing to do
|
||||
else if (ast->asOperatorFunctionId() != 0 || ast->asConversionFunctionId() != 0)
|
||||
return; // nothing to do
|
||||
@@ -1100,7 +1100,7 @@ void CheckSymbols::addUse(NameAST *ast, Kind kind)
|
||||
|
||||
void CheckSymbols::addUse(unsigned tokenIndex, Kind kind)
|
||||
{
|
||||
if (! tokenIndex)
|
||||
if (!tokenIndex)
|
||||
return;
|
||||
|
||||
const Token &tok = tokenAt(tokenIndex);
|
||||
@@ -1120,7 +1120,7 @@ void CheckSymbols::addUse(const Result &use)
|
||||
if (use.isInvalid())
|
||||
return;
|
||||
|
||||
if (! enclosingFunctionDefinition()) {
|
||||
if (!enclosingFunctionDefinition()) {
|
||||
if (_usages.size() >= _chunkSize) {
|
||||
if (use.line > _lineOfLastUsage)
|
||||
flush();
|
||||
@@ -1137,7 +1137,7 @@ void CheckSymbols::addUse(const Result &use)
|
||||
void CheckSymbols::addType(ClassOrNamespace *b, NameAST *ast)
|
||||
{
|
||||
unsigned startToken;
|
||||
if (! b || !acceptName(ast, &startToken))
|
||||
if (!b || !acceptName(ast, &startToken))
|
||||
return;
|
||||
|
||||
const Token &tok = tokenAt(startToken);
|
||||
@@ -1218,11 +1218,11 @@ bool CheckSymbols::maybeAddField(const QList<LookupItem> &candidates, NameAST *a
|
||||
|
||||
foreach (const LookupItem &r, candidates) {
|
||||
Symbol *c = r.declaration();
|
||||
if (! c)
|
||||
if (!c)
|
||||
continue;
|
||||
else if (! c->isDeclaration())
|
||||
else if (!c->isDeclaration())
|
||||
return false;
|
||||
else if (! (c->enclosingScope() && c->enclosingScope()->isClass()))
|
||||
else if (!(c->enclosingScope() && c->enclosingScope()->isClass()))
|
||||
return false; // shadowed
|
||||
else if (c->isTypedef() || (c->type() && c->type()->isFunctionType()))
|
||||
return false; // shadowed
|
||||
@@ -1261,7 +1261,7 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
|
||||
Symbol *c = r.declaration();
|
||||
|
||||
// Skip current if there's no declaration or name.
|
||||
if (! c || !c->name())
|
||||
if (!c || !c->name())
|
||||
continue;
|
||||
|
||||
// In addition check for destructors, since the leading ~ is not taken into consideration.
|
||||
@@ -1272,13 +1272,13 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
|
||||
isConstructor = isConstructorDeclaration(c);
|
||||
|
||||
Function *funTy = c->type()->asFunctionType();
|
||||
if (! funTy) {
|
||||
if (!funTy) {
|
||||
//Try to find a template function
|
||||
if (Template * t = r.type()->asTemplateType())
|
||||
if ((c = t->declaration()))
|
||||
funTy = c->type()->asFunctionType();
|
||||
}
|
||||
if (! funTy)
|
||||
if (!funTy)
|
||||
continue; // TODO: add diagnostic messages and color call-operators calls too?
|
||||
|
||||
if (argumentCount < funTy->minimumArgumentCount()) {
|
||||
@@ -1286,7 +1286,7 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
|
||||
kind = funTy->isVirtual() ? CppHighlightingSupport::VirtualMethodUse : CppHighlightingSupport::FunctionUse;
|
||||
matchType = Match_TooFewArgs;
|
||||
}
|
||||
} else if (argumentCount > funTy->argumentCount() && ! funTy->isVariadic()) {
|
||||
} else if (argumentCount > funTy->argumentCount() && !funTy->isVariadic()) {
|
||||
if (matchType != Match_Ok) {
|
||||
matchType = Match_TooManyArgs;
|
||||
kind = funTy->isVirtual() ? CppHighlightingSupport::VirtualMethodUse : CppHighlightingSupport::FunctionUse;
|
||||
|
||||
@@ -210,7 +210,7 @@ static void configureOverviewWithCodeStyleSettings(CPlusPlus::Overview &overview
|
||||
CPlusPlus::Overview CppCodeStyleSettings::currentProjectCodeStyleOverview()
|
||||
{
|
||||
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
|
||||
if (! project)
|
||||
if (!project)
|
||||
return currentGlobalCodeStyleOverview();
|
||||
|
||||
ProjectExplorer::EditorConfiguration *editorConfiguration = project->editorConfiguration();
|
||||
|
||||
@@ -1498,7 +1498,7 @@ void CppToolsPlugin::test_completion_typedef_of_type_and_decl_of_type_no_replace
|
||||
QCOMPARE(completions.size(), 2);
|
||||
QVERIFY(completions.contains(QLatin1String("S")));
|
||||
QVERIFY(completions.contains(QLatin1String("m")));
|
||||
QVERIFY(! replaceAccessOperator);
|
||||
QVERIFY(!replaceAccessOperator);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_typedef_of_pointer_and_decl_of_pointer_no_replace_access_operator()
|
||||
@@ -1524,7 +1524,7 @@ void CppToolsPlugin::test_completion_typedef_of_pointer_and_decl_of_pointer_no_r
|
||||
QStringList completions = getCompletions(data, &replaceAccessOperator);
|
||||
|
||||
QCOMPARE(completions.size(), 0);
|
||||
QVERIFY(! replaceAccessOperator);
|
||||
QVERIFY(!replaceAccessOperator);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_typedef_of_type_and_decl_of_pointer_replace_access_operator()
|
||||
@@ -1636,7 +1636,7 @@ void CppToolsPlugin::test_completion_predecl_typedef_of_type_and_decl_type_no_re
|
||||
QCOMPARE(completions.size(), 2);
|
||||
QVERIFY(completions.contains(QLatin1String("S")));
|
||||
QVERIFY(completions.contains(QLatin1String("m")));
|
||||
QVERIFY(! replaceAccessOperator);
|
||||
QVERIFY(!replaceAccessOperator);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_predecl_typedef_of_pointer_and_decl_of_pointer_no_replace_access_operator()
|
||||
@@ -1662,7 +1662,7 @@ void CppToolsPlugin::test_completion_predecl_typedef_of_pointer_and_decl_of_poin
|
||||
QStringList completions = getCompletions(data, &replaceAccessOperator);
|
||||
|
||||
QCOMPARE(completions.size(), 0);
|
||||
QVERIFY(! replaceAccessOperator);
|
||||
QVERIFY(!replaceAccessOperator);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_predecl_typedef_of_pointer_and_decl_of_type_replace_access_operator()
|
||||
|
||||
@@ -218,7 +218,9 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e
|
||||
if (Function *function = symbol->type()->asFunctionType()) {
|
||||
// If the member is a function, automatically place the opening parenthesis,
|
||||
// except when it might take template parameters.
|
||||
if (! function->hasReturnType() && (function->unqualifiedName() && !function->unqualifiedName()->isDestructorNameId())) {
|
||||
if (!function->hasReturnType()
|
||||
&& (function->unqualifiedName()
|
||||
&& !function->unqualifiedName()->isDestructorNameId())) {
|
||||
// Don't insert any magic, since the user might have just wanted to select the class
|
||||
|
||||
/// ### port me
|
||||
@@ -228,7 +230,7 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e
|
||||
if (function->argumentCount() == 0)
|
||||
extraChars += QLatin1Char('<');
|
||||
#endif
|
||||
} else if (!isDereferenced(editor, basePosition) && ! function->isAmbiguous()) {
|
||||
} else if (!isDereferenced(editor, basePosition) && !function->isAmbiguous()) {
|
||||
// When the user typed the opening parenthesis, he'll likely also type the closing one,
|
||||
// in which case it would be annoying if we put the cursor after the already automatically
|
||||
// inserted closing parenthesis.
|
||||
@@ -253,7 +255,7 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e
|
||||
}
|
||||
|
||||
// If the function takes no arguments, automatically place the closing parenthesis
|
||||
if (!isOverloaded() && ! function->hasArguments() && skipClosingParenthesis) {
|
||||
if (!isOverloaded() && !function->hasArguments() && skipClosingParenthesis) {
|
||||
extraChars += QLatin1Char(')');
|
||||
if (endWithSemicolon) {
|
||||
extraChars += semicolon;
|
||||
@@ -392,7 +394,7 @@ int CppFunctionHintModel::activeArgument(const QString &prefix) const
|
||||
++parcount;
|
||||
else if (tk.is(T_RPAREN))
|
||||
--parcount;
|
||||
else if (! parcount && tk.is(T_COMMA))
|
||||
else if (!parcount && tk.is(T_COMMA))
|
||||
++argnr;
|
||||
}
|
||||
|
||||
@@ -504,8 +506,8 @@ public:
|
||||
BasicProposalItem *operator()(Symbol *symbol)
|
||||
{
|
||||
//using declaration can be qualified
|
||||
if (! symbol || ! symbol->name() || (symbol->name()->isQualifiedNameId()
|
||||
&& ! symbol->asUsingDeclaration()))
|
||||
if (!symbol || !symbol->name() || (symbol->name()->isQualifiedNameId()
|
||||
&& !symbol->asUsingDeclaration()))
|
||||
return 0;
|
||||
|
||||
BasicProposalItem *previousItem = switchCompletionItem(0);
|
||||
@@ -986,7 +988,7 @@ bool CppCompletionAssistProcessor::tryObjCCompletion()
|
||||
const QString expr = m_interface->textAt(startPos, m_interface->position() - startPos);
|
||||
|
||||
Document::Ptr thisDocument = m_interface->snapshot().document(m_interface->fileName());
|
||||
if (! thisDocument)
|
||||
if (!thisDocument)
|
||||
return false;
|
||||
|
||||
m_model->m_typeOfExpression->init(thisDocument, m_interface->snapshot());
|
||||
@@ -1205,7 +1207,7 @@ int CppCompletionAssistProcessor::startCompletionInternal(const QString fileName
|
||||
QString expression = expr.trimmed();
|
||||
|
||||
Document::Ptr thisDocument = m_interface->snapshot().document(fileName);
|
||||
if (! thisDocument)
|
||||
if (!thisDocument)
|
||||
return -1;
|
||||
|
||||
m_model->m_typeOfExpression->init(thisDocument, m_interface->snapshot());
|
||||
@@ -1234,7 +1236,7 @@ int CppCompletionAssistProcessor::startCompletionInternal(const QString fileName
|
||||
|
||||
if (results.isEmpty()) {
|
||||
if (m_model->m_completionOperator == T_SIGNAL || m_model->m_completionOperator == T_SLOT) {
|
||||
if (! (expression.isEmpty() || expression == QLatin1String("this"))) {
|
||||
if (!(expression.isEmpty() || expression == QLatin1String("this"))) {
|
||||
expression = QLatin1String("this");
|
||||
results = (*m_model->m_typeOfExpression)(utf8Exp, scope);
|
||||
}
|
||||
@@ -1330,7 +1332,7 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
|
||||
if (ClassOrNamespace *binding = context.lookupType(scope)) {
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *member = scope->memberAt(i);
|
||||
if (! member->name())
|
||||
if (!member->name())
|
||||
continue;
|
||||
if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) {
|
||||
if (ClassOrNamespace *b = binding->lookupType(u->name()))
|
||||
@@ -1366,7 +1368,7 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
|
||||
for (; currentBinding; currentBinding = currentBinding->parent()) {
|
||||
const QList<Symbol *> symbols = currentBinding->symbols();
|
||||
|
||||
if (! symbols.isEmpty()) {
|
||||
if (!symbols.isEmpty()) {
|
||||
if (symbols.first()->isClass())
|
||||
completeClass(currentBinding);
|
||||
else
|
||||
@@ -1399,7 +1401,7 @@ bool CppCompletionAssistProcessor::completeMember(const QList<CPlusPlus::LookupI
|
||||
if (binding)
|
||||
completeClass(binding, /*static lookup = */ true);
|
||||
|
||||
return ! m_completions.isEmpty();
|
||||
return !m_completions.isEmpty();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1469,7 +1471,7 @@ bool CppCompletionAssistProcessor::completeScope(const QList<CPlusPlus::LookupIt
|
||||
}
|
||||
}
|
||||
|
||||
return ! m_completions.isEmpty();
|
||||
return !m_completions.isEmpty();
|
||||
}
|
||||
|
||||
void CppCompletionAssistProcessor::completeNamespace(CPlusPlus::ClassOrNamespace *b)
|
||||
@@ -1478,9 +1480,9 @@ void CppCompletionAssistProcessor::completeNamespace(CPlusPlus::ClassOrNamespace
|
||||
QList<ClassOrNamespace *> bindingsToVisit;
|
||||
bindingsToVisit.append(b);
|
||||
|
||||
while (! bindingsToVisit.isEmpty()) {
|
||||
while (!bindingsToVisit.isEmpty()) {
|
||||
ClassOrNamespace *binding = bindingsToVisit.takeFirst();
|
||||
if (! binding || bindingsVisited.contains(binding))
|
||||
if (!binding || bindingsVisited.contains(binding))
|
||||
continue;
|
||||
|
||||
bindingsVisited.insert(binding);
|
||||
@@ -1498,9 +1500,9 @@ void CppCompletionAssistProcessor::completeNamespace(CPlusPlus::ClassOrNamespace
|
||||
scopesToVisit.append(e);
|
||||
}
|
||||
|
||||
while (! scopesToVisit.isEmpty()) {
|
||||
while (!scopesToVisit.isEmpty()) {
|
||||
Scope *scope = scopesToVisit.takeFirst();
|
||||
if (! scope || scopesVisited.contains(scope))
|
||||
if (!scope || scopesVisited.contains(scope))
|
||||
continue;
|
||||
|
||||
scopesVisited.insert(scope);
|
||||
@@ -1519,9 +1521,9 @@ void CppCompletionAssistProcessor::completeClass(CPlusPlus::ClassOrNamespace *b,
|
||||
QList<ClassOrNamespace *> bindingsToVisit;
|
||||
bindingsToVisit.append(b);
|
||||
|
||||
while (! bindingsToVisit.isEmpty()) {
|
||||
while (!bindingsToVisit.isEmpty()) {
|
||||
ClassOrNamespace *binding = bindingsToVisit.takeFirst();
|
||||
if (! binding || bindingsVisited.contains(binding))
|
||||
if (!binding || bindingsVisited.contains(binding))
|
||||
continue;
|
||||
|
||||
bindingsVisited.insert(binding);
|
||||
@@ -1538,9 +1540,9 @@ void CppCompletionAssistProcessor::completeClass(CPlusPlus::ClassOrNamespace *b,
|
||||
foreach (Enum *e, binding->unscopedEnums())
|
||||
scopesToVisit.append(e);
|
||||
|
||||
while (! scopesToVisit.isEmpty()) {
|
||||
while (!scopesToVisit.isEmpty()) {
|
||||
Scope *scope = scopesToVisit.takeFirst();
|
||||
if (! scope || scopesVisited.contains(scope))
|
||||
if (!scope || scopesVisited.contains(scope))
|
||||
continue;
|
||||
|
||||
scopesVisited.insert(scope);
|
||||
@@ -1554,7 +1556,7 @@ void CppCompletionAssistProcessor::completeClass(CPlusPlus::ClassOrNamespace *b,
|
||||
|| member->isQtPropertyDeclaration()
|
||||
|| member->isQtEnum()) {
|
||||
continue;
|
||||
} else if (! staticLookup && (member->isTypedef() ||
|
||||
} else if (!staticLookup && (member->isTypedef() ||
|
||||
member->isEnum() ||
|
||||
member->isClass())) {
|
||||
continue;
|
||||
@@ -1592,11 +1594,11 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
|
||||
continue; // not a pointer or a reference to a pointer.
|
||||
|
||||
NamedType *namedTy = ty->asNamedType();
|
||||
if (! namedTy) // not a class name.
|
||||
if (!namedTy) // not a class name.
|
||||
continue;
|
||||
|
||||
ClassOrNamespace *b = context.lookupType(namedTy->name(), p.scope());
|
||||
if (! b)
|
||||
if (!b)
|
||||
continue;
|
||||
|
||||
QList<ClassOrNamespace *>todo;
|
||||
@@ -1617,17 +1619,17 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
|
||||
}
|
||||
|
||||
foreach (Scope *scope, scopes) {
|
||||
if (! scope->isClass())
|
||||
if (!scope->isClass())
|
||||
continue;
|
||||
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *member = scope->memberAt(i);
|
||||
Function *fun = member->type()->asFunctionType();
|
||||
if (! fun)
|
||||
if (!fun)
|
||||
continue;
|
||||
if (wantSignals && ! fun->isSignal())
|
||||
if (wantSignals && !fun->isSignal())
|
||||
continue;
|
||||
else if (! wantSignals && ! fun->isSlot())
|
||||
else if (!wantSignals && !fun->isSlot())
|
||||
continue;
|
||||
|
||||
unsigned count = fun->argumentCount();
|
||||
@@ -1648,7 +1650,7 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
|
||||
|
||||
signature = QString::fromLatin1(normalized, normalized.size());
|
||||
|
||||
if (! signatures.contains(signature)) {
|
||||
if (!signatures.contains(signature)) {
|
||||
BasicProposalItem *ci = toCompletionItem(fun);
|
||||
if (!ci)
|
||||
break;
|
||||
@@ -1666,7 +1668,7 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
|
||||
}
|
||||
}
|
||||
|
||||
return ! m_completions.isEmpty();
|
||||
return !m_completions.isEmpty();
|
||||
}
|
||||
|
||||
void CppCompletionAssistProcessor::addSnippets()
|
||||
@@ -1703,7 +1705,7 @@ void CppCompletionAssistProcessor::addMacros_helper(const CPlusPlus::Snapshot &s
|
||||
{
|
||||
Document::Ptr doc = snapshot.document(fileName);
|
||||
|
||||
if (! doc || processed->contains(doc->fileName()))
|
||||
if (!doc || processed->contains(doc->fileName()))
|
||||
return;
|
||||
|
||||
processed->insert(doc->fileName());
|
||||
@@ -1714,7 +1716,7 @@ void CppCompletionAssistProcessor::addMacros_helper(const CPlusPlus::Snapshot &s
|
||||
|
||||
foreach (const Macro ¯o, doc->definedMacros()) {
|
||||
const QString macroName = QString::fromUtf8(macro.name().constData(), macro.name().length());
|
||||
if (! macro.isHidden())
|
||||
if (!macro.isHidden())
|
||||
definedMacros->insert(macroName);
|
||||
else
|
||||
definedMacros->remove(macroName);
|
||||
@@ -1733,14 +1735,14 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
|
||||
if (Class *klass = asClassOrTemplateClassType(exprTy)) {
|
||||
const Name *className = klass->name();
|
||||
if (! className)
|
||||
if (!className)
|
||||
continue; // nothing to do for anonymous classes.
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i) {
|
||||
Symbol *member = klass->memberAt(i);
|
||||
const Name *memberName = member->name();
|
||||
|
||||
if (! memberName)
|
||||
if (!memberName)
|
||||
continue; // skip anonymous member.
|
||||
|
||||
else if (memberName->isQualifiedNameId())
|
||||
@@ -1764,10 +1766,13 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
|
||||
if (Function *fun = asFunctionOrTemplateFunctionType(ty)) {
|
||||
|
||||
if (! fun->name())
|
||||
if (!fun->name()) {
|
||||
continue;
|
||||
else if (! functions.isEmpty() && enclosingNonTemplateScope(functions.first()) != enclosingNonTemplateScope(fun))
|
||||
} else if (!functions.isEmpty()
|
||||
&& enclosingNonTemplateScope(functions.first())
|
||||
!= enclosingNonTemplateScope(fun)) {
|
||||
continue; // skip fun, it's an hidden declaration.
|
||||
}
|
||||
|
||||
bool newOverload = true;
|
||||
|
||||
@@ -1814,7 +1819,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
// check if function signature autocompletion is appropriate
|
||||
// Also check if the function name is a destructor name.
|
||||
bool isDestructor = false;
|
||||
if (! functions.isEmpty() && ! toolTipOnly) {
|
||||
if (!functions.isEmpty() && !toolTipOnly) {
|
||||
|
||||
// function definitions will only happen in class or namespace scope,
|
||||
// so get the current location's enclosing scope.
|
||||
@@ -1901,7 +1906,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
}
|
||||
}
|
||||
|
||||
if (! functions.empty() && !isDestructor) {
|
||||
if (!functions.empty() && !isDestructor) {
|
||||
m_hintProposal = createHintProposal(functions);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
if (Document::Ptr previousDoc = snapshot.document(fileName)) {
|
||||
Control *control = previousDoc->control();
|
||||
if (! control->findIdentifier(symbolId->chars(), symbolId->size()))
|
||||
if (!control->findIdentifier(symbolId->chars(), symbolId->size()))
|
||||
return usages; // skip this document, it's not using symbolId.
|
||||
}
|
||||
Document::Ptr doc;
|
||||
@@ -188,8 +188,11 @@ static void find_helper(QFutureInterface<Usage> &future,
|
||||
const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
|
||||
QStringList files(sourceFile);
|
||||
|
||||
if (symbol->isClass() || symbol->isForwardClassDeclaration() || (symbol->enclosingScope() && ! symbol->isStatic() &&
|
||||
symbol->enclosingScope()->isNamespace())) {
|
||||
if (symbol->isClass()
|
||||
|| symbol->isForwardClassDeclaration()
|
||||
|| (symbol->enclosingScope()
|
||||
&& !symbol->isStatic()
|
||||
&& symbol->enclosingScope()->isNamespace())) {
|
||||
foreach (const Document::Ptr &doc, context.snapshot()) {
|
||||
if (doc->fileName() == sourceFile)
|
||||
continue;
|
||||
|
||||
@@ -84,7 +84,7 @@ protected:
|
||||
if (Symbol *member = scope->memberAt(i)) {
|
||||
if (member->isTypedef())
|
||||
continue;
|
||||
if (! member->isGenerated() && (member->isDeclaration() || member->isArgument())) {
|
||||
if (!member->isGenerated() && (member->isDeclaration() || member->isArgument())) {
|
||||
if (member->name() && member->name()->isNameId()) {
|
||||
const Identifier *id = member->identifier();
|
||||
unsigned line, column;
|
||||
|
||||
@@ -150,7 +150,7 @@ QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(QFutureInterface<Locato
|
||||
|
||||
QVariant id = qVariantFromValue(info);
|
||||
Locator::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
|
||||
if (! info.symbolType.isEmpty()) {
|
||||
if (!info.symbolType.isEmpty()) {
|
||||
filterEntry.extraInfo = info.symbolType;
|
||||
} else {
|
||||
filterEntry.extraInfo = FileUtils::shortNativePath(
|
||||
|
||||
@@ -181,7 +181,7 @@ void CppModelManager::updateModifiedSourceFiles()
|
||||
foreach (const Document::Ptr doc, snapshot) {
|
||||
const QDateTime lastModified = doc->lastModified();
|
||||
|
||||
if (! lastModified.isNull()) {
|
||||
if (!lastModified.isNull()) {
|
||||
QFileInfo fileInfo(doc->fileName());
|
||||
|
||||
if (fileInfo.exists() && fileInfo.lastModified() != lastModified)
|
||||
@@ -293,7 +293,7 @@ bool CppModelManager::replaceDocument(Document::Ptr newDoc)
|
||||
void CppModelManager::ensureUpdated()
|
||||
{
|
||||
QMutexLocker locker(&m_projectMutex);
|
||||
if (! m_dirty)
|
||||
if (!m_dirty)
|
||||
return;
|
||||
|
||||
m_projectFiles = internalProjectFiles();
|
||||
@@ -552,7 +552,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo)
|
||||
{ // only hold the mutex for a limited scope, so the dumping afterwards can aquire it without deadlocking.
|
||||
QMutexLocker locker(&m_projectMutex);
|
||||
|
||||
if (! pinfo.isValid())
|
||||
if (!pinfo.isValid())
|
||||
return;
|
||||
|
||||
ProjectExplorer::Project *project = pinfo.project().data();
|
||||
@@ -691,7 +691,7 @@ void CppModelManager::GC()
|
||||
QSet<QString> processed;
|
||||
QStringList todo = projectFiles();
|
||||
|
||||
while (! todo.isEmpty()) {
|
||||
while (!todo.isEmpty()) {
|
||||
QString fn = todo.last();
|
||||
todo.removeLast();
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ const QString CppModelManagerInterface::configurationFileName()
|
||||
CppModelManagerInterface::CppModelManagerInterface(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
Q_ASSERT(! g_instance);
|
||||
Q_ASSERT(!g_instance);
|
||||
g_instance = this;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,10 +134,10 @@ public:
|
||||
{ }
|
||||
|
||||
operator bool() const
|
||||
{ return ! m_project.isNull(); }
|
||||
{ return !m_project.isNull(); }
|
||||
|
||||
bool isValid() const
|
||||
{ return ! m_project.isNull(); }
|
||||
{ return !m_project.isNull(); }
|
||||
|
||||
bool isNull() const
|
||||
{ return m_project.isNull(); }
|
||||
|
||||
@@ -76,7 +76,7 @@ static unsigned firstTypeSpecifierWithoutFollowingAttribute(
|
||||
SpecifierListAST *list, TranslationUnit *translationUnit, unsigned endToken, bool *found)
|
||||
{
|
||||
*found = false;
|
||||
if (! list || ! translationUnit || ! endToken)
|
||||
if (!list || !translationUnit || !endToken)
|
||||
return 0;
|
||||
|
||||
for (SpecifierListAST *it = list; it; it = it->next) {
|
||||
@@ -156,7 +156,7 @@ bool PointerDeclarationFormatter::visit(SimpleDeclarationAST *ast)
|
||||
// characters from the beginning since our rewritten declaration
|
||||
// will contain all type specifiers.
|
||||
int charactersToRemove = 0;
|
||||
if (! isFirstDeclarator) {
|
||||
if (!isFirstDeclarator) {
|
||||
const int startAST = m_cppRefactoringFile->startOf(ast);
|
||||
const int startFirstDeclarator = m_cppRefactoringFile->startOf(firstDeclarator);
|
||||
CHECK_RV(startAST < startFirstDeclarator, "No specifier", true);
|
||||
@@ -188,8 +188,8 @@ bool PointerDeclarationFormatter::visit(SimpleDeclarationAST *ast)
|
||||
m_cppRefactoringFile->cppDocument()->translationUnit(),
|
||||
lastActivationToken,
|
||||
&foundBegin);
|
||||
if (! foundBegin) {
|
||||
CHECK_RV(! isFirstDeclarator, "Declaration without attributes not supported", true);
|
||||
if (!foundBegin) {
|
||||
CHECK_RV(!isFirstDeclarator, "Declaration without attributes not supported", true);
|
||||
firstActivationToken = declarator->firstToken();
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ void PointerDeclarationFormatter::checkAndRewrite(DeclaratorAST *declarator,
|
||||
|
||||
// Check for expanded tokens
|
||||
for (unsigned token = tokenRange.start; token <= tokenRange.end; ++token)
|
||||
CHECK_R(! tokenAt(token).expanded(), "Token is expanded");
|
||||
CHECK_R(!tokenAt(token).expanded(), "Token is expanded");
|
||||
|
||||
Range range(m_cppRefactoringFile->startOf(tokenRange.start),
|
||||
m_cppRefactoringFile->endOf(tokenRange.end));
|
||||
|
||||
@@ -255,7 +255,7 @@ QString CppPreprocessor::resolveFile_helper(const QString &fileName, IncludeType
|
||||
|
||||
void CppPreprocessor::macroAdded(const Macro ¯o)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
|
||||
m_currentDoc->appendMacro(macro);
|
||||
@@ -271,7 +271,7 @@ static inline const Macro revision(const CppModelManagerInterface::WorkingCopy &
|
||||
|
||||
void CppPreprocessor::passedMacroDefinitionCheck(unsigned offset, unsigned line, const Macro ¯o)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
|
||||
m_currentDoc->addMacroUse(revision(m_workingCopy, macro), offset, macro.name().length(), line,
|
||||
@@ -280,7 +280,7 @@ void CppPreprocessor::passedMacroDefinitionCheck(unsigned offset, unsigned line,
|
||||
|
||||
void CppPreprocessor::failedMacroDefinitionCheck(unsigned offset, const ByteArrayRef &name)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
|
||||
m_currentDoc->addUndefinedMacroUse(QByteArray(name.start(), name.size()), offset);
|
||||
@@ -288,7 +288,7 @@ void CppPreprocessor::failedMacroDefinitionCheck(unsigned offset, const ByteArra
|
||||
|
||||
void CppPreprocessor::notifyMacroReference(unsigned offset, unsigned line, const Macro ¯o)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
|
||||
m_currentDoc->addMacroUse(revision(m_workingCopy, macro), offset, macro.name().length(), line,
|
||||
@@ -299,7 +299,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset, unsigned line,
|
||||
const Macro ¯o,
|
||||
const QVector<MacroArgumentReference> &actuals)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
|
||||
m_currentDoc->addMacroUse(revision(m_workingCopy, macro), offset, macro.name().length(), line,
|
||||
@@ -308,7 +308,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset, unsigned line,
|
||||
|
||||
void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &)
|
||||
{
|
||||
if (! m_currentDoc)
|
||||
if (!m_currentDoc)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ void CppPreprocessor::markAsIncludeGuard(const QByteArray ¯oName)
|
||||
|
||||
void CppPreprocessor::mergeEnvironment(Document::Ptr doc)
|
||||
{
|
||||
if (! doc)
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
const QString fn = doc->fileName();
|
||||
@@ -374,7 +374,7 @@ void CppPreprocessor::sourceNeeded(unsigned line, const QString &fileName, Inclu
|
||||
QString contents;
|
||||
getFileContents(absoluteFileName, &contents, &editorRevision);
|
||||
if (m_currentDoc) {
|
||||
if (contents.isEmpty() && ! QFileInfo(absoluteFileName).isAbsolute()) {
|
||||
if (contents.isEmpty() && !QFileInfo(absoluteFileName).isAbsolute()) {
|
||||
QString msg = QCoreApplication::translate(
|
||||
"CppPreprocessor", "%1: No such file or directory").arg(fileName);
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
|
||||
}
|
||||
|
||||
// update semantic info in a future
|
||||
if (! m_initialized ||
|
||||
if (!m_initialized ||
|
||||
(m_textEditor->widget()->isVisible()
|
||||
&& (m_lastSemanticInfo.doc.isNull()
|
||||
|| m_lastSemanticInfo.doc->translationUnit()->ast() == 0
|
||||
@@ -373,7 +373,7 @@ void CppEditorSupport::onDiagnosticsChanged()
|
||||
c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, m.length());
|
||||
} else {
|
||||
for (int i = 0; i < text.size(); ++i) {
|
||||
if (! text.at(i).isSpace()) {
|
||||
if (!text.at(i).isSpace()) {
|
||||
c.setPosition(c.position() + i);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -106,13 +106,13 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
QString declFile = QString::fromUtf8(declaration->fileName(), declaration->fileNameLength());
|
||||
|
||||
Document::Ptr thisDocument = snapshot.document(declFile);
|
||||
if (! thisDocument) {
|
||||
if (!thisDocument) {
|
||||
qWarning() << "undefined document:" << declaration->fileName();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Function *declarationTy = declaration->type()->asFunctionType();
|
||||
if (! declarationTy) {
|
||||
if (!declarationTy) {
|
||||
qWarning() << "not a function:" << declaration->fileName()
|
||||
<< declaration->line() << declaration->column();
|
||||
return 0;
|
||||
@@ -126,7 +126,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
}
|
||||
|
||||
const Identifier *id = declaration->identifier();
|
||||
if (id && ! doc->control()->findIdentifier(id->chars(), id->size()))
|
||||
if (id && !doc->control()->findIdentifier(id->chars(), id->size()))
|
||||
continue;
|
||||
|
||||
if (!id) {
|
||||
@@ -143,13 +143,13 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
candidates.accept(doc->globalNamespace());
|
||||
|
||||
const QList<Function *> result = candidates.result();
|
||||
if (! result.isEmpty()) {
|
||||
if (!result.isEmpty()) {
|
||||
LookupContext context(doc, snapshot);
|
||||
|
||||
QList<Function *> viableFunctions;
|
||||
|
||||
ClassOrNamespace *enclosingType = context.lookupType(declaration);
|
||||
if (! enclosingType)
|
||||
if (!enclosingType)
|
||||
continue; // nothing to do
|
||||
|
||||
foreach (Function *fun, result) {
|
||||
@@ -168,16 +168,18 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
if (viableFunctions.isEmpty())
|
||||
continue;
|
||||
|
||||
else if (! strict && viableFunctions.length() == 1)
|
||||
else if (!strict && viableFunctions.length() == 1)
|
||||
return viableFunctions.first();
|
||||
|
||||
Function *best = 0;
|
||||
|
||||
foreach (Function *fun, viableFunctions) {
|
||||
if (! (fun->unqualifiedName() && fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName())))
|
||||
if (!(fun->unqualifiedName()
|
||||
&& fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName()))) {
|
||||
continue;
|
||||
}
|
||||
if (fun->argumentCount() == declarationTy->argumentCount()) {
|
||||
if (! strict && ! best)
|
||||
if (!strict && !best)
|
||||
best = fun;
|
||||
|
||||
const unsigned argc = declarationTy->argumentCount();
|
||||
@@ -185,7 +187,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
for (; argIt < argc; ++argIt) {
|
||||
Symbol *arg = fun->argumentAt(argIt);
|
||||
Symbol *otherArg = declarationTy->argumentAt(argIt);
|
||||
if (! arg->type().isEqualTo(otherArg->type()))
|
||||
if (!arg->type().isEqualTo(otherArg->type()))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -197,10 +199,10 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
}
|
||||
}
|
||||
|
||||
if (strict && ! best)
|
||||
if (strict && !best)
|
||||
continue;
|
||||
|
||||
if (! best)
|
||||
if (!best)
|
||||
best = viableFunctions.first();
|
||||
return best;
|
||||
}
|
||||
@@ -211,7 +213,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
|
||||
Class *SymbolFinder::findMatchingClassDeclaration(Symbol *declaration, const Snapshot &snapshot)
|
||||
{
|
||||
if (! declaration->identifier())
|
||||
if (!declaration->identifier())
|
||||
return 0;
|
||||
|
||||
QString declFile = QString::fromUtf8(declaration->fileName(), declaration->fileNameLength());
|
||||
@@ -223,8 +225,8 @@ Class *SymbolFinder::findMatchingClassDeclaration(Symbol *declaration, const Sna
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! doc->control()->findIdentifier(declaration->identifier()->chars(),
|
||||
declaration->identifier()->size()))
|
||||
if (!doc->control()->findIdentifier(declaration->identifier()->chars(),
|
||||
declaration->identifier()->size()))
|
||||
continue;
|
||||
|
||||
LookupContext context(doc, snapshot);
|
||||
@@ -252,12 +254,12 @@ void SymbolFinder::findMatchingDeclaration(const LookupContext &context,
|
||||
return;
|
||||
|
||||
Scope *enclosingScope = functionType->enclosingScope();
|
||||
while (! (enclosingScope->isNamespace() || enclosingScope->isClass()))
|
||||
while (!(enclosingScope->isNamespace() || enclosingScope->isClass()))
|
||||
enclosingScope = enclosingScope->enclosingScope();
|
||||
QTC_ASSERT(enclosingScope != 0, return);
|
||||
|
||||
const Name *functionName = functionType->name();
|
||||
if (! functionName)
|
||||
if (!functionName)
|
||||
return; // anonymous function names are not valid c++
|
||||
|
||||
ClassOrNamespace *binding = 0;
|
||||
@@ -287,7 +289,7 @@ void SymbolFinder::findMatchingDeclaration(const LookupContext &context,
|
||||
continue;
|
||||
|
||||
for (Symbol *s = scope->find(funcId); s; s = s->next()) {
|
||||
if (! s->name() || ! funcId->isEqualTo(s->identifier()) || ! s->type()->isFunctionType())
|
||||
if (!s->name() || !funcId->isEqualTo(s->identifier()) || !s->type()->isFunctionType())
|
||||
continue;
|
||||
if (Declaration *decl = s->asDeclaration()) {
|
||||
if (Function *declFunTy = decl->type()->asFunctionType()) {
|
||||
|
||||
Reference in New Issue
Block a user