summaryrefslogtreecommitdiff
path: root/sccomp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-05-16 10:16:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-05-17 08:22:14 +0200
commit7ab34b51f2d45137191145d31b4b0c7d18f577bf (patch)
treeabb760e86740a0e073008047d966af250e8c8c5d /sccomp
parentf8e3ad02737854686a590f7f8f02eb72e03a0f8e (diff)
loplugin:redundantcast improvements for floating-integer conversions
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016 Reviewed-on: https://gerrit.libreoffice.org/54416 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sccomp')
-rw-r--r--sccomp/source/solver/SwarmSolver.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sccomp/source/solver/SwarmSolver.cxx b/sccomp/source/solver/SwarmSolver.cxx
index dab7b648b8c0..2a549fb0e0a8 100644
--- a/sccomp/source/solver/SwarmSolver.cxx
+++ b/sccomp/source/solver/SwarmSolver.cxx
@@ -30,6 +30,7 @@
#include <comphelper/propertycontainer.hxx>
#include <comphelper/proparrhlp.hxx>
+#include <cmath>
#include <vector>
#include <limits>
#include <chrono>
@@ -370,7 +371,7 @@ double SwarmSolver::clampVariable(size_t nVarIndex, double fValue)
double fResult = std::max(std::min(fValue, rBound.upper), rBound.lower);
if (mbInteger)
- return sal_Int64(fResult);
+ return std::trunc(fResult);
return fResult;
}
@@ -389,7 +390,7 @@ double SwarmSolver::boundVariable(size_t nVarIndex, double fValue)
}
if (mbInteger)
- return sal_Int64(fResult);
+ return std::trunc(fResult);
return fResult;
}