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)
|
if (_str.size() < 3)
|
||||||
return;
|
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++) {
|
for (int i = 0; stdtype[i]; i++) {
|
||||||
if (_str == stdtype[i]) {
|
if (_str == stdtype[i]) {
|
||||||
_isStandardType = true;
|
_isStandardType = true;
|
||||||
|
|
|
@ -5252,7 +5252,7 @@ void Tokenizer::simplifyPlatformTypes()
|
||||||
} else {
|
} else {
|
||||||
tok->insertToken("int");
|
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->str("unsigned");
|
||||||
tok->insertToken("short");
|
tok->insertToken("short");
|
||||||
} else if (tok->str() == "VOID")
|
} else if (tok->str() == "VOID")
|
||||||
|
@ -5261,8 +5261,7 @@ void Tokenizer::simplifyPlatformTypes()
|
||||||
if (_settings->platformType == Settings::Win32A)
|
if (_settings->platformType == Settings::Win32A)
|
||||||
tok->str("char");
|
tok->str("char");
|
||||||
else {
|
else {
|
||||||
tok->str("unsigned");
|
tok->str("wchar_t");
|
||||||
tok->insertToken("short");
|
|
||||||
}
|
}
|
||||||
} else if (tok->str() == "TBYTE") {
|
} else if (tok->str() == "TBYTE") {
|
||||||
tok->str("unsigned");
|
tok->str("unsigned");
|
||||||
|
|
Loading…
Reference in New Issue