Kaydet (Commit) 8f408fd5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

salhelper: Let C++ inline functions return bool instead of sal_Bool

...to improve diagnosing misuses of boolean expressions in client code (cf.
compilerplugins/clang/implicitboolconversion.cxx).  This change should be
transparent to client code.

Change-Id: I2c7779ad07daa77ae06709c1f6512f2fa25fcd36
üst e2e5b749
...@@ -182,7 +182,7 @@ public: ...@@ -182,7 +182,7 @@ public:
} }
/// checks if the loader works on a loaded and initialized library. /// checks if the loader works on a loaded and initialized library.
sal_Bool SAL_CALL isLoaded() const SAL_THROW(()) bool SAL_CALL isLoaded() const SAL_THROW(())
{ {
return (m_pLoader != NULL); return (m_pLoader != NULL);
} }
......
...@@ -89,33 +89,33 @@ struct TTimeValue : public TimeValue ...@@ -89,33 +89,33 @@ struct TTimeValue : public TimeValue
normalize(); normalize();
} }
sal_Bool SAL_CALL isEmpty() const bool SAL_CALL isEmpty() const
{ {
return ( ( Seconds == 0 ) && ( Nanosec == 0 ) ); return ( ( Seconds == 0 ) && ( Nanosec == 0 ) );
} }
}; };
inline sal_Bool operator<( const TTimeValue& rTimeA, const TTimeValue& rTimeB ) inline bool operator<( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
{ {
if ( rTimeA.Seconds < rTimeB.Seconds ) if ( rTimeA.Seconds < rTimeB.Seconds )
return sal_True; return true;
else if ( rTimeA.Seconds > rTimeB.Seconds ) else if ( rTimeA.Seconds > rTimeB.Seconds )
return sal_False; return false;
else else
return ( rTimeA.Nanosec < rTimeB.Nanosec ); return ( rTimeA.Nanosec < rTimeB.Nanosec );
} }
inline sal_Bool operator>( const TTimeValue& rTimeA, const TTimeValue& rTimeB ) inline bool operator>( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
{ {
if ( rTimeA.Seconds > rTimeB.Seconds ) if ( rTimeA.Seconds > rTimeB.Seconds )
return sal_True; return true;
else if ( rTimeA.Seconds < rTimeB.Seconds ) else if ( rTimeA.Seconds < rTimeB.Seconds )
return sal_False; return false;
else else
return ( rTimeA.Nanosec > rTimeB.Nanosec ); return ( rTimeA.Nanosec > rTimeB.Nanosec );
} }
inline sal_Bool operator==( const TTimeValue& rTimeA, const TTimeValue& rTimeB ) inline bool operator==( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
{ {
return ( ( rTimeA.Seconds == rTimeB.Seconds ) && return ( ( rTimeA.Seconds == rTimeB.Seconds ) &&
( rTimeA.Nanosec == rTimeB.Nanosec ) ); ( rTimeA.Nanosec == rTimeB.Nanosec ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment