Skip to content

Commit

Permalink
cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Jun 29, 2024
1 parent 6057a18 commit 7eadf7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static QString getClassification(ResultsTree::ReportType reportType, const QStri
if (!ok)
return QString();
for (const auto& info: checkers::misraC2012Rules) {
// cppcheck-suppress useStlAlgorithm
if (info.a == a && info.b == b)
return info.str;
}
Expand All @@ -138,6 +139,7 @@ static QString getClassification(ResultsTree::ReportType reportType, const QStri
if (!ok)
return QString();
for (const auto& info: checkers::misraCpp2008Rules) {
// cppcheck-suppress useStlAlgorithm
if (info.a == a && info.b == b && info.c == c)
return info.classification;
}
Expand All @@ -157,6 +159,7 @@ static QString getClassification(ResultsTree::ReportType reportType, const QStri
if (!ok)
return QString();
for (const auto& info: checkers::misraCpp2023Rules) {
// cppcheck-suppress useStlAlgorithm
if (info.a == a && info.b == b && info.c == c)
return info.classification;
}
Expand Down
2 changes: 1 addition & 1 deletion gui/resultstree.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ResultsTree : public QTreeView {

void setReportType(const QString& reportType);

enum class ReportType {normal, autosar, certC, certCpp, misraC, misraCpp2008, misraCpp2023};
enum class ReportType: std::uint8_t {normal, autosar, certC, certCpp, misraC, misraCpp2008, misraCpp2023};

signals:
/**
Expand Down

0 comments on commit 7eadf7b

Please sign in to comment.