@@ -1338,8 +1338,7 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer, AnalyzerInformation
13381338 const std::time_t maxTime = mSettings .checksMaxTime > 0 ? std::time (nullptr ) + mSettings .checksMaxTime : 0 ;
13391339
13401340 // call all "runChecks" in all registered Check classes
1341- // cppcheck-suppress shadowFunction - TODO: fix this
1342- for (Check *check : Check::instances ()) {
1341+ for (Check * const c : Check::instances ()) {
13431342 if (Settings::terminated ())
13441343 return ;
13451344
@@ -1357,8 +1356,8 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer, AnalyzerInformation
13571356 return ;
13581357 }
13591358
1360- Timer::run (check ->name () + " ::runChecks" , mTimerResults , [&]() {
1361- check ->runChecks (tokenizer, &mErrorLogger );
1359+ Timer::run (c ->name () + " ::runChecks" , mTimerResults , [&]() {
1360+ c ->runChecks (tokenizer, &mErrorLogger );
13621361 });
13631362 }
13641363 }
@@ -1388,11 +1387,10 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer, AnalyzerInformation
13881387 }
13891388
13901389 if (!doUnusedFunctionOnly) {
1391- // cppcheck-suppress shadowFunction - TODO: fix this
1392- for (const Check *check : Check::instances ()) {
1393- if (Check::FileInfo * const fi = check->getFileInfo (tokenizer, mSettings , currentConfig)) {
1390+ for (const Check * const c : Check::instances ()) {
1391+ if (Check::FileInfo * const fi = c->getFileInfo (tokenizer, mSettings , currentConfig)) {
13941392 if (analyzerInformation)
1395- analyzerInformation->setFileInfo (check ->name (), fi->toString ());
1393+ analyzerInformation->setFileInfo (c ->name (), fi->toString ());
13961394 if (mSettings .useSingleJob ())
13971395 mFileInfo .push_back (fi);
13981396 else
@@ -1714,8 +1712,8 @@ void CppCheck::getErrorMessages(ErrorLogger &errorlogger)
17141712 s.addEnabled (" all" );
17151713
17161714 // call all "getErrorMessages" in all registered Check classes
1717- for (auto it = Check::instances (). cbegin (); it != Check::instances (). cend (); ++it )
1718- (*it) ->getErrorMessages (&errorlogger, &s);
1715+ for (const Check * const c : Check::instances ())
1716+ c ->getErrorMessages (&errorlogger, &s);
17191717
17201718 CheckUnusedFunctions::getErrorMessages (errorlogger);
17211719 Preprocessor::getErrorMessages (errorlogger, s);
@@ -1832,9 +1830,8 @@ bool CppCheck::analyseWholeProgram()
18321830 }
18331831 }
18341832
1835- // cppcheck-suppress shadowFunction - TODO: fix this
1836- for (Check *check : Check::instances ())
1837- errors |= check->analyseWholeProgram (ctu, mFileInfo , mSettings , mErrorLogger ); // TODO: ctu
1833+ for (Check * const c : Check::instances ())
1834+ errors |= c->analyseWholeProgram (ctu, mFileInfo , mSettings , mErrorLogger ); // TODO: ctu
18381835 }
18391836
18401837 if (mUnusedFunctionsCheck )
@@ -1881,9 +1878,8 @@ unsigned int CppCheck::analyseWholeProgram(const std::string &buildDir, const st
18811878 }
18821879 else {
18831880 // Analyse the tokens
1884- // cppcheck-suppress shadowFunction - TODO: fix this
1885- for (Check *check : Check::instances ())
1886- check->analyseWholeProgram (ctuFileInfo, fileInfoList, mSettings , mErrorLogger );
1881+ for (Check * const c : Check::instances ())
1882+ c->analyseWholeProgram (ctuFileInfo, fileInfoList, mSettings , mErrorLogger );
18871883 }
18881884
18891885 for (Check::FileInfo *fi : fileInfoList)
0 commit comments