diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-25 15:26:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-25 16:47:46 +0200 |
commit | ff87ef83edf77ba0a9bf11bb8e5306e3b8c7cb04 (patch) | |
tree | 763d41b8f0a7d82eab2d79aca4bb339a1185b9cc | |
parent | 0bbc397dc5b4440144627330c2b6ee479bdcf074 (diff) |
-Werror=maybe-uninitialized
which only shows up in an optimised build, using gcc
Change-Id: I16015c7d139680aba11bf183c3e2bceb79c9ecba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101330
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | slideshow/source/engine/animationnodes/animationphysicsnode.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/animationexport.cxx | 2 |
3 files changed, 7 insertions, 15 deletions
diff --git a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx index 3c7c227f2d0c..c750d333322a 100644 --- a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx +++ b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx @@ -41,39 +41,31 @@ AnimationActivitySharedPtr AnimationPhysicsNode::createActivity() const "Couldn't get the animation duration."); ::css::uno::Any aTemp; - double fStartVelocityX; + double fStartVelocityX = fDefaultStartVelocityX; aTemp = mxPhysicsMotionNode->getStartVelocityX(); if (aTemp.hasValue()) aTemp >>= fStartVelocityX; - else - fStartVelocityX = fDefaultStartVelocityX; - double fStartVelocityY; + double fStartVelocityY = fDefaultStartVelocityY; aTemp = mxPhysicsMotionNode->getStartVelocityY(); if (aTemp.hasValue()) aTemp >>= fStartVelocityY; - else - fStartVelocityY = fDefaultStartVelocityY; - double fDensity; + double fDensity = fDefaultDensity; aTemp = mxPhysicsMotionNode->getDensity(); if (aTemp.hasValue()) { aTemp >>= fDensity; fDensity = (fDensity < 0.0) ? 0.0 : fDensity; } - else - fDensity = fDefaultDensity; - double fBounciness; + double fBounciness = fDefaultBounciness; aTemp = mxPhysicsMotionNode->getBounciness(); if (aTemp.hasValue()) { aTemp >>= fBounciness; fBounciness = std::clamp(fBounciness, 0.0, 1.0); } - else - fBounciness = fDefaultBounciness; ActivitiesFactory::CommonParameters const aParms(fillCommonParameters()); return ActivitiesFactory::createSimpleActivity( diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 19cffc2640c3..c6e557a69275 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8981,7 +8981,7 @@ public: virtual void set_alignment(TxtAlign eXAlign) override { - gfloat xalign; + gfloat xalign = 0; switch (eXAlign) { case TxtAlign::Left: @@ -12879,7 +12879,7 @@ public: virtual void set_alignment(TxtAlign eXAlign) override { - GtkJustification eJust; + GtkJustification eJust = GTK_JUSTIFY_LEFT; switch (eXAlign) { case TxtAlign::Left: diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index c130f5a45919..af0ea3828eb1 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1246,7 +1246,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat case AnimationNodeType::ANIMATEPHYSICS: { eElementToken = XML_ANIMATEPHYSICS; - double fTemp; + double fTemp = 0; Reference< XAnimatePhysics > xAnimatePhysics( xAnimate, UNO_QUERY_THROW ); aTemp = xAnimatePhysics->getStartVelocityX(); |