summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-10-18 20:54:45 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-10-18 20:55:01 -0500
commit4b71bb35a7c04fef4ed86591d8892a29c4150c0b (patch)
treef5e030a04a2d01329b127b27928fd0ef66858b2a
parentb564162dbdc2c17673e08b4f799e09add190e9ed (diff)
work around windows whining
Change-Id: If2922bca25c93edc25e1171001def8ce3011cf4c
-rw-r--r--tools/source/generic/rational.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/source/generic/rational.cxx b/tools/source/generic/rational.cxx
index 1f2fc14d5a00..f99bdfa94bb2 100644
--- a/tools/source/generic/rational.cxx
+++ b/tools/source/generic/rational.cxx
@@ -128,10 +128,11 @@ void rational_ReduceInaccurate(boost::rational<sal_Int64>& rRational, unsigned n
DBG_ASSERT(nSignificantBits<65, "More than 64 bit of significance is overkill!");
// How much bits can we lose?
- const int nMulBitsToLose = std::max( ( impl_NumberOfBits( nMul ) - int( nSignificantBits ) ), 0 );
- const int nDivBitsToLose = std::max( ( impl_NumberOfBits( nDiv ) - int( nSignificantBits ) ), 0 );
+ const int nMulBitsToLose = impl_NumberOfBits( nMul ) - int( nSignificantBits );
+ const int nDivBitsToLose = impl_NumberOfBits( nDiv ) - int( nSignificantBits );
- const int nToLose = std::min( nMulBitsToLose, nDivBitsToLose );
+ int nToLose = nMulBitsToLose < nDivBitsToLose ? nMulBitsToLose : nDivBitsToLose;
+ nToLose = nToLose < 0 ? 0 : nToLose;
// Remove the bits
nMul >>= nToLose;