minor cleanups. initialize members in initialization list

This commit is contained in:
Zachary Blair 2014-01-06 08:02:04 +01:00 committed by Daniel Marjamäki
parent c4fa3bb137
commit 4a2da09491
3 changed files with 30 additions and 17 deletions

View File

@ -98,8 +98,12 @@ public:
class ArgumentChecks {
public:
ArgumentChecks() {
notbool = notnull = notuninit = formatstr = strz = false;
ArgumentChecks() :
notbool(false),
notnull(false),
notuninit(false),
formatstr(false),
strz(false) {
}
bool notbool;

View File

@ -65,6 +65,10 @@ public:
} needInitialization;
struct BaseInfo {
BaseInfo() :
type(NULL), nameTok(NULL), access(Public), isVirtual(false) {
}
std::string name;
const Type* type;
const Token* nameTok;
@ -73,6 +77,10 @@ public:
};
struct FriendInfo {
FriendInfo() :
nameStart(NULL), nameEnd(NULL), type(NULL) {
}
const Token* nameStart;
const Token* nameEnd;
std::string name;

View File

@ -370,6 +370,7 @@ Token * Tokenizer::deleteInvalidTypedef(Token *typeDef)
}
struct Space {
Space() : classEnd(NULL), isNamespace(false) { }
std::string className;
const Token * classEnd;
bool isNamespace;
@ -7531,23 +7532,23 @@ bool Tokenizer::duplicateDefinition(Token ** tokPtr, const Token * name) const
class EnumValue {
public:
EnumValue() {
name = 0;
value = 0;
start = 0;
end = 0;
EnumValue() :
name(NULL),
value(NULL),
start(NULL),
end(NULL) {
}
EnumValue(const EnumValue &ev) {
name = ev.name;
value = ev.value;
start = ev.start;
end = ev.end;
EnumValue(const EnumValue &ev) :
name(ev.name),
value(ev.value),
start(ev.start),
end(ev.end) {
}
EnumValue(Token *name_, Token *value_, Token *start_, Token *end_) {
name = name_;
value = value_;
start = start_;
end = end_;
EnumValue(Token *name_, Token *value_, Token *start_, Token *end_) :
name(name_),
value(value_),
start(start_),
end(end_) {
}
void simplify(const std::map<std::string, EnumValue> &enumValues) {