diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 4c92fbc58..fa84098a0 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2394,13 +2394,15 @@ void Scope::getVariableList() continue; } else break; - } else if (Token::Match(tok, "struct|union {") && Token::Match(tok->next()->link(), "} %var% ;|[")) { - tok = tok->next()->link()->tokAt(2); - continue; - } else if (Token::Match(tok, "struct|union {") && Token::simpleMatch(tok->next()->link(), "} ;")) { - level++; - tok = tok->next(); - continue; + } else if (Token::Match(tok, "struct|union {")) { + if (Token::Match(tok->next()->link(), "} %var% ;|[")) { + tok = tok->next()->link()->tokAt(2); + continue; + } else if (Token::simpleMatch(tok->next()->link(), "} ;")) { + level++; + tok = tok->next(); + continue; + } } // Borland C++: Skip all variables in the __published section. diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index c912f1e3c..992449e39 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5441,8 +5441,11 @@ void Tokenizer::simplifyPlatformTypes() _settings->platformType == Settings::Win32W || _settings->platformType == Settings::Win64) { for (Token *tok = list.front(); tok; tok = tok->next()) { - if (!tok->isName()) + if (tok->type() != Token::eType && tok->type() != Token::eName) continue; + if (!tok->isUpperCaseName()) // All WinAPI types are uppercase. Reduce number of Token::Match calls by this condition. + continue; + if (Token::Match(tok, "BOOL|INT|INT32|HFILE|LONG32")) { tok->originalName(tok->str()); tok->str("int");