Skip to content

Commit db22e09

Browse files
authored
some Settings::premium related cleanups (danmar#8109)
1 parent a683c05 commit db22e09

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

cli/cmdlineparser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
353353
return Result::Fail;
354354

355355
if (argc <= 1) {
356-
printHelp(mSettings.premium);
356+
printHelp();
357357
return Result::Exit;
358358
}
359359

@@ -388,7 +388,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
388388

389389
// Print help
390390
if (std::strcmp(argv[i], "-h") == 0 || std::strcmp(argv[i], "--help") == 0) {
391-
printHelp(mSettings.premium);
391+
printHelp();
392392
return Result::Exit;
393393
}
394394

@@ -1700,7 +1700,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
17001700
return Result::Success;
17011701
}
17021702

1703-
void CmdLineParser::printHelp(bool premium) const
1703+
void CmdLineParser::printHelp() const
17041704
{
17051705
std::ostringstream oss;
17061706
// TODO: display product name
@@ -1901,7 +1901,7 @@ void CmdLineParser::printHelp(bool premium) const
19011901
" --plist-output=<path>\n"
19021902
" Generate Clang-plist output files in folder.\n";
19031903

1904-
if (premium) {
1904+
if (mSettings.premium) {
19051905
oss <<
19061906
" --premium=<option>\n"
19071907
" Coding standards:\n"

cli/cmdlineparser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class CmdLineParser {
109109
/**
110110
* Print help text to the console.
111111
*/
112-
void printHelp(bool premium) const;
112+
void printHelp() const;
113113

114114
template<typename T>
115115
bool parseNumberArg(const char* const arg, std::size_t offset, T& num, bool mustBePositive = false)

lib/checkersreport.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
#include <unordered_set>
3131
#include <vector>
3232

33-
static bool isCppcheckPremium(const Settings& settings) {
34-
return (settings.cppcheckCfgProductName.compare(0, 16, "Cppcheck Premium") == 0);
35-
}
36-
3733
static int getMisraCVersion(const Settings& settings) {
3834
if (settings.premiumArgs.find("misra-c-2025") != std::string::npos)
3935
return 2025;
@@ -194,7 +190,7 @@ std::string CheckersReport::getReport(const std::string& criticalErrors) const
194190
fout << std::endl;
195191
}
196192

197-
const bool cppcheckPremium = isCppcheckPremium(mSettings);
193+
const bool cppcheckPremium = mSettings.premium;
198194

199195
auto reportSection = [&fout, cppcheckPremium]
200196
(const std::string& title,

0 commit comments

Comments
 (0)