aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2017-07-28 12:33:37 +0200
committerRobert Loehning <robert.loehning@qt.io>2017-08-11 10:34:00 +0000
commit74d14d0092d5b427512b8c322245c9659cef97bb (patch)
tree730dfc598bb6d9827d66f00eb3745c21d2fcd9e2
parenteb16dd3c79e8ef01041ca70d1168778a75c70802 (diff)
QmlJs: Initialize members
Change-Id: I15a3ec660608266595a8b7a12b59016cc28331af Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/libs/qmljs/parser/qmljslexer.cpp1
-rw-r--r--src/libs/qmljs/parser/qmljsparser.cpp1
-rw-r--r--src/libs/qmljs/qmljscheck.cpp2
-rw-r--r--src/libs/qmljs/qmljscodeformatter.cpp1
-rw-r--r--src/libs/qmljs/qmljsdescribevalue.h2
-rw-r--r--src/libs/qmljs/qmljsreformatter.cpp10
-rw-r--r--src/libs/qmljs/qmljsscopeastpath.h2
-rw-r--r--src/libs/qmljs/qmljsstaticanalysismessage.cpp2
-rw-r--r--src/libs/qmljs/qmljsstaticanalysismessage.h2
-rw-r--r--src/libs/qmljs/qmljstypedescriptionreader.h4
10 files changed, 15 insertions, 12 deletions
diff --git a/src/libs/qmljs/parser/qmljslexer.cpp b/src/libs/qmljs/parser/qmljslexer.cpp
index 8ab06dc7ec..d24920e24d 100644
--- a/src/libs/qmljs/parser/qmljslexer.cpp
+++ b/src/libs/qmljs/parser/qmljslexer.cpp
@@ -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)
diff --git a/src/libs/qmljs/parser/qmljsparser.cpp b/src/libs/qmljs/parser/qmljsparser.cpp
index 87cc41b00c..1bba51e410 100644
--- a/src/libs/qmljs/parser/qmljsparser.cpp
+++ b/src/libs/qmljs/parser/qmljsparser.cpp
@@ -78,6 +78,7 @@ Parser::Parser(Engine *engine):
location_stack(0),
string_stack(0),
program(0),
+ yylval(0),
first_token(0),
last_token(0)
{
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 911b46d906..1076bd27c0 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -324,7 +324,7 @@ protected:
class MarkUnreachableCode : protected ReachesEndCheck
{
QList<Message> _messages;
- bool _emittedWarning;
+ bool _emittedWarning = false;
public:
QList<Message> operator()(Node *ast)
diff --git a/src/libs/qmljs/qmljscodeformatter.cpp b/src/libs/qmljs/qmljscodeformatter.cpp
index d4e3bfb084..750cda4287 100644
--- a/src/libs/qmljs/qmljscodeformatter.cpp
+++ b/src/libs/qmljs/qmljscodeformatter.cpp
@@ -43,6 +43,7 @@ CodeFormatter::BlockData::BlockData()
CodeFormatter::CodeFormatter()
: m_indentDepth(0)
, m_tabSize(4)
+ , m_tokenIndex(0)
{
}
diff --git a/src/libs/qmljs/qmljsdescribevalue.h b/src/libs/qmljs/qmljsdescribevalue.h
index 3c27c320e5..3c5d23bcbd 100644
--- a/src/libs/qmljs/qmljsdescribevalue.h
+++ b/src/libs/qmljs/qmljsdescribevalue.h
@@ -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;
diff --git a/src/libs/qmljs/qmljsreformatter.cpp b/src/libs/qmljs/qmljsreformatter.cpp
index 6c4befa0f8..e9d139dd2b 100644
--- a/src/libs/qmljs/qmljsreformatter.cpp
+++ b/src/libs/qmljs/qmljsreformatter.cpp
@@ -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)
diff --git a/src/libs/qmljs/qmljsscopeastpath.h b/src/libs/qmljs/qmljsscopeastpath.h
index f06db11c5c..44b4eacf7c 100644
--- a/src/libs/qmljs/qmljsscopeastpath.h
+++ b/src/libs/qmljs/qmljsscopeastpath.h
@@ -56,7 +56,7 @@ private:
QList<AST::Node *> _result;
Document::Ptr _doc;
- quint32 _offset;
+ quint32 _offset = 0;
};
} // namespace QmlJS
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
index 34929ab3b6..389cbdf348 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
@@ -254,7 +254,7 @@ QList<Type> Message::allMessageTypes()
}
Message::Message()
- : type(UnknownType), severity(Hint)
+ : type(UnknownType)
{}
Message::Message(Type type,
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.h b/src/libs/qmljs/qmljsstaticanalysismessage.h
index 4d07614c8d..109a85a027 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.h
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.h
@@ -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);
};
diff --git a/src/libs/qmljs/qmljstypedescriptionreader.h b/src/libs/qmljs/qmljstypedescriptionreader.h
index 900ec38304..69eec45b17 100644
--- a/src/libs/qmljs/qmljstypedescriptionreader.h
+++ b/src/libs/qmljs/qmljstypedescriptionreader.h
@@ -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