From 2e369cc842cbfa02460f1714eae0bc2d9ce28e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 27 Apr 2020 17:35:52 +0200 Subject: [PATCH] astyle formatting [ci skip] --- lib/checkclass.cpp | 4 ++-- lib/exprengine.cpp | 2 +- lib/importproject.cpp | 3 +-- test/testclass.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index b74935714..a28fdcb0e 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -1655,8 +1655,8 @@ void CheckClass::virtualDestructor() if (printInconclusive) { const Function *destructor = scope->getDestructor(); if (destructor) { - if(!((destructor->hasVirtualSpecifier() && destructor->access == AccessControl::Public) || - (destructor->access == AccessControl::Protected))) { + if (!((destructor->hasVirtualSpecifier() && destructor->access == AccessControl::Public) || + (destructor->access == AccessControl::Protected))) { for (const Function &func : scope->functionList) { if (func.hasVirtualSpecifier()) { inconclusiveErrors.push_back(destructor); diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 7ca6897df..5ef296615 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -172,7 +172,7 @@ namespace { const std::vector &callbacks; std::vector constraints; - void contractConstraints(const Function *function, ExprEngine::ValuePtr (*executeExpression)(const Token*, Data&)) { + void contractConstraints(const Function *function, ExprEngine::ValuePtr(*executeExpression)(const Token*, Data&)) { const auto it = settings->functionContracts.find(currentFunction); if (it == settings->functionContracts.end()) return; diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 5f5daa171..1319b420f 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -1044,8 +1044,7 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti temp.functionContracts[function] = expects; } } - } - else if (strcmp(node->Name(), CppcheckXml::IgnoreElementName) == 0) + } else if (strcmp(node->Name(), CppcheckXml::IgnoreElementName) == 0) guiProject.excludedPaths = readXmlStringList(node, "", CppcheckXml::IgnorePathName, CppcheckXml::IgnorePathNameAttrib); else if (strcmp(node->Name(), CppcheckXml::LibrariesElementName) == 0) guiProject.libraries = readXmlStringList(node, "", CppcheckXml::LibraryElementName, nullptr); diff --git a/test/testclass.cpp b/test/testclass.cpp index 75eece4de..b589b43ab 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -2699,7 +2699,7 @@ private: " delete base;\n" "}\n", true); ASSERT_EQUALS("[test.cpp:3]: (error) Class 'Base' which is inherited by class 'Derived' does not have a virtual destructor.\n", errout.str()); - + // class Base destructor is not virtual but protected -> no error checkVirtualDestructor("class Base {\n" "public:\n"