Refactor lib/checkio.cpp

This commit is contained in:
jrp2014 2018-04-05 15:55:57 +02:00 committed by Daniel Marjamäki
parent 17bd2f0c72
commit c367fc9f09
1 changed files with 2 additions and 3 deletions

View File

@ -1593,8 +1593,7 @@ bool CheckIO::ArgumentInfo::isStdVectorOrString()
} else if (variableInfo->type()) { } else if (variableInfo->type()) {
const Scope * classScope = variableInfo->type()->classScope; const Scope * classScope = variableInfo->type()->classScope;
if (classScope) { if (classScope) {
std::list<Function>::const_iterator functions; for (std::list<Function>::const_iterator functions = classScope->functionList.begin();
for (functions = classScope->functionList.begin();
functions != classScope->functionList.end(); ++functions) { functions != classScope->functionList.end(); ++functions) {
if (functions->name() == "operator[]") { if (functions->name() == "operator[]") {
if (Token::Match(functions->retDef, "%type% &")) { if (Token::Match(functions->retDef, "%type% &")) {
@ -1697,7 +1696,7 @@ void CheckIO::wrongPrintfScanfArgumentsError(const Token* tok,
unsigned int numFormat, unsigned int numFormat,
unsigned int numFunction) 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)) if (severity != Severity::error && !_settings->isEnabled(Settings::WARNING))
return; return;