diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index efc4358c7..d06060438 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -1775,13 +1775,13 @@ void TemplateSimplifier::simplifyTemplates( for (std::list::const_iterator iter2 = templateDeclarations.begin(); iter2 != templateDeclarations.end(); ++iter2) { if (iter1->name == iter2->name) { const Token *tok = iter2->token->next()->findClosingBracket(); - int namepos = getTemplateNamePosition(tok); + const int namepos = getTemplateNamePosition(tok); if (namepos > 0) specializations.push_back(tok->tokAt(namepos)); } } - bool instantiated = TemplateSimplifier::simplifyTemplateInstantiations(tokenlist, + const bool instantiated = TemplateSimplifier::simplifyTemplateInstantiations(tokenlist, errorlogger, _settings, *iter1, diff --git a/lib/token.cpp b/lib/token.cpp index 5b7531027..d3c182f42 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -1522,7 +1522,7 @@ const Token *Token::getValueTokenMinStrSize() const std::list::const_iterator it; for (it = _values->begin(); it != _values->end(); ++it) { if (it->isTokValue() && it->tokvalue && it->tokvalue->tokType() == Token::eString) { - std::size_t size = getStrSize(it->tokvalue); + const std::size_t size = getStrSize(it->tokvalue); if (!ret || size < minsize) { minsize = size; ret = it->tokvalue; @@ -1541,7 +1541,7 @@ const Token *Token::getValueTokenMaxStrLength() const std::list::const_iterator it; for (it = _values->begin(); it != _values->end(); ++it) { if (it->isTokValue() && it->tokvalue && it->tokvalue->tokType() == Token::eString) { - std::size_t length = getStrLength(it->tokvalue); + const std::size_t length = getStrLength(it->tokvalue); if (!ret || length > maxlength) { maxlength = length; ret = it->tokvalue; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index d70a271d7..5af1a30a2 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2620,7 +2620,7 @@ static void valueFlowAfterCondition(TokenList *tokenlist, SymbolDatabase* symbol continue; } - bool dead_if = isReturnScope(after); + const bool dead_if = isReturnScope(after); bool dead_else = false; if (Token::simpleMatch(after, "} else {")) {