Skip to content

Commit 3319846

Browse files
committed
move ReportType back to checkers.h, keep functions in errorlogger.h
1 parent 637a487 commit 3319846

File tree

8 files changed

+190
-188
lines changed

8 files changed

+190
-188
lines changed

Makefile

+125-125
Large diffs are not rendered by default.

gui/resultstree.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static QStringList getLabels() {
145145
}
146146

147147
ResultsTree::ResultsTree(QWidget * parent) :
148-
QTreeView(parent), mReportType(ReportType::normal)
148+
QTreeView(parent)
149149
{
150150
setModel(&mModel);
151151
translate(); // Adds columns to grid

gui/resultstree.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "common.h"
2424
#include "showtypes.h"
25+
#include "checkers.h"
2526

2627
#include <cstdint>
2728

@@ -531,7 +532,7 @@ protected slots:
531532
bool mShowCppcheck = true;
532533
bool mShowClang = true;
533534

534-
ReportType mReportType;
535+
ReportType mReportType = ReportType::normal;
535536

536537
std::map<std::string, std::string> mGuideline;
537538
};

lib/checkers.h

+11
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,20 @@
2222
#include <map>
2323
#include <string>
2424
#include <vector>
25+
#include <cstdint>
2526

2627
#include "config.h"
2728

29+
enum class ReportType : std::uint8_t {
30+
normal = 0,
31+
autosar = 1,
32+
certC = 2,
33+
certCpp = 3,
34+
misraC = 4,
35+
misraCpp2008 = 5,
36+
misraCpp2023 = 6,
37+
};
38+
2839
namespace checkers {
2940
extern CPPCHECKLIB const std::map<std::string, std::string> allCheckers;
3041
extern CPPCHECKLIB const std::map<std::string, std::string> premiumCheckers;

lib/errorlogger.h

+1-10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "config.h"
2525
#include "errortypes.h"
2626
#include "color.h"
27+
#include "checkers.h"
2728

2829
#include <cstddef>
2930
#include <list>
@@ -280,16 +281,6 @@ class CPPCHECKLIB ErrorLogger {
280281
static const std::set<std::string> mCriticalErrorIds;
281282
};
282283

283-
enum class ReportType : std::uint8_t {
284-
normal = 0,
285-
autosar = 1,
286-
certC = 2,
287-
certCpp = 3,
288-
misraC = 4,
289-
misraCpp2008 = 5,
290-
misraCpp2023 = 6,
291-
};
292-
293284
/** Replace substring. Example replaceStr("1,NR,3", "NR", "2") => "1,2,3" */
294285
std::string replaceStr(std::string s, const std::string &from, const std::string &to);
295286

lib/settings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static int getPid()
5656
}
5757

5858
Settings::Settings()
59-
: reportType(ReportType::normal)
6059
{
6160
severity.setEnabled(Severity::error, true);
6261
certainty.setEnabled(Certainty::normal, true);

lib/settings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "platform.h"
2929
#include "standards.h"
3030
#include "suppressions.h"
31+
#include "checkers.h"
3132

3233
#include <algorithm>
3334
#include <atomic>
@@ -48,7 +49,6 @@
4849
#endif
4950

5051
enum class SHOWTIME_MODES : std::uint8_t;
51-
enum class ReportType : std::uint8_t;
5252
namespace ValueFlow {
5353
class Value;
5454
}
@@ -112,7 +112,7 @@ class CPPCHECKLIB WARN_UNUSED Settings {
112112
static std::pair<std::string, std::string> getNameAndVersion(const std::string& productName);
113113

114114
/** @brief Report type */
115-
ReportType reportType;
115+
ReportType reportType = ReportType::normal;
116116

117117
/** @brief addons, either filename of python/json file or json data */
118118
std::unordered_set<std::string> addons;

oss-fuzz/Makefile

+48-48
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)