QmlJs: Initialize members

Change-Id: I15a3ec660608266595a8b7a12b59016cc28331af
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Robert Loehning
2017-07-28 12:33:37 +02:00
parent eb16dd3c79
commit 74d14d0092
10 changed files with 15 additions and 12 deletions

View File

@@ -72,6 +72,7 @@ static inline QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4)
Lexer::Lexer(Engine *engine)
: _engine(engine)
, _codePtr(0)
, _endPtr(0)
, _lastLinePtr(0)
, _tokenLinePtr(0)
, _tokenStartPtr(0)

View File

@@ -78,6 +78,7 @@ Parser::Parser(Engine *engine):
location_stack(0),
string_stack(0),
program(0),
yylval(0),
first_token(0),
last_token(0)
{

View File

@@ -324,7 +324,7 @@ protected:
class MarkUnreachableCode : protected ReachesEndCheck
{
QList<Message> _messages;
bool _emittedWarning;
bool _emittedWarning = false;
public:
QList<Message> operator()(Node *ast)

View File

@@ -43,6 +43,7 @@ CodeFormatter::BlockData::BlockData()
CodeFormatter::CodeFormatter()
: m_indentDepth(0)
, m_tabSize(4)
, m_tokenIndex(0)
{
}

View File

@@ -65,7 +65,7 @@ private:
int m_depth;
int m_indent;
int m_indentIncrement;
bool m_emptyContext;
bool m_emptyContext = false;
ContextPtr m_context;
QSet<const Value *> m_visited;
QString m_description;

View File

@@ -90,11 +90,11 @@ class Rewriter : protected Visitor
QList<Split> _possibleSplits;
QTextDocument _resultDocument;
SimpleFormatter _formatter;
int _indent;
int _nextComment;
int _lastNewlineOffset;
bool _hadEmptyLine;
int _binaryExpDepth;
int _indent = 0;
int _nextComment = 0;
int _lastNewlineOffset = -1;
bool _hadEmptyLine = false;
int _binaryExpDepth = 0;
public:
Rewriter(Document::Ptr doc)

View File

@@ -56,7 +56,7 @@ private:
QList<AST::Node *> _result;
Document::Ptr _doc;
quint32 _offset;
quint32 _offset = 0;
};
} // namespace QmlJS

View File

@@ -254,7 +254,7 @@ QList<Type> Message::allMessageTypes()
}
Message::Message()
: type(UnknownType), severity(Hint)
: type(UnknownType)
{}
Message::Message(Type type,

View File

@@ -160,7 +160,7 @@ public:
AST::SourceLocation location;
QString message;
Type type;
Severity::Enum severity;
Severity::Enum severity = Severity::Enum::Hint;
static const PrototypeMessageData prototypeForMessageType(Type type);
};

View File

@@ -91,8 +91,8 @@ private:
QString _errorMessage;
QString _warningMessage;
QHash<QString, LanguageUtils::FakeMetaObject::ConstPtr> *_objects;
QList<ModuleApiInfo> *_moduleApis;
QStringList *_dependencies;
QList<ModuleApiInfo> *_moduleApis = nullptr;
QStringList *_dependencies = nullptr;
};
} // namespace QmlJS