summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-10-23 17:22:06 +0200
committerJan Holesovsky <kendy@collabora.com>2014-10-23 18:34:34 +0200
commit858c2a2977d5e4671959724ecd2a453837dadddf (patch)
treea61e303e6e27cef015c50b38b23fc574ce64fcef /tools
parentff502f409fd73249a6a94c579d19905144aa5ba8 (diff)
Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"
This reverts commit 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e. Conflicts: svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
Diffstat (limited to 'tools')
-rw-r--r--tools/qa/cppunit/test_rational.cxx8
-rw-r--r--tools/source/generic/rational.cxx10
2 files changed, 9 insertions, 9 deletions
diff --git a/tools/qa/cppunit/test_rational.cxx b/tools/qa/cppunit/test_rational.cxx
index c58a8001f4f7..e503c1c5d38d 100644
--- a/tools/qa/cppunit/test_rational.cxx
+++ b/tools/qa/cppunit/test_rational.cxx
@@ -33,17 +33,17 @@ public:
void testReduceInaccurate()
{
- const boost::rational<sal_Int64> aFract(1082130431,1073741824);
+ const boost::rational<long> aFract(1082130431,1073741824);
CPPUNIT_ASSERT_MESSAGE( "Fraction #1 not approximately equal to 1.007812499068677",
rtl::math::approxEqual(boost::rational_cast<double>(aFract),1.007812499068677) );
- boost::rational<sal_Int64> aFract2( aFract );
+ boost::rational<long> aFract2( aFract );
rational_ReduceInaccurate(aFract2, 8);
CPPUNIT_ASSERT_MESSAGE( "Fraction #2 not 1",
aFract2.numerator() == 1 &&
aFract2.denominator() == 1 );
- boost::rational<sal_Int64> aFract3( 0x7AAAAAAA, 0x35555555 );
+ boost::rational<long> aFract3( 0x7AAAAAAA, 0x35555555 );
CPPUNIT_ASSERT_MESSAGE( "Fraction #3 cancellation wrong",
aFract3.numerator() == 0x7AAAAAAA &&
aFract3.denominator() == 0x35555555 );
@@ -73,7 +73,7 @@ public:
aFract3.denominator() == 1 );
#if SAL_TYPES_SIZEOFLONG == 8
- boost::rational<sal_Int64> aFract4(0x7AAAAAAAAAAAAAAA, 0x3555555555555555);
+ boost::rational<long> aFract4(0x7AAAAAAAAAAAAAAA, 0x3555555555555555);
CPPUNIT_ASSERT_MESSAGE( "Fraction #4 cancellation wrong",
aFract4.numerator() == 0x7AAAAAAAAAAAAAAA &&
aFract4.denominator() == 0x3555555555555555 );
diff --git a/tools/source/generic/rational.cxx b/tools/source/generic/rational.cxx
index f99bdfa94bb2..7edf4134952d 100644
--- a/tools/source/generic/rational.cxx
+++ b/tools/source/generic/rational.cxx
@@ -15,7 +15,7 @@
// If dVal > LONG_MAX or dVal < LONG_MIN, the rational throws a boost::bad_rational.
// Otherwise, dVal and denominator are multiplied with 10, until one of them
// is larger than (LONG_MAX / 10).
-boost::rational<sal_Int64> rational_FromDouble(double dVal)
+boost::rational<long> rational_FromDouble(double dVal)
{
long nDen = 1;
long nMAX = LONG_MAX / 10;
@@ -30,7 +30,7 @@ boost::rational<sal_Int64> rational_FromDouble(double dVal)
dVal *= 10;
nDen *= 10;
}
- return boost::rational<sal_Int64>((long) dVal, nDen);
+ return boost::rational<long>((long) dVal, nDen);
}
// Similar to clz_table that can be googled
@@ -114,7 +114,7 @@ static int impl_NumberOfBits( unsigned long nNum )
A ReduceInaccurate(8) yields 1/1.
*/
-void rational_ReduceInaccurate(boost::rational<sal_Int64>& rRational, unsigned nSignificantBits)
+void rational_ReduceInaccurate(boost::rational<long>& rRational, unsigned nSignificantBits)
{
if ( !rRational )
return;
@@ -148,7 +148,7 @@ void rational_ReduceInaccurate(boost::rational<sal_Int64>& rRational, unsigned n
rRational.assign( bNeg? -long( nMul ): long( nMul ), nDiv );
}
-SvStream& ReadFraction(SvStream& rIStream, boost::rational<sal_Int64>& rRational)
+SvStream& ReadFraction(SvStream& rIStream, boost::rational<long>& rRational)
{
sal_Int32 nTmpNumerator(0), nTmpDenominator(0);
rIStream.ReadInt32( nTmpNumerator );
@@ -162,7 +162,7 @@ SvStream& ReadFraction(SvStream& rIStream, boost::rational<sal_Int64>& rRational
return rIStream;
}
-SvStream& WriteFraction(SvStream& rOStream, const boost::rational<sal_Int64>& rRational)
+SvStream& WriteFraction(SvStream& rOStream, const boost::rational<long>& rRational)
{
//fdo#39428 SvStream no longer supports operator<<(long)
rOStream.WriteInt32( sal::static_int_cast<sal_Int32>(rRational.numerator()) );