Tokenizer: Refactoring simplifyPlatformTypes()

This commit is contained in:
Daniel Marjamäki 2016-08-02 19:44:18 +02:00
parent 5e78dae143
commit 908e1b991e
1 changed files with 48 additions and 53 deletions

View File

@ -5579,17 +5579,14 @@ void Tokenizer::simplifyPlatformTypes()
enum { isLongLong, isLong, isInt } type;
/** @todo This assumes a flat address space. Not true for segmented address space (FAR *). */
if (_settings->sizeof_size_t == 8) {
if (_settings->sizeof_long == 8)
if (_settings->sizeof_size_t == _settings->sizeof_long)
type = isLong;
else
else if (_settings->sizeof_size_t == _settings->sizeof_long_long)
type = isLongLong;
} else if (_settings->sizeof_size_t == 4) {
if (_settings->sizeof_long == 4)
type = isLong;
else
else if (_settings->sizeof_size_t == _settings->sizeof_int)
type = isInt;
} else
else
return;
for (Token *tok = list.front(); tok; tok = tok->next()) {
@ -5636,8 +5633,7 @@ void Tokenizer::simplifyPlatformTypes()
}
}
if (_settings->isWindowsPlatform()) {
std::string platform_type(_settings->platformString());
const std::string platform_type(_settings->platformString());
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (tok->tokType() != Token::eType && tok->tokType() != Token::eName)
@ -5683,7 +5679,6 @@ void Tokenizer::simplifyPlatformTypes()
typeToken->isLong(true);
}
}
}
}
void Tokenizer::simplifyStdType()