diff --git a/lib/token.cpp b/lib/token.cpp index ba5e7c51c..14b77a7db 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -562,16 +562,7 @@ size_t Token::getStrLength(const Token *tok) bool Token::isStandardType() const { bool ret = false; - const char *type[] = {"bool", "char", "short", "int", "long", "float", "double", "size_t", "__int8", "__int16", "__int32", "__int64", 0}; - for (int i = 0; type[i]; i++) - ret |= (_str == type[i]); - return ret; -} - -bool Token::isIntegerType() const -{ - bool ret = false; - const char *type[] = {"char", "short", "int", "long", "size_t", "__int8", "__int16", "__int32", "__int64", 0}; + const char *type[] = {"bool", "char", "short", "int", "long", "float", "double", "size_t", 0}; for (int i = 0; type[i]; i++) ret |= (_str == type[i]); return ret; diff --git a/lib/token.h b/lib/token.h index 5ebcb55fe..1137d2758 100644 --- a/lib/token.h +++ b/lib/token.h @@ -181,7 +181,6 @@ public: _isUnused = used; } bool isStandardType() const; - bool isIntegerType() const; static const Token *findmatch(const Token *tok, const char pattern[], unsigned int varId = 0); static const Token *findmatch(const Token *tok, const char pattern[], const Token *end, unsigned int varId = 0); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 0e288bf13..ad6bc69e7 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4986,7 +4986,7 @@ void Tokenizer::simplifyStdType() bool isUnsigned = tok->str() == "unsigned"; // unsigned i => unsigned int i - if (!tok->next()->isIntegerType()) + if (!Token::Match(tok->next(), "char|short|int|long|__int8|__int16|__int32|__int64")) tok->str("int"); else tok->deleteThis();