summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-28 15:20:48 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-29 09:49:48 +0000
commitd36ca60964cf20b738ead1020c41c2f586a16660 (patch)
treebafad47f21da450089d2ea79446d551c5bdf65de /extensions
parentsw ui: de-obfuscate assignments in conditions to help GCC (diff)
downloadcore-d36ca60964cf20b738ead1020c41c2f586a16660.tar.gz
core-d36ca60964cf20b738ead1020c41c2f586a16660.zip
extensions,sc,sd,vcl: de-obfuscate assignments in conditions to help GCC
GCC 6.2.1 with -Og produces spurious -Werror=maybe-uninitialized on variables that are assigned in conditions; perhaps it's better to de-obfuscate the code if even GCC is confused about it. Change-Id: Ia2f8209df893a8e5659ca72f4cde3d7d847574e1 Reviewed-on: https://gerrit.libreoffice.org/31332 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/scanner/sanedlg.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 1bf9ffa1978e..cea597cb109b 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -1470,8 +1470,10 @@ bool SaneDlg::SetAdjustedNumericalValue(
double fValue,
int nElement )
{
- int nOption;
- if( ! Sane::IsSane() || ! mrSane.IsOpen() || ( nOption = mrSane.GetOptionByName( pOption ) ) == -1 )
+ if (! Sane::IsSane() || ! mrSane.IsOpen())
+ return false;
+ int const nOption(mrSane.GetOptionByName(pOption));
+ if (nOption == -1)
return false;
if( nElement < 0 || nElement >= mrSane.GetOptionElements( nOption ) )