Fixed several coverity messages
This commit is contained in:
parent
a32f268519
commit
662745b504
|
@ -130,7 +130,7 @@ static bool parseInlineSuppressionCommentToken(const simplecpp::Token *tok, std:
|
|||
|
||||
static void inlineSuppressions(const simplecpp::TokenList &tokens, Settings &mSettings, std::list<BadInlineSuppression> *bad)
|
||||
{
|
||||
for (const simplecpp::Token *tok = tokens.cfront(); tok; tok = tok ? tok->next : nullptr) {
|
||||
for (const simplecpp::Token *tok = tokens.cfront(); tok; tok = tok->next) {
|
||||
if (!tok->comment)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -1031,7 +1031,7 @@ void Token::insertToken(const std::string &tokenStr, const std::string &original
|
|||
Token *tok1 = newToken;
|
||||
while (Token::Match(tok1->previous(), "const|volatile|final|override|&|&&|noexcept"))
|
||||
tok1 = tok1->previous();
|
||||
if (tok1 && tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
if (tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
tok1 = tok1->linkAt(-1);
|
||||
if (Token::Match(tok1->previous(), "throw|noexcept")) {
|
||||
tok1 = tok1->previous();
|
||||
|
|
|
@ -1707,7 +1707,7 @@ namespace {
|
|||
Token *tok1 = tok;
|
||||
while (Token::Match(tok1->previous(), "const|volatile|final|override|&|&&|noexcept"))
|
||||
tok1 = tok1->previous();
|
||||
if (tok1 && tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
if (tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
tok1 = tok1->linkAt(-1);
|
||||
if (Token::Match(tok1->previous(), "throw|noexcept")) {
|
||||
tok1 = tok1->previous();
|
||||
|
@ -2906,7 +2906,7 @@ void Tokenizer::calculateScopes()
|
|||
Token *tok1 = tok;
|
||||
while (Token::Match(tok1->previous(), "const|volatile|final|override|&|&&|noexcept"))
|
||||
tok1 = tok1->previous();
|
||||
if (tok1 && tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
if (tok1->previous() && tok1->strAt(-1) == ")") {
|
||||
bool member = true;
|
||||
tok1 = tok1->linkAt(-1);
|
||||
if (Token::Match(tok1->previous(), "throw|noexcept")) {
|
||||
|
@ -7224,12 +7224,7 @@ bool Tokenizer::simplifyKnownVariables()
|
|||
std::unordered_map<int, std::string> constantValues;
|
||||
std::map<int, Token*> constantVars;
|
||||
std::unordered_map<int, std::list<Token*>> constantValueUsages;
|
||||
bool goback = false;
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (goback) {
|
||||
tok = tok->previous();
|
||||
goback = false;
|
||||
}
|
||||
// Reference to variable
|
||||
if (Token::Match(tok, "%type%|* & %name% = %name% ;")) {
|
||||
Token *start = tok->previous();
|
||||
|
|
Loading…
Reference in New Issue