Revert "Fixed #3450 (CLI --report-progress is currently useless)"

This reverts commit e769fe6294.
This commit is contained in:
Daniel Marjamäki 2012-01-02 07:42:39 +01:00
parent e769fe6294
commit 112873e876
5 changed files with 8 additions and 8 deletions

View File

@ -412,7 +412,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
// Report progress // Report progress
else if (strcmp(argv[i], "--report-progress") == 0) { else if (strcmp(argv[i], "--report-progress") == 0) {
_settings->reportProgressTime = 10; _settings->reportProgress = true;
} }
// --std // --std

View File

@ -161,7 +161,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (_settings.reportProgressTime > 0) if (cppCheck.settings().reportProgress)
time1 = std::time(0); time1 = std::time(0);
_settings = cppCheck.settings(); _settings = cppCheck.settings();
@ -247,12 +247,12 @@ void CppCheckExecutor::reportProgress(const std::string &filename, const char st
{ {
(void)filename; (void)filename;
if (_settings.reportProgressTime == 0) if (!time1)
return; return;
// Report progress messages every 10 seconds // Report progress messages every 10 seconds
const std::time_t time2 = std::time(NULL); const std::time_t time2 = std::time(NULL);
if (time2 >= (time1 + _settings.reportProgressTime)) { if (time2 >= (time1 + 10)) {
time1 = time2; time1 = time2;
// current time in the format "Www Mmm dd hh:mm:ss yyyy" // current time in the format "Www Mmm dd hh:mm:ss yyyy"

View File

@ -43,7 +43,7 @@ Settings::Settings()
inconclusive = false; inconclusive = false;
experimental = false; experimental = false;
test_2_pass = false; test_2_pass = false;
reportProgressTime = 0; reportProgress = false;
ifcfg = false; ifcfg = false;
checkConfiguration = false; checkConfiguration = false;

View File

@ -156,8 +156,8 @@ public:
/** @brief Experimental 2 pass checking of files */ /** @brief Experimental 2 pass checking of files */
bool test_2_pass; bool test_2_pass;
/** @brief 0 => don't report progress. 1-.. => report progress every T seconds */ /** @brief --report-progress */
unsigned char reportProgressTime; bool reportProgress;
/** /**
* @brief Is there any preprocessor configurations in the source code? * @brief Is there any preprocessor configurations in the source code?

View File

@ -616,7 +616,7 @@ private:
Settings settings; Settings settings;
CmdLineParser parser(&settings); CmdLineParser parser(&settings);
ASSERT(parser.ParseFromArgs(3, argv)); ASSERT(parser.ParseFromArgs(3, argv));
ASSERT_EQUALS(10U, settings.reportProgressTime); ASSERT(settings.reportProgress);
} }
void stdposix() { void stdposix() {