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 /tools | |
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 'tools')
-rw-r--r-- | tools/qmlcachegen/generateloader.cpp | 6 | ||||
-rw-r--r-- | tools/qmlscene/main.cpp | 44 |
2 files changed, 17 insertions, 33 deletions
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp index 0d6c80a859..1a0b987c64 100644 --- a/tools/qmlcachegen/generateloader.cpp +++ b/tools/qmlcachegen/generateloader.cpp @@ -58,12 +58,10 @@ struct VirtualDirectoryEntry { QString name; QVector<VirtualDirectoryEntry*> dirEntries; - int firstChildIndex; // node index inside generated data - bool isDirectory; + int firstChildIndex = -1; // node index inside generated data + bool isDirectory = true; VirtualDirectoryEntry() - : firstChildIndex(-1) - , isDirectory(true) {} ~VirtualDirectoryEntry() diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 9bfeca7897..bc7fe72d4c 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -145,21 +145,7 @@ struct Options }; Options() - : originalQml(false) - , originalQmlRaster(false) - , maximized(false) - , fullscreen(false) - , transparent(false) - , clip(false) - , versionDetection(true) - , slowAnimations(false) - , quitImmediately(false) - , resizeViewToRootItem(false) - , multisample(false) - , coreProfile(false) - , verbose(false) - , applicationType(DefaultQmlApplicationType) - , textRenderType(QQuickWindow::textRenderType()) + : textRenderType(QQuickWindow::textRenderType()) { // QtWebEngine needs a shared context in order for the GPU thread to // upload textures. @@ -167,22 +153,22 @@ struct Options } QUrl url; - bool originalQml; - bool originalQmlRaster; - bool maximized; - bool fullscreen; - bool transparent; - bool clip; - bool versionDetection; - bool slowAnimations; - bool quitImmediately; - bool resizeViewToRootItem; - bool multisample; - bool coreProfile; - bool verbose; + bool originalQml = false; + bool originalQmlRaster = false; + bool maximized = false; + bool fullscreen = false; + bool transparent = false; + bool clip = false; + bool versionDetection = true; + bool slowAnimations = false; + bool quitImmediately = false; + bool resizeViewToRootItem = false; + bool multisample = false; + bool coreProfile = false; + bool verbose = false; QVector<Qt::ApplicationAttribute> applicationAttributes; QString translationFile; - QmlApplicationType applicationType; + QmlApplicationType applicationType = DefaultQmlApplicationType; QQuickWindow::TextRenderType textRenderType; }; |