File tree Expand file tree Collapse file tree 2 files changed +23
-30
lines changed Expand file tree Collapse file tree 2 files changed +23
-30
lines changed Original file line number Diff line number Diff line change @@ -165,9 +165,8 @@ EToken ErrFileLexer::readNext()
165
165
boost::smatch sm;
166
166
167
167
if (boost::regex_match (line, sm, reChecker_)) {
168
- def_ = Defect ();
169
- def_.checker = sm[/* checker */ 1 ];
170
- def_.annotation = sm[/* annotat */ 2 ];
168
+ def_ = Defect (sm[/* checker */ 1 ]);
169
+ def_.annotation = sm[/* annotation */ 2 ];
171
170
return T_CHECKER;
172
171
}
173
172
Original file line number Diff line number Diff line change 45
45
46
46
47
47
struct DefEvent {
48
- std::string fileName;
49
- int line ;
50
- int column ;
51
- std::string event;
52
- std::string msg;
48
+ std::string fileName;
49
+ int line = 0 ;
50
+ int column = 0 ;
51
+ std::string event;
52
+ std::string msg;
53
53
54
54
// / 0 = key event, 1 = info event, 2 = trace event
55
- int verbosityLevel ;
55
+ int verbosityLevel = 0 ;
56
56
57
- DefEvent ():
58
- line (0 ),
59
- column (0 ),
60
- verbosityLevel (0 )
61
- {
62
- }
57
+ DefEvent () { }
63
58
};
64
59
65
60
inline bool cmpEvents (bool *pResult, const DefEvent &a, const DefEvent &b)
@@ -85,21 +80,20 @@ inline bool operator<(const DefEvent &a, const DefEvent &b)
85
80
typedef std::vector<DefEvent> TEvtList;
86
81
87
82
struct Defect {
88
- std::string checker;
89
- std::string annotation;
90
- TEvtList events;
91
- unsigned keyEventIdx; // /< in range 0..(events.size()-1)
92
- int cwe; // /< CWE number, 0 means unused
93
- int imp; // /< "important" flag, bool for now
94
- int defectId; // /< used only by the JSON format
95
- std::string function; // /< used only by the JSON format
96
- std::string language; // /< used only by the JSON format
97
-
98
- Defect ():
99
- keyEventIdx (0U ),
100
- cwe (0 ),
101
- imp (0 ),
102
- defectId (0 )
83
+ std::string checker;
84
+ std::string annotation;
85
+ TEvtList events;
86
+ unsigned keyEventIdx = 0U ; // /< in range 0..(events.size()-1)
87
+ int cwe = 0 ; // /< CWE number, 0 means unused
88
+ int imp = 0 ; // /< "important" flag, bool for now
89
+ int defectId = 0 ; // /< used only by the JSON format
90
+ std::string function; // /< used only by the JSON format
91
+ std::string language; // /< used only by the JSON format
92
+
93
+ Defect () { }
94
+
95
+ explicit Defect (const std::string checker):
96
+ checker(checker)
103
97
{
104
98
}
105
99
};
You can’t perform that action at this time.
0 commit comments