astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2020-01-10 11:31:12 +01:00
parent a0a2eae1d2
commit e78775fac3
3 changed files with 7 additions and 9 deletions

View File

@ -376,7 +376,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
mSettings->xml = true; mSettings->xml = true;
} }
// use a file filter // use a file filter
else if (std::strncmp(argv[i], "--file-filter=", 14) == 0) else if (std::strncmp(argv[i], "--file-filter=", 14) == 0)
mSettings->fileFilter = std::string(argv[i] + 14); mSettings->fileFilter = std::string(argv[i] + 14);

View File

@ -168,14 +168,13 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
newList.push_back(fsetting); newList.push_back(fsetting);
} }
} }
if (!newList.empty()) if (!newList.empty())
settings.project.fileSettings = newList; settings.project.fileSettings = newList;
else { else {
std::cout << "cppcheck: error: could not find any files matching the filter." << std::endl; std::cout << "cppcheck: error: could not find any files matching the filter." << std::endl;
return false; return false;
} }
} } else if (!pathnames.empty()) {
else if (!pathnames.empty()) {
// Execute recursiveAddFiles() to each given file parameter // Execute recursiveAddFiles() to each given file parameter
const PathMatch matcher(ignored, caseSensitive); const PathMatch matcher(ignored, caseSensitive);
for (const std::string &pathname : pathnames) for (const std::string &pathname : pathnames)
@ -187,8 +186,7 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
if (!ignored.empty()) if (!ignored.empty())
std::cout << "cppcheck: Maybe all paths were ignored?" << std::endl; std::cout << "cppcheck: Maybe all paths were ignored?" << std::endl;
return false; return false;
} } else if (!mSettings->fileFilter.empty()) {
else if(!mSettings->fileFilter.empty()) {
std::map<std::string, std::size_t> newMap; std::map<std::string, std::size_t> newMap;
for (std::map<std::string, std::size_t>::const_iterator i = mFiles.begin(); i != mFiles.end(); ++i) for (std::map<std::string, std::size_t>::const_iterator i = mFiles.begin(); i != mFiles.end(); ++i)
if (Suppressions::matchglob(mSettings->fileFilter, i->first)) { if (Suppressions::matchglob(mSettings->fileFilter, i->first)) {
@ -201,7 +199,7 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
} }
} }
return true; return true;
} }

View File

@ -4846,7 +4846,7 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// #6426 // #6426
{ {
const char code[] = "void foo(bool flag) {\n" const char code[] = "void foo(bool flag) {\n"
" bar( (flag) ? ~0u : ~0ul);\n" " bar( (flag) ? ~0u : ~0ul);\n"
"}"; "}";
@ -4863,7 +4863,7 @@ private:
settings.long_bit = 64; settings.long_bit = 64;
check(code, &settings); check(code, &settings);
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
} }
void duplicateValueTernary() { void duplicateValueTernary() {