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/jsruntime/qv4executableallocator_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/jsruntime/qv4executableallocator_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator_p.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h index 2984a89df5..375c9a365f 100644 --- a/src/qml/jsruntime/qv4executableallocator_p.h +++ b/src/qml/jsruntime/qv4executableallocator_p.h @@ -82,11 +82,8 @@ public: struct Allocation { Allocation() - : addr(0) - , size(0) + : size(0) , free(true) - , next(nullptr) - , prev(nullptr) {} void *start() const; @@ -103,11 +100,11 @@ public: bool mergeNext(ExecutableAllocator *allocator); bool mergePrevious(ExecutableAllocator *allocator); - quintptr addr; + quintptr addr = 0; uint size : 31; // More than 2GB of function code? nah :) uint free : 1; - Allocation *next; - Allocation *prev; + Allocation *next = nullptr; + Allocation *prev = nullptr; }; // for debugging / unit-testing @@ -117,13 +114,12 @@ public: struct ChunkOfPages { ChunkOfPages() - : pages(nullptr) - , firstAllocation(nullptr) + {} ~ChunkOfPages(); - WTF::PageAllocation *pages; - Allocation *firstAllocation; + WTF::PageAllocation *pages = nullptr; + Allocation *firstAllocation = nullptr; bool contains(Allocation *alloc) const; }; |