cli:platforms: Added missing sizeof Boolean variable handling when platform file is loaded from XML.

This commit is contained in:
orbitcowboy 2018-02-13 11:27:50 +01:00
parent 1906067aac
commit b86b7175cb
2 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,8 @@ bool cppcheck::Platform::platformFile(const char exename[], const std::string &f
for (const tinyxml2::XMLElement *sz = node->FirstChildElement(); sz; sz = sz->NextSiblingElement()) {
if (std::strcmp(sz->Name(), "short") == 0)
sizeof_short = std::atoi(sz->GetText());
else if (std::strcmp(sz->Name(), "bool") == 0)
sizeof_bool = std::atoi(sz->GetText());
else if (std::strcmp(sz->Name(), "int") == 0)
sizeof_int = std::atoi(sz->GetText());
else if (std::strcmp(sz->Name(), "long") == 0)

View File

@ -3,6 +3,7 @@
<char_bit>8</char_bit>
<default-sign>unsigned</default-sign>
<sizeof>
<bool>1</bool>
<short>2</short>
<int>2</int>
<long>4</long>