Skip to content

Commit 480c392

Browse files
committed
ImportProject: removed premium parameters
1 parent 1964216 commit 480c392

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

cli/cmdlineparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
11621162

11631163
mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force
11641164
std::string projectFile = argv[i]+10;
1165-
projectType = project.import(projectFile, &mSettings, &mSuppressions, mSettings.premium);
1165+
projectType = project.import(projectFile, &mSettings, &mSuppressions);
11661166
if (projectType == ImportProject::Type::CPPCHECK_GUI) {
11671167
for (const std::string &lib : project.guiProject.libraries)
11681168
mSettings.libraries.emplace_back(lib);

lib/importproject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void ImportProject::fsSetIncludePaths(FileSettings& fs, const std::string &basep
164164
}
165165
}
166166

167-
ImportProject::Type ImportProject::import(const std::string &filename, Settings *settings, Suppressions *supprs, bool premium)
167+
ImportProject::Type ImportProject::import(const std::string &filename, Settings *settings, Suppressions *supprs)
168168
{
169169
std::ifstream fin(filename);
170170
if (!fin.is_open())
@@ -200,7 +200,7 @@ ImportProject::Type ImportProject::import(const std::string &filename, Settings
200200
return ImportProject::Type::BORLAND;
201201
}
202202
} else if (settings && supprs && endsWith(filename, ".cppcheck")) {
203-
if (importCppcheckGuiProject(fin, *settings, *supprs, premium)) {
203+
if (importCppcheckGuiProject(fin, *settings, *supprs)) {
204204
setRelativePaths(filename);
205205
return ImportProject::Type::CPPCHECK_GUI;
206206
}
@@ -1290,7 +1290,7 @@ static std::string istream_to_string(std::istream &istr)
12901290
return std::string(std::istreambuf_iterator<char>(istr), eos);
12911291
}
12921292

1293-
bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings &settings, Suppressions &supprs, bool premium)
1293+
bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings &settings, Suppressions &supprs)
12941294
{
12951295
tinyxml2::XMLDocument doc;
12961296
const std::string xmldata = istream_to_string(istr);
@@ -1374,7 +1374,7 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings &setti
13741374
else if (strcmp(name, CppcheckXml::AddonsElementName) == 0) {
13751375
const auto& addons = readXmlStringList(node, "", CppcheckXml::AddonElementName, nullptr);
13761376
temp.addons.insert(addons.cbegin(), addons.cend());
1377-
if (premium) {
1377+
if (settings.premium) {
13781378
auto it = temp.addons.find("misra");
13791379
if (it != temp.addons.end()) {
13801380
temp.addons.erase(it);

lib/importproject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ class CPPCHECKLIB WARN_UNUSED ImportProject {
9898
void ignorePaths(const std::vector<std::string> &ipaths, bool debug = false);
9999
void ignoreOtherConfigs(const std::string &cfg);
100100

101-
Type import(const std::string &filename, Settings *settings=nullptr, Suppressions *supprs=nullptr, bool premium=false);
101+
Type import(const std::string &filename, Settings *settings=nullptr, Suppressions *supprs=nullptr);
102102
protected:
103103
bool importCompileCommands(std::istream &istr);
104-
bool importCppcheckGuiProject(std::istream &istr, Settings &settings, Suppressions &supprs, bool premium);
104+
bool importCppcheckGuiProject(std::istream &istr, Settings &settings, Suppressions &supprs);
105105

106106
private:
107107
struct SharedItemsProject {

test/testimportproject.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ class TestImportProject : public TestFixture {
456456
Settings s;
457457
Suppressions supprs;
458458
TestImporter project;
459-
ASSERT_EQUALS(true, project.importCppcheckGuiProject(istr, s, supprs, false));
459+
ASSERT_EQUALS(true, project.importCppcheckGuiProject(istr, s, supprs));
460460
ASSERT_EQUALS(1, project.guiProject.pathNames.size());
461461
ASSERT_EQUALS("cli/", project.guiProject.pathNames[0]);
462462
ASSERT_EQUALS(1, s.includePaths.size());
@@ -477,9 +477,10 @@ class TestImportProject : public TestFixture {
477477
"</project>";
478478
std::istringstream istr(xml);
479479
Settings s;
480+
s.premium = true;
480481
Suppressions supprs;
481482
TestImporter project;
482-
ASSERT_EQUALS(true, project.importCppcheckGuiProject(istr, s, supprs, true));
483+
ASSERT_EQUALS(true, project.importCppcheckGuiProject(istr, s, supprs));
483484
ASSERT_EQUALS("--misra-c-2012", s.premiumArgs);
484485
ASSERT(s.addons.empty());
485486
}

0 commit comments

Comments
 (0)