Added CPPCHECKLIB to two clases and reverted 30a942af0b
This commit is contained in:
parent
f5d9ba9cf3
commit
b634a76fcb
|
@ -3769,3 +3769,32 @@ void SymbolDatabase::setValueTypeInTokenList(Token *tokens)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ValueType::str() const
|
||||||
|
{
|
||||||
|
std::string ret;
|
||||||
|
if (isIntegral()) {
|
||||||
|
if (sign == SIGNED)
|
||||||
|
ret = "signed ";
|
||||||
|
else if (sign == UNSIGNED)
|
||||||
|
ret = "unsigned ";
|
||||||
|
if (type == BOOL)
|
||||||
|
ret += "bool";
|
||||||
|
else if (type == CHAR)
|
||||||
|
ret += "char";
|
||||||
|
else if (type == SHORT)
|
||||||
|
ret += "short";
|
||||||
|
else if (type == INT)
|
||||||
|
ret += "int";
|
||||||
|
else if (type == LONG)
|
||||||
|
ret += "long";
|
||||||
|
else if (type == LONGLONG)
|
||||||
|
ret += "long long";
|
||||||
|
} else if (type == FLOAT)
|
||||||
|
ret = "float";
|
||||||
|
else if (type == DOUBLE)
|
||||||
|
ret = "double";
|
||||||
|
for (unsigned int p = 0; p < pointer; p++)
|
||||||
|
ret += "*";
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -1039,7 +1039,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Value type */
|
/** Value type */
|
||||||
class ValueType {
|
class CPPCHECKLIB ValueType {
|
||||||
public:
|
public:
|
||||||
enum Sign {UNKNOWN_SIGN, SIGNED, UNSIGNED} sign;
|
enum Sign {UNKNOWN_SIGN, SIGNED, UNSIGNED} sign;
|
||||||
enum Type {UNKNOWN_TYPE, NONSTD, BOOL, CHAR, SHORT, INT, LONG, LONGLONG, FLOAT, DOUBLE} type;
|
enum Type {UNKNOWN_TYPE, NONSTD, BOOL, CHAR, SHORT, INT, LONG, LONGLONG, FLOAT, DOUBLE} type;
|
||||||
|
@ -1052,33 +1052,7 @@ public:
|
||||||
return (type >= ValueType::Type::BOOL && type <= ValueType::Type::LONGLONG);
|
return (type >= ValueType::Type::BOOL && type <= ValueType::Type::LONGLONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string str() const {
|
std::string str() const;
|
||||||
std::string ret;
|
|
||||||
if (isIntegral()) {
|
|
||||||
if (sign == SIGNED)
|
|
||||||
ret = "signed ";
|
|
||||||
else if (sign == UNSIGNED)
|
|
||||||
ret = "unsigned ";
|
|
||||||
if (type == BOOL)
|
|
||||||
ret += "bool";
|
|
||||||
else if (type == CHAR)
|
|
||||||
ret += "char";
|
|
||||||
else if (type == SHORT)
|
|
||||||
ret += "short";
|
|
||||||
else if (type == INT)
|
|
||||||
ret += "int";
|
|
||||||
else if (type == LONG)
|
|
||||||
ret += "long";
|
|
||||||
else if (type == LONGLONG)
|
|
||||||
ret += "long long";
|
|
||||||
} else if (type == FLOAT)
|
|
||||||
ret = "float";
|
|
||||||
else if (type == DOUBLE)
|
|
||||||
ret = "double";
|
|
||||||
for (unsigned int p = 0; p < pointer; p++)
|
|
||||||
ret += "*";
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class ErrorLogger;
|
||||||
class Settings;
|
class Settings;
|
||||||
|
|
||||||
namespace ValueFlow {
|
namespace ValueFlow {
|
||||||
class Value {
|
class CPPCHECKLIB Value {
|
||||||
public:
|
public:
|
||||||
explicit Value(long long val = 0) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {}
|
explicit Value(long long val = 0) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {}
|
||||||
Value(const Token *c, long long val) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {}
|
Value(const Token *c, long long val) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {}
|
||||||
|
|
Loading…
Reference in New Issue