Refactoring
This commit is contained in:
parent
07b5afcdc6
commit
b813a6d407
|
@ -261,10 +261,9 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
if (pos == std::string::npos) {
|
if (pos == std::string::npos) {
|
||||||
_settings->basePaths.push_back(Path::fromNativeSeparators(paths));
|
_settings->basePaths.push_back(Path::fromNativeSeparators(paths));
|
||||||
break;
|
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 {
|
} else {
|
||||||
PrintMessage("cppcheck: No paths specified for the '" + std::string(argv[i]) + "' option.");
|
PrintMessage("cppcheck: No paths specified for the '" + std::string(argv[i]) + "' option.");
|
||||||
|
|
|
@ -121,8 +121,7 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
|
||||||
|
|
||||||
// Check that all include paths exist
|
// Check that all include paths exist
|
||||||
{
|
{
|
||||||
std::list<std::string>::iterator iter;
|
for (std::list<std::string>::iterator iter = settings.includePaths.begin();
|
||||||
for (iter = settings.includePaths.begin();
|
|
||||||
iter != settings.includePaths.end();
|
iter != settings.includePaths.end();
|
||||||
) {
|
) {
|
||||||
const std::string path(Path::toNativeSeparators(*iter));
|
const std::string path(Path::toNativeSeparators(*iter));
|
||||||
|
@ -195,9 +194,8 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
|
||||||
}
|
}
|
||||||
if (cppCheck.settings().exceptionHandling) {
|
if (cppCheck.settings().exceptionHandling) {
|
||||||
return check_wrapper(cppCheck, argc, argv);
|
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)
|
void CppCheckExecutor::setSettings(const Settings &settings)
|
||||||
|
@ -949,8 +947,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const cha
|
||||||
_settings = nullptr;
|
_settings = nullptr;
|
||||||
if (returnValue)
|
if (returnValue)
|
||||||
return settings.exitCode;
|
return settings.exitCode;
|
||||||
else
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in New Issue