Clang import; fixed ValueType::typeSize calls
This commit is contained in:
parent
cefd7fb33f
commit
36a67c7022
|
@ -969,7 +969,7 @@ static void setValues(Tokenizer *tokenizer, SymbolDatabase *symbolDatabase)
|
|||
mul *= dim.num;
|
||||
}
|
||||
if (var.valueType())
|
||||
typeSize += mul * var.valueType()->typeSize(*settings);
|
||||
typeSize += mul * var.valueType()->typeSize(*settings, true);
|
||||
}
|
||||
scope.definedType->sizeOf = typeSize;
|
||||
}
|
||||
|
@ -977,7 +977,7 @@ static void setValues(Tokenizer *tokenizer, SymbolDatabase *symbolDatabase)
|
|||
for (Token *tok = const_cast<Token*>(tokenizer->tokens()); tok; tok = tok->next()) {
|
||||
if (Token::simpleMatch(tok, "sizeof (")) {
|
||||
ValueType vt = ValueType::parseDecl(tok->tokAt(2), settings);
|
||||
int sz = vt.typeSize(*settings);
|
||||
int sz = vt.typeSize(*settings, true);
|
||||
if (sz <= 0)
|
||||
continue;
|
||||
int mul = 1;
|
||||
|
|
|
@ -6127,10 +6127,10 @@ std::string ValueType::dump() const
|
|||
return ret.str();
|
||||
}
|
||||
|
||||
MathLib::bigint ValueType::typeSize(const cppcheck::Platform &platform) const
|
||||
MathLib::bigint ValueType::typeSize(const cppcheck::Platform &platform, bool p) const
|
||||
{
|
||||
//if (pointer)
|
||||
// return platform.sizeof_pointer;
|
||||
if (p && pointer)
|
||||
return platform.sizeof_pointer;
|
||||
|
||||
if (typeScope && typeScope->definedType && typeScope->definedType->sizeOf)
|
||||
return typeScope->definedType->sizeOf;
|
||||
|
|
|
@ -1222,7 +1222,7 @@ public:
|
|||
return typeScope && typeScope->type == Scope::eEnum;
|
||||
}
|
||||
|
||||
MathLib::bigint typeSize(const cppcheck::Platform &platform) const;
|
||||
MathLib::bigint typeSize(const cppcheck::Platform &platform, bool p=false) const;
|
||||
|
||||
std::string str() const;
|
||||
std::string dump() const;
|
||||
|
|
Loading…
Reference in New Issue