diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-04-04 14:43:49 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-04-27 10:07:51 +0000 |
commit | fbbddb1b67ab30b1c73a9ff1ae41ee5e344c0197 (patch) | |
tree | 78f1b6a5c82d2893f737f82699f27a7d1374e017 /src/lib/corelib/buildgraph | |
parent | 37c992559fc79fd73828b653f80d0f2c3234568f (diff) | |
download | qbs-fbbddb1b67ab30b1c73a9ff1ae41ee5e344c0197.tar.gz |
clang-tidy: Fix 'cppcoreguidelines-pro-type-member-init' warnings
Also, fix undefined behavior when setting and reading different field of
a union (Lexer, Token) - according to the C++ Standard, it is not
allowed to use a union to zero members of a struct.
Treat these warnings as errors now.
Change-Id: I0f6d071217ef55e2c75c51138fcff47048eca62f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r-- | src/lib/corelib/buildgraph/artifact.cpp | 17 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/artifact.h | 1 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/corelib/buildgraph/artifact.cpp b/src/lib/corelib/buildgraph/artifact.cpp index e82919560..8d3a8bd3f 100644 --- a/src/lib/corelib/buildgraph/artifact.cpp +++ b/src/lib/corelib/buildgraph/artifact.cpp @@ -51,9 +51,13 @@ namespace qbs { namespace Internal { -Artifact::Artifact() +Artifact::Artifact() : + artifactType(ArtifactType::Unknown), + inputsScanned(false), + timestampRetrieved(false), + alwaysUpdated(false), + oldDataPossiblyPresent(true) { - initialize(); } Artifact::~Artifact() @@ -120,15 +124,6 @@ RuleNode *Artifact::producer() const return *ruleNodes.begin(); } -void Artifact::initialize() -{ - artifactType = Unknown; - inputsScanned = false; - timestampRetrieved = false; - alwaysUpdated = true; - oldDataPossiblyPresent = true; -} - const TypeFilter<Artifact> Artifact::parentArtifacts() const { return TypeFilter<Artifact>(parents); diff --git a/src/lib/corelib/buildgraph/artifact.h b/src/lib/corelib/buildgraph/artifact.h index ee3acea59..2572a3b52 100644 --- a/src/lib/corelib/buildgraph/artifact.h +++ b/src/lib/corelib/buildgraph/artifact.h @@ -114,7 +114,6 @@ public: bool alwaysUpdated : 1; bool oldDataPossiblyPresent : 1; - void initialize(); const TypeFilter<Artifact> parentArtifacts() const; const TypeFilter<Artifact> childArtifacts() const; void onChildDisconnected(BuildGraphNode *child) override; |