Skip to content

Commit b634a76

Browse files
committed
Added CPPCHECKLIB to two clases and reverted 30a942a
1 parent f5d9ba9 commit b634a76

3 files changed

Lines changed: 32 additions & 29 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,3 +3769,32 @@ void SymbolDatabase::setValueTypeInTokenList(Token *tokens)
37693769
}
37703770
}
37713771
}
3772+
3773+
std::string ValueType::str() const
3774+
{
3775+
std::string ret;
3776+
if (isIntegral()) {
3777+
if (sign == SIGNED)
3778+
ret = "signed ";
3779+
else if (sign == UNSIGNED)
3780+
ret = "unsigned ";
3781+
if (type == BOOL)
3782+
ret += "bool";
3783+
else if (type == CHAR)
3784+
ret += "char";
3785+
else if (type == SHORT)
3786+
ret += "short";
3787+
else if (type == INT)
3788+
ret += "int";
3789+
else if (type == LONG)
3790+
ret += "long";
3791+
else if (type == LONGLONG)
3792+
ret += "long long";
3793+
} else if (type == FLOAT)
3794+
ret = "float";
3795+
else if (type == DOUBLE)
3796+
ret = "double";
3797+
for (unsigned int p = 0; p < pointer; p++)
3798+
ret += "*";
3799+
return ret;
3800+
}

lib/symboldatabase.h

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ class CPPCHECKLIB SymbolDatabase {
10391039
};
10401040

10411041
/** Value type */
1042-
class ValueType {
1042+
class CPPCHECKLIB ValueType {
10431043
public:
10441044
enum Sign {UNKNOWN_SIGN, SIGNED, UNSIGNED} sign;
10451045
enum Type {UNKNOWN_TYPE, NONSTD, BOOL, CHAR, SHORT, INT, LONG, LONGLONG, FLOAT, DOUBLE} type;
@@ -1052,33 +1052,7 @@ class ValueType {
10521052
return (type >= ValueType::Type::BOOL && type <= ValueType::Type::LONGLONG);
10531053
}
10541054

1055-
std::string str() const {
1056-
std::string ret;
1057-
if (isIntegral()) {
1058-
if (sign == SIGNED)
1059-
ret = "signed ";
1060-
else if (sign == UNSIGNED)
1061-
ret = "unsigned ";
1062-
if (type == BOOL)
1063-
ret += "bool";
1064-
else if (type == CHAR)
1065-
ret += "char";
1066-
else if (type == SHORT)
1067-
ret += "short";
1068-
else if (type == INT)
1069-
ret += "int";
1070-
else if (type == LONG)
1071-
ret += "long";
1072-
else if (type == LONGLONG)
1073-
ret += "long long";
1074-
} else if (type == FLOAT)
1075-
ret = "float";
1076-
else if (type == DOUBLE)
1077-
ret = "double";
1078-
for (unsigned int p = 0; p < pointer; p++)
1079-
ret += "*";
1080-
return ret;
1081-
}
1055+
std::string str() const;
10821056
};
10831057

10841058

lib/valueflow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ErrorLogger;
3030
class Settings;
3131

3232
namespace ValueFlow {
33-
class Value {
33+
class CPPCHECKLIB Value {
3434
public:
3535
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) {}
3636
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) {}

0 commit comments

Comments
 (0)