Refactoring

This commit is contained in:
jrp2014 2018-04-04 21:11:23 +02:00 committed by Daniel Marjamäki
parent 07b5afcdc6
commit b813a6d407
2 changed files with 5 additions and 9 deletions

View File

@ -261,10 +261,9 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
if (pos == std::string::npos) {
_settings->basePaths.push_back(Path::fromNativeSeparators(paths));
break;
} else {
_settings->basePaths.push_back(Path::fromNativeSeparators(paths.substr(0, pos)));
paths.erase(0, pos + 1);
}
_settings->basePaths.push_back(Path::fromNativeSeparators(paths.substr(0, pos)));
paths.erase(0, pos + 1);
}
} else {
PrintMessage("cppcheck: No paths specified for the '" + std::string(argv[i]) + "' option.");

View File

@ -121,8 +121,7 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
// Check that all include paths exist
{
std::list<std::string>::iterator iter;
for (iter = settings.includePaths.begin();
for (std::list<std::string>::iterator iter = settings.includePaths.begin();
iter != settings.includePaths.end();
) {
const std::string path(Path::toNativeSeparators(*iter));
@ -195,9 +194,8 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
}
if (cppCheck.settings().exceptionHandling) {
return check_wrapper(cppCheck, argc, argv);
} else {
return check_internal(cppCheck, argc, argv);
}
return check_internal(cppCheck, argc, argv);
}
void CppCheckExecutor::setSettings(const Settings &settings)
@ -949,8 +947,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const cha
_settings = nullptr;
if (returnValue)
return settings.exitCode;
else
return 0;
return 0;
}
#ifdef _WIN32