From 3c4ce7b43a37da77dc0b037d6d1abf6e8d5fbb9b Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 6 Jul 2012 13:17:08 +0200 Subject: [PATCH] Fixed (for real) the preprocessor.cpp(1166) warning in #2123. --- cli/cppcheckexecutor.cpp | 4 ++-- cli/cppcheckexecutor.h | 2 +- lib/cppcheck.cpp | 2 +- lib/cppcheck.h | 2 +- lib/errorlogger.h | 2 +- lib/preprocessor.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 0dda831ce..0ca86722a 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -237,7 +237,7 @@ void CppCheckExecutor::reportOut(const std::string &outmsg) std::cout << outmsg << std::endl; } -void CppCheckExecutor::reportProgress(const std::string &filename, const char stage[], const unsigned int value) +void CppCheckExecutor::reportProgress(const std::string &filename, const char stage[], const size_t value) { (void)filename; @@ -256,7 +256,7 @@ void CppCheckExecutor::reportProgress(const std::string &filename, const char st std::ostringstream ostr; ostr << "progress: " << stage - << ' ' << int(value) << '%'; + << ' ' << value << '%'; if (_settings->_verbose) ostr << " time=" << str.substr(11, 8); diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index eb4b1091a..a9a1089c9 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -70,7 +70,7 @@ public: /** xml output of errors */ virtual void reportErr(const ErrorLogger::ErrorMessage &msg); - void reportProgress(const std::string &filename, const char stage[], const unsigned int value); + void reportProgress(const std::string &filename, const char stage[], const size_t value); /** * Output information messages. diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index dde70bef3..f31d0846d 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -506,7 +506,7 @@ void CppCheck::reportOut(const std::string &outmsg) _errorLogger.reportOut(outmsg); } -void CppCheck::reportProgress(const std::string &filename, const char stage[], const unsigned int value) +void CppCheck::reportProgress(const std::string &filename, const char stage[], const size_t value) { _errorLogger.reportProgress(filename, stage, value); } diff --git a/lib/cppcheck.h b/lib/cppcheck.h index c43f27241..650290944 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -173,7 +173,7 @@ private: std::string _fileContent; std::set _dependencies; - void reportProgress(const std::string &filename, const char stage[], const unsigned int value); + void reportProgress(const std::string &filename, const char stage[], const size_t value); /** * Output information messages. diff --git a/lib/errorlogger.h b/lib/errorlogger.h index d9cb035fe..c6d17349d 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -276,7 +276,7 @@ public: * @param stage for example preprocess / tokenize / simplify / check * @param value progress value (0-100) */ - virtual void reportProgress(const std::string &filename, const char stage[], const unsigned int value) { + virtual void reportProgress(const std::string &filename, const char stage[], const size_t value) { (void)filename; (void)stage; (void)value; diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 85942488a..bd9d97523 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -1160,7 +1160,7 @@ std::list Preprocessor::getcfgs(const std::string &filedata, const } // Remove defined constants from ifdef configurations.. - unsigned int count = 0; + size_t count = 0; for (std::list::iterator it = ret.begin(); it != ret.end(); ++it) { if (_errorLogger) _errorLogger->reportProgress(filename, "Preprocessing (get configurations 2)", (100 * count++) / ret.size());