Skip to content

Commit d7bb76f

Browse files
committed
ci
1 parent 6a164fc commit d7bb76f

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

lib/cppcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ void CppCheck::executeAddons(const std::vector<std::string>& files, const std::s
15161516
if (isCtuInfo && addonInfo.name != "misra" && !addonInfo.ctu)
15171517
continue;
15181518

1519-
ProgressReporter(mErrorLogger, mSettings.reportProgress, files.front(), "addon:" + addonInfo.name + (isCtuInfo ? " (ctu)" : ""));
1519+
ProgressReporter progressReporter(mErrorLogger, mSettings.reportProgress, files.front(), "addon:" + addonInfo.name + (isCtuInfo ? " (ctu)" : ""));
15201520

15211521
std::vector<picojson::value> results;
15221522

lib/errorlogger.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -291,36 +291,35 @@ class CPPCHECKLIB ErrorLogger {
291291
class CPPCHECKLIB ProgressReporter {
292292
public:
293293
ProgressReporter(ErrorLogger& e, int reportProgressInterval, std::string filename, std::string stage) :
294-
errorLogger(e),
295-
reportProgressInterval(reportProgressInterval),
296-
filename(std::move(filename)),
297-
stage(std::move(stage)) {
294+
mErrorLogger(e),
295+
mReportProgressInterval(reportProgressInterval),
296+
mFilename(std::move(filename)),
297+
mStage(std::move(stage)) {
298298
report(0);
299299
}
300300

301301
~ProgressReporter() {
302-
lastTime = 0;
303-
errorLogger.reportProgress(filename, stage.c_str(), 100);
302+
mErrorLogger.reportProgress(mFilename, mStage.c_str(), 100);
304303
}
305304

306305
void report(int value) {
307-
if (reportProgressInterval < 0 || value == lastValue)
306+
if (mReportProgressInterval < 0 || value == mLastValue)
308307
return;
309308
const std::time_t t = std::time(nullptr);
310-
if (t >= lastTime + reportProgressInterval) {
311-
errorLogger.reportProgress(filename, stage.c_str(), value);
312-
lastTime = t;
313-
lastValue = value;
309+
if (t >= mLastTime + mReportProgressInterval) {
310+
mErrorLogger.reportProgress(mFilename, mStage.c_str(), value);
311+
mLastTime = t;
312+
mLastValue = value;
314313
}
315314
}
316315

317316
private:
318-
ErrorLogger& errorLogger;
319-
const int reportProgressInterval;
320-
const std::string filename;
321-
const std::string stage;
322-
std::time_t lastTime{0};
323-
int lastValue{-1};
317+
ErrorLogger& mErrorLogger;
318+
const int mReportProgressInterval;
319+
const std::string mFilename;
320+
const std::string mStage;
321+
std::time_t mLastTime{0};
322+
int mLastValue{-1};
324323
};
325324

326325
/** Replace substring. Example replaceStr("1,NR,3", "NR", "2") => "1,2,3" */

0 commit comments

Comments
 (0)