Changed handling of type wchar_t:
- Don't simplify wchar_t to unsigned short on Win32 platforms to ensure that checking of strings and nullpointer dereferences works. - Added it as standard type
This commit is contained in:
parent
17b720ef7d
commit
4ea2df8671
|
@ -120,7 +120,7 @@ void Token::update_property_isStandardType()
|
|||
if (_str.size() < 3)
|
||||
return;
|
||||
|
||||
static const char * const stdtype[] = {"int", "char", "bool", "long", "short", "float", "double", "size_t", 0};
|
||||
static const char * const stdtype[] = {"int", "char", "bool", "long", "short", "float", "double", "wchar_t", "size_t", 0};
|
||||
for (int i = 0; stdtype[i]; i++) {
|
||||
if (_str == stdtype[i]) {
|
||||
_isStandardType = true;
|
||||
|
|
|
@ -5252,7 +5252,7 @@ void Tokenizer::simplifyPlatformTypes()
|
|||
} else {
|
||||
tok->insertToken("int");
|
||||
}
|
||||
} else if (Token::Match(tok, "USHORT|WORD|WCHAR|ATOM|wchar_t|LANGID")) {
|
||||
} else if (Token::Match(tok, "USHORT|WORD|ATOM|LANGID")) {
|
||||
tok->str("unsigned");
|
||||
tok->insertToken("short");
|
||||
} else if (tok->str() == "VOID")
|
||||
|
@ -5261,8 +5261,7 @@ void Tokenizer::simplifyPlatformTypes()
|
|||
if (_settings->platformType == Settings::Win32A)
|
||||
tok->str("char");
|
||||
else {
|
||||
tok->str("unsigned");
|
||||
tok->insertToken("short");
|
||||
tok->str("wchar_t");
|
||||
}
|
||||
} else if (tok->str() == "TBYTE") {
|
||||
tok->str("unsigned");
|
||||
|
|
Loading…
Reference in New Issue