From e962f57a998cd97558edd1b728282222be43b3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 17 Jun 2018 19:20:07 +0200 Subject: [PATCH] Rename private member variables --- lib/cppcheck.cpp | 12 ++++++------ lib/cppcheck.h | 2 +- lib/pathmatch.cpp | 14 +++++++------- lib/pathmatch.h | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index a91944d33..658278b6a 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -54,7 +54,7 @@ static TimerResults S_timerResults; static const CWE CWE398(398U); // Indicator of Poor Code Quality CppCheck::CppCheck(ErrorLogger &errorLogger, bool useGlobalSuppressions) - : mErrorLogger(errorLogger), mExitCode(0), mUseGlobalSuppressions(useGlobalSuppressions), tooManyConfigs(false), mSimplify(true) + : mErrorLogger(errorLogger), mExitCode(0), mUseGlobalSuppressions(useGlobalSuppressions), mTooManyConfigs(false), mSimplify(true) { } @@ -297,7 +297,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string if (mSettings.isEnabled(Settings::INFORMATION)) { tooManyConfigsError(Path::toNativeSeparators(filename),configurations.size()); } else { - tooManyConfigs = true; + mTooManyConfigs = true; } } @@ -681,10 +681,10 @@ Settings &CppCheck::settings() void CppCheck::tooManyConfigsError(const std::string &file, const std::size_t numberOfConfigurations) { - if (!mSettings.isEnabled(Settings::INFORMATION) && !tooManyConfigs) + if (!mSettings.isEnabled(Settings::INFORMATION) && !mTooManyConfigs) return; - tooManyConfigs = false; + mTooManyConfigs = false; if (mSettings.isEnabled(Settings::INFORMATION) && file.empty()) return; @@ -722,7 +722,7 @@ void CppCheck::tooManyConfigsError(const std::string &file, const std::size_t nu void CppCheck::purgedConfigurationMessage(const std::string &file, const std::string& configuration) { - tooManyConfigs = false; + mTooManyConfigs = false; if (mSettings.isEnabled(Settings::INFORMATION) && file.empty()) return; @@ -814,7 +814,7 @@ void CppCheck::getErrorMessages() purgedConfigurationMessage("",""); - tooManyConfigs = true; + mTooManyConfigs = true; tooManyConfigsError("",0U); // call all "getErrorMessages" in all registered Check classes diff --git a/lib/cppcheck.h b/lib/cppcheck.h index c8680dcd1..de3236e27 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -218,7 +218,7 @@ private: bool mUseGlobalSuppressions; /** Are there too many configs? */ - bool tooManyConfigs; + bool mTooManyConfigs; /** Simplify code? true by default */ bool mSimplify; diff --git a/lib/pathmatch.cpp b/lib/pathmatch.cpp index cb19312e5..d4afd3bb4 100644 --- a/lib/pathmatch.cpp +++ b/lib/pathmatch.cpp @@ -26,12 +26,12 @@ #include PathMatch::PathMatch(const std::vector &excludedPaths, bool caseSensitive) - : _excludedPaths(excludedPaths), _caseSensitive(caseSensitive) + : mExcludedPaths(excludedPaths), mCaseSensitive(caseSensitive) { - if (!_caseSensitive) - for (std::vector::iterator i = _excludedPaths.begin(); i != _excludedPaths.end(); ++i) + if (!mCaseSensitive) + for (std::vector::iterator i = mExcludedPaths.begin(); i != mExcludedPaths.end(); ++i) std::transform(i->begin(), i->end(), i->begin(), ::tolower); - _workingDirectory.push_back(Path::getCurrentPath()); + mWorkingDirectory.push_back(Path::getCurrentPath()); } bool PathMatch::match(const std::string &path) const @@ -39,11 +39,11 @@ bool PathMatch::match(const std::string &path) const if (path.empty()) return false; - for (std::vector::const_iterator i = _excludedPaths.begin(); i != _excludedPaths.end(); ++i) { - const std::string excludedPath((!Path::isAbsolute(path) && Path::isAbsolute(*i)) ? Path::getRelativePath(*i, _workingDirectory) : *i); + for (std::vector::const_iterator i = mExcludedPaths.begin(); i != mExcludedPaths.end(); ++i) { + const std::string excludedPath((!Path::isAbsolute(path) && Path::isAbsolute(*i)) ? Path::getRelativePath(*i, mWorkingDirectory) : *i); std::string findpath = Path::fromNativeSeparators(path); - if (!_caseSensitive) + if (!mCaseSensitive) std::transform(findpath.begin(), findpath.end(), findpath.begin(), ::tolower); // Filtering directory name diff --git a/lib/pathmatch.h b/lib/pathmatch.h index f7dc7abfd..698e8d163 100644 --- a/lib/pathmatch.h +++ b/lib/pathmatch.h @@ -58,9 +58,9 @@ protected: static std::string removeFilename(const std::string &path); private: - std::vector _excludedPaths; - bool _caseSensitive; - std::vector _workingDirectory; + std::vector mExcludedPaths; + bool mCaseSensitive; + std::vector mWorkingDirectory; }; /// @}