Refactoring

This commit is contained in:
Daniel Marjamäki 2020-11-09 21:14:46 +01:00
parent bd5b2133ab
commit 7e8f405c6d
1 changed files with 6 additions and 6 deletions

View File

@ -1838,13 +1838,13 @@ Variable::Variable(const Token *name_, const std::string &clangType, const Token
mTypeStartToken = mTypeEndToken; mTypeStartToken = mTypeEndToken;
while (Token::Match(mTypeStartToken->previous(), "%type%|*|&")) while (Token::Match(mTypeStartToken->previous(), "%type%|*|&"))
mTypeStartToken = mTypeStartToken->previous(); mTypeStartToken = mTypeStartToken->previous();
if (mTypeStartToken->str() == "const")
mTypeStartToken = mTypeStartToken->next();
if (mTypeStartToken->str() == "struct")
mTypeStartToken = mTypeStartToken->next();
} }
if (Token::simpleMatch(mTypeStartToken, "static"))
setFlag(fIsStatic, true); while (Token::Match(mTypeStartToken, "const|struct|static")) {
if (mTypeStartToken->str() == "static")
setFlag(fIsStatic, true);
mTypeStartToken = mTypeStartToken->next();
}
if (endsWith(clangType, " &", 2)) if (endsWith(clangType, " &", 2))
setFlag(fIsReference, true); setFlag(fIsReference, true);