Refactoring handling of microsoft types. Ticket: #1956
This commit is contained in:
parent
cb7b508f77
commit
807269b5e9
|
@ -562,16 +562,7 @@ size_t Token::getStrLength(const Token *tok)
|
||||||
bool Token::isStandardType() const
|
bool Token::isStandardType() const
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
const char *type[] = {"bool", "char", "short", "int", "long", "float", "double", "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;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Token::isIntegerType() const
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
const char *type[] = {"char", "short", "int", "long", "size_t", "__int8", "__int16", "__int32", "__int64", 0};
|
|
||||||
for (int i = 0; type[i]; i++)
|
for (int i = 0; type[i]; i++)
|
||||||
ret |= (_str == type[i]);
|
ret |= (_str == type[i]);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -181,7 +181,6 @@ public:
|
||||||
_isUnused = used;
|
_isUnused = used;
|
||||||
}
|
}
|
||||||
bool isStandardType() const;
|
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[], unsigned int varId = 0);
|
||||||
static const Token *findmatch(const Token *tok, const char pattern[], const Token *end, unsigned int varId = 0);
|
static const Token *findmatch(const Token *tok, const char pattern[], const Token *end, unsigned int varId = 0);
|
||||||
|
|
|
@ -4986,7 +4986,7 @@ void Tokenizer::simplifyStdType()
|
||||||
bool isUnsigned = tok->str() == "unsigned";
|
bool isUnsigned = tok->str() == "unsigned";
|
||||||
|
|
||||||
// unsigned i => unsigned int i
|
// 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");
|
tok->str("int");
|
||||||
else
|
else
|
||||||
tok->deleteThis();
|
tok->deleteThis();
|
||||||
|
|
Loading…
Reference in New Issue