From c367fc9f09897e63fb990f8b90650041c070de33 Mon Sep 17 00:00:00 2001 From: jrp2014 Date: Thu, 5 Apr 2018 15:55:57 +0200 Subject: [PATCH] Refactor lib/checkio.cpp --- lib/checkio.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/checkio.cpp b/lib/checkio.cpp index b7cb4d5eb..a473e8d1a 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -1593,8 +1593,7 @@ bool CheckIO::ArgumentInfo::isStdVectorOrString() } else if (variableInfo->type()) { const Scope * classScope = variableInfo->type()->classScope; if (classScope) { - std::list::const_iterator functions; - for (functions = classScope->functionList.begin(); + for (std::list::const_iterator functions = classScope->functionList.begin(); functions != classScope->functionList.end(); ++functions) { if (functions->name() == "operator[]") { if (Token::Match(functions->retDef, "%type% &")) { @@ -1697,7 +1696,7 @@ void CheckIO::wrongPrintfScanfArgumentsError(const Token* tok, unsigned int numFormat, unsigned int numFunction) { - Severity::SeverityType severity = numFormat > numFunction ? Severity::error : Severity::warning; + const Severity::SeverityType severity = numFormat > numFunction ? Severity::error : Severity::warning; if (severity != Severity::error && !_settings->isEnabled(Settings::WARNING)) return;