summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-10-20 18:46:16 +0100
committerMike Krus <mike.krus@kdab.com>2019-10-21 09:52:59 +0100
commit3281951ccc9b607ffaf41d8425b3e3cce3936fd1 (patch)
tree58abafd7b2092eb0559d497a63e1522385303d43 /src/animation
parentce4663c2659d9e1611a1647a9b3cd26da8a80604 (diff)
Fix Coverity warnings
Change-Id: I00c875b48d838170fddf0b92f0ac5592828c6f0f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/backend/abstractevaluateclipanimatorjob.cpp5
-rw-r--r--src/animation/backend/animationclip.cpp2
-rw-r--r--src/animation/backend/buildblendtreesjob.cpp3
-rw-r--r--src/animation/backend/channelmapping.cpp4
-rw-r--r--src/animation/backend/evaluateblendclipanimatorjob.cpp1
-rw-r--r--src/animation/backend/evaluateclipanimatorjob.cpp1
-rw-r--r--src/animation/backend/findrunningclipanimatorsjob.cpp3
-rw-r--r--src/animation/backend/loadanimationclipjob.cpp1
-rw-r--r--src/animation/frontend/qabstractchannelmapping.cpp1
-rw-r--r--src/animation/frontend/qvertexblendanimation.cpp4
10 files changed, 14 insertions, 11 deletions
diff --git a/src/animation/backend/abstractevaluateclipanimatorjob.cpp b/src/animation/backend/abstractevaluateclipanimatorjob.cpp
index 236a96efe..5267d4526 100644
--- a/src/animation/backend/abstractevaluateclipanimatorjob.cpp
+++ b/src/animation/backend/abstractevaluateclipanimatorjob.cpp
@@ -53,13 +53,8 @@ public:
void postFrame(Qt3DCore::QAspectManager *manager) override;
- Q_DECLARE_PUBLIC(AbstractEvaluateClipAnimatorJob)
-
AnimationRecord m_record;
QVector<AnimationCallbackAndValue> m_callbacks;
-
-private:
- AbstractEvaluateClipAnimatorJob *q_ptr;
};
AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob()
diff --git a/src/animation/backend/animationclip.cpp b/src/animation/backend/animationclip.cpp
index 2dea81b52..2c7e4fffb 100644
--- a/src/animation/backend/animationclip.cpp
+++ b/src/animation/backend/animationclip.cpp
@@ -68,6 +68,7 @@ AnimationClip::AnimationClip()
, m_name()
, m_channels()
, m_duration(0.0f)
+ , m_channelComponentCount(0)
{
}
@@ -81,6 +82,7 @@ void AnimationClip::cleanup()
m_dataType = Unknown;
m_channels.clear();
m_duration = 0.0f;
+ m_channelComponentCount = 0;
clearData();
}
diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp
index 3cfa81446..b4cc04323 100644
--- a/src/animation/backend/buildblendtreesjob.cpp
+++ b/src/animation/backend/buildblendtreesjob.cpp
@@ -50,8 +50,9 @@ namespace Animation {
BuildBlendTreesJob::BuildBlendTreesJob()
: Qt3DCore::QAspectJob()
+ , m_handler(nullptr)
{
- SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0);
+ SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0)
}
void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles)
diff --git a/src/animation/backend/channelmapping.cpp b/src/animation/backend/channelmapping.cpp
index 83e7322da..42942fdd3 100644
--- a/src/animation/backend/channelmapping.cpp
+++ b/src/animation/backend/channelmapping.cpp
@@ -106,9 +106,9 @@ void ChannelMapping::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firs
const QCallbackMapping *callbackMapping = qobject_cast<const QCallbackMapping *>(frontEnd);
if (callbackMapping) {
m_mappingType = ChannelMappingType;
- m_channelName = channelMapping->channelName();
+ m_channelName = callbackMapping->channelName();
- const QCallbackMappingPrivate *d = static_cast<const QCallbackMappingPrivate *>(Qt3DCore::QNodePrivate::get(channelMapping));
+ const QCallbackMappingPrivate *d = static_cast<const QCallbackMappingPrivate *>(Qt3DCore::QNodePrivate::get(callbackMapping));
m_type = d->m_type;
m_callback = d->m_callback;
m_callbackFlags = d->m_callbackFlags;
diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp
index 9b6802d3b..765531902 100644
--- a/src/animation/backend/evaluateblendclipanimatorjob.cpp
+++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp
@@ -54,6 +54,7 @@ namespace Animation {
EvaluateBlendClipAnimatorJob::EvaluateBlendClipAnimatorJob()
: AbstractEvaluateClipAnimatorJob()
+ , m_handler(nullptr)
{
SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateBlendClipAnimator, 0)
}
diff --git a/src/animation/backend/evaluateclipanimatorjob.cpp b/src/animation/backend/evaluateclipanimatorjob.cpp
index 7a568e829..914a38139 100644
--- a/src/animation/backend/evaluateclipanimatorjob.cpp
+++ b/src/animation/backend/evaluateclipanimatorjob.cpp
@@ -52,6 +52,7 @@ namespace Animation {
EvaluateClipAnimatorJob::EvaluateClipAnimatorJob()
: AbstractEvaluateClipAnimatorJob()
+ , m_handler(nullptr)
{
SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateClipAnimator, 0)
}
diff --git a/src/animation/backend/findrunningclipanimatorsjob.cpp b/src/animation/backend/findrunningclipanimatorsjob.cpp
index fde3f7db8..1005914c7 100644
--- a/src/animation/backend/findrunningclipanimatorsjob.cpp
+++ b/src/animation/backend/findrunningclipanimatorsjob.cpp
@@ -48,8 +48,9 @@ namespace Animation {
FindRunningClipAnimatorsJob::FindRunningClipAnimatorsJob()
: Qt3DCore::QAspectJob()
+ , m_handler(nullptr)
{
- SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0);
+ SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0)
}
void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<HClipAnimator> &clipAnimatorHandles)
diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp
index 977564c7f..93d4c2d9d 100644
--- a/src/animation/backend/loadanimationclipjob.cpp
+++ b/src/animation/backend/loadanimationclipjob.cpp
@@ -64,6 +64,7 @@ public:
LoadAnimationClipJob::LoadAnimationClipJob()
: Qt3DCore::QAspectJob(*new LoadAnimationClipJobPrivate)
, m_animationClipHandles()
+ , m_handler(nullptr)
{
SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0)
}
diff --git a/src/animation/frontend/qabstractchannelmapping.cpp b/src/animation/frontend/qabstractchannelmapping.cpp
index 3249e6876..599ec6ed7 100644
--- a/src/animation/frontend/qabstractchannelmapping.cpp
+++ b/src/animation/frontend/qabstractchannelmapping.cpp
@@ -46,6 +46,7 @@ namespace Qt3DAnimation {
QAbstractChannelMappingPrivate::QAbstractChannelMappingPrivate()
: Qt3DCore::QNodePrivate()
+ , m_mappingType(QChannelMappingCreatedChangeBase::ChannelMapping)
{
}
diff --git a/src/animation/frontend/qvertexblendanimation.cpp b/src/animation/frontend/qvertexblendanimation.cpp
index 25468d4a7..143b9553a 100644
--- a/src/animation/frontend/qvertexblendanimation.cpp
+++ b/src/animation/frontend/qvertexblendanimation.cpp
@@ -192,8 +192,8 @@ void QVertexBlendAnimationPrivate::updateAnimation(float position)
Qt3DRender::QGeometry *geometry = m_target->geometry();
// remove attributes from previous frame
- if ((m_currentBase && (base != m_currentBase))
- || (m_currentTarget && (target != m_currentTarget))) {
+ if (m_currentBase && m_currentTarget &&
+ (base != m_currentBase || target != m_currentTarget)) {
const QVector<Qt3DRender::QAttribute *> baseAttributes = m_currentBase->attributeList();
const QVector<Qt3DRender::QAttribute *> targetAttributes = m_currentTarget->attributeList();
for (int i = 0; i < baseAttributes.size(); ++i) {