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 /src/qml/compiler/qqmlirbuilder_p.h | |
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 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder_p.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h index 673bc2c481..7f2cf40611 100644 --- a/src/qml/compiler/qqmlirbuilder_p.h +++ b/src/qml/compiler/qqmlirbuilder_p.h @@ -82,12 +82,11 @@ struct PoolList PoolList() : first(nullptr) , last(nullptr) - , count(0) {} T *first; T *last; - int count; + int count = 0; int append(T *item) { item->next = nullptr; @@ -205,11 +204,11 @@ class FixedPoolArray { T *data; public: - int count; + int count = 0; FixedPoolArray() : data(nullptr) - , count(0) + {} void allocate(QQmlJS::MemoryPool *pool, int size) @@ -343,21 +342,16 @@ struct Function struct Q_QML_PRIVATE_EXPORT CompiledFunctionOrExpression { CompiledFunctionOrExpression() - : node(nullptr) - , nameIndex(0) - , disableAcceleratedLookups(false) - , next(nullptr) + {} CompiledFunctionOrExpression(QQmlJS::AST::Node *n) : node(n) - , nameIndex(0) - , disableAcceleratedLookups(false) - , next(nullptr) + {} - QQmlJS::AST::Node *node; // FunctionDeclaration, Statement or Expression - quint32 nameIndex; - bool disableAcceleratedLookups; - CompiledFunctionOrExpression *next; + QQmlJS::AST::Node *node = nullptr; // FunctionDeclaration, Statement or Expression + quint32 nameIndex = 0; + bool disableAcceleratedLookups = false; + CompiledFunctionOrExpression *next = nullptr; }; struct Q_QML_PRIVATE_EXPORT Object |