diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-21 11:52:59 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-26 13:08:30 +0000 |
commit | 06e962f263a86c4b66e1c6195b3d2615695fea1e (patch) | |
tree | 3669793f9983762538a9cb12a07ce49d461f066d /tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp | |
parent | 78e875e6dbd4991fe22c194d8608b3d66c96e036 (diff) |
init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init'
-config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix
Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp')
-rw-r--r-- | tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp index bb7e50dbbd..a8bcadbc84 100644 --- a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp +++ b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp @@ -89,7 +89,6 @@ class UncontrolledAnimation : public QObject, public QAbstractAnimationJob Q_OBJECT public: UncontrolledAnimation() - : id(0) { } @@ -113,7 +112,7 @@ protected: } private: - int id; + int id = 0; }; class StateChangeListener: public QAnimationJobChangeListener @@ -133,14 +132,14 @@ public: class FinishedListener: public QAnimationJobChangeListener { public: - FinishedListener() : m_count(0) {} + FinishedListener() {} virtual void animationFinished(QAbstractAnimationJob *) { ++m_count; } void clear() { m_count = 0; } int count() { return m_count; } private: - int m_count; + int m_count = 0; }; void tst_QParallelAnimationGroupJob::setCurrentTime() @@ -685,10 +684,10 @@ void tst_QParallelAnimationGroupJob::stopUncontrolledAnimations() } struct AnimState { - AnimState(int time = -1) : time(time), state(-1) {} + AnimState(int time = -1) : time(time) {} AnimState(int time, int state) : time(time), state(state) {} int time; - int state; + int state = -1; }; #define Running QAbstractAnimationJob::Running |