[Libreoffice-commits] .: tools/inc tools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Dec 17 13:34:16 PST 2010
tools/inc/tools/fract.hxx | 38 +++++++++++++-------------------------
tools/source/generic/fract.cxx | 6 +++---
2 files changed, 16 insertions(+), 28 deletions(-)
New commits:
commit 89fab65cfc582cfd6e8a800d9cd98b25adaee7ca
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 17 19:48:00 2010 +0000
WaE: C4805: Unsafe mix of bool and BOOL
diff --git a/tools/inc/tools/fract.hxx b/tools/inc/tools/fract.hxx
index 41fe89a..f839d6e 100644
--- a/tools/inc/tools/fract.hxx
+++ b/tools/inc/tools/fract.hxx
@@ -49,7 +49,7 @@ public:
Fraction( long nN1, long nN2, long nD1, long nD2 );
Fraction( double dVal );
- BOOL IsValid() const;
+ bool IsValid() const;
long GetNumerator() const { return nNumerator; }
long GetDenominator() const { return nDenominator; }
@@ -65,31 +65,19 @@ public:
Fraction& operator/=( const Fraction& rfrFrac );
void ReduceInaccurate( unsigned nSignificantBits );
-#ifdef __BORLANDC__
- friend Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 );
- friend Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 );
- friend Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 );
- friend Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 );
-
- friend BOOL operator==( const Fraction& rVal1, const Fraction& rVal2 );
- friend BOOL operator!=( const Fraction& rVal1, const Fraction& rVal2 );
- friend BOOL operator< ( const Fraction& rVal1, const Fraction& rVal2 );
- friend BOOL operator> ( const Fraction& rVal1, const Fraction& rVal2 );
- friend BOOL operator<=( const Fraction& rVal1, const Fraction& rVal2 );
- friend BOOL operator>=( const Fraction& rVal1, const Fraction& rVal2 );
-#else
+
friend inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 );
friend inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 );
friend inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 );
friend inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 );
- TOOLS_DLLPUBLIC friend BOOL operator==( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline BOOL operator!=( const Fraction& rVal1, const Fraction& rVal2 );
- TOOLS_DLLPUBLIC friend BOOL operator< ( const Fraction& rVal1, const Fraction& rVal2 );
- TOOLS_DLLPUBLIC friend BOOL operator> ( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline BOOL operator<=( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline BOOL operator>=( const Fraction& rVal1, const Fraction& rVal2 );
-#endif
+ TOOLS_DLLPUBLIC friend bool operator==( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator!=( const Fraction& rVal1, const Fraction& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator< ( const Fraction& rVal1, const Fraction& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator> ( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator<=( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator>=( const Fraction& rVal1, const Fraction& rVal2 );
+
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Fraction& rFract );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Fraction& rFract );
};
@@ -107,7 +95,7 @@ inline Fraction& Fraction::operator=( const Fraction& rFrac )
return *this;
}
-inline BOOL Fraction::IsValid() const
+inline bool Fraction::IsValid() const
{
return (nDenominator > 0);
}
@@ -148,17 +136,17 @@ inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 )
return aErg;
}
-inline BOOL operator !=( const Fraction& rVal1, const Fraction& rVal2 )
+inline bool operator !=( const Fraction& rVal1, const Fraction& rVal2 )
{
return !(rVal1 == rVal2);
}
-inline BOOL operator <=( const Fraction& rVal1, const Fraction& rVal2 )
+inline bool operator <=( const Fraction& rVal1, const Fraction& rVal2 )
{
return !(rVal1 > rVal2);
}
-inline BOOL operator >=( const Fraction& rVal1, const Fraction& rVal2 )
+inline bool operator >=( const Fraction& rVal1, const Fraction& rVal2 )
{
return !(rVal1 < rVal2);
}
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index 290e566..20cab20 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -633,7 +633,7 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits )
|*
*************************************************************************/
-BOOL operator == ( const Fraction& rVal1, const Fraction& rVal2 )
+bool operator == ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
return FALSE;
@@ -659,7 +659,7 @@ BOOL operator == ( const Fraction& rVal1, const Fraction& rVal2 )
// und (c*b) zu vergleichen. Das Ergebnis dieses Vergleichs wird
// zurueckgegeben.
-BOOL operator < ( const Fraction& rVal1, const Fraction& rVal2 )
+bool operator < ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
return FALSE;
@@ -689,7 +689,7 @@ BOOL operator < ( const Fraction& rVal1, const Fraction& rVal2 )
// und (c*b) zu vergleichen. Das Ergebnis dieses Vergleichs wird
// zurueckgegeben.
-BOOL operator > ( const Fraction& rVal1, const Fraction& rVal2 )
+bool operator > ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
return FALSE;
More information about the Libreoffice-commits
mailing list