From 1ca7e41fa8e300d0f5b8e0427ea3e6cad27ce175 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 24 Feb 2020 11:02:04 +0100 Subject: workaround GCC 9.2.1 -Og -Werror=maybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vcl/unx/generic/gdi/salbmp.cxx:727:32: error: ‘pixmapHandle’ may be used uninitialized in this function [-Werror=maybe-uninitialized] vcl/unx/gtk3/gtk3gtkinst.cxx:7336:16: error: ‘eRet’ may be used uninitialized in this function [-Werror=maybe-uninitialized] etc. One looks like it might occur in practice. Change-Id: I09af7d36b134b31cb7bd8047b5c73f4a49c9d9b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89351 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sd/source/filter/eppt/pptx-animations.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sd') diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index f809b6222484..0badff184841 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -101,8 +101,8 @@ void WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n return; } - sal_uInt32 nRgb; - double fDouble; + sal_Int32 nRgb = {}; // spurious -Werror=maybe-uninitialized + double fDouble = {}; // spurious -Werror=maybe-uninitialized TypeClass aClass = rAny.getValueType().getTypeClass(); bool bWriteToken @@ -115,11 +115,17 @@ void WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n switch (rAny.getValueType().getTypeClass()) { case TypeClass_LONG: - rAny >>= nRgb; + if (!(rAny >>= nRgb)) + { + assert(false); + } pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nRgb)); break; case TypeClass_DOUBLE: - rAny >>= fDouble; + if (!(rAny >>= fDouble)) + { + assert(false); + } pFS->singleElementNS(XML_p, XML_fltVal, XML_val, OString::number(fDouble)); break; case TypeClass_STRING: -- cgit