diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-06-21 10:34:21 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-06-21 11:09:36 +0300 |
commit | 81e3ca4f60e6ac0823c1233841c22a759cfe937f (patch) | |
tree | 5071e261fad972737b11f3cfd981f986334ae468 /include/vcl/salbtype.hxx | |
parent | 406e39fad66c6f4b0f589dcc682c57464b230d69 (diff) |
Use real assert() instead of DBG_ASSERT()
These assertions guard important invariants. We use real assert() also
in the neighbouring bitmapaccess.hxx, for instance.
Drop annoying exclamation marks.
Change-Id: I9d08cb80b18e8f3a922357ec33c1418f8f1b33e6
Diffstat (limited to 'include/vcl/salbtype.hxx')
-rw-r--r-- | include/vcl/salbtype.hxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index 7238e02197f8..b7137704888a 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -332,55 +332,55 @@ inline bool BitmapColor::IsIndex() const inline sal_uInt8 BitmapColor::GetRed() const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); return mcRed; } inline void BitmapColor::SetRed( sal_uInt8 cRed ) { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); mcRed = cRed; } inline sal_uInt8 BitmapColor::GetGreen() const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); return mcGreen; } inline void BitmapColor::SetGreen( sal_uInt8 cGreen ) { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); mcGreen = cGreen; } inline sal_uInt8 BitmapColor::GetBlue() const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); return mcBlueOrIndex; } inline void BitmapColor::SetBlue( sal_uInt8 cBlue ) { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); mcBlueOrIndex = cBlue; } inline sal_uInt8 BitmapColor::GetIndex() const { - DBG_ASSERT( mbIndex, "Pixel represents color values!" ); + assert( mbIndex && "Pixel represents color values" ); return mcBlueOrIndex; } inline void BitmapColor::SetIndex( sal_uInt8 cIndex ) { - DBG_ASSERT( mbIndex, "Pixel represents color values!" ); + assert( mbIndex && "Pixel represents color values" ); mcBlueOrIndex = cIndex; } inline BitmapColor::operator Color() const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); return Color( mcRed, mcGreen, mcBlueOrIndex ); } @@ -392,7 +392,7 @@ inline sal_uInt8 BitmapColor::GetBlueOrIndex() const inline BitmapColor& BitmapColor::Invert() { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); mcBlueOrIndex = ~mcBlueOrIndex; mcGreen = ~mcGreen; mcRed = ~mcRed; @@ -402,15 +402,15 @@ inline BitmapColor& BitmapColor::Invert() inline sal_uInt8 BitmapColor::GetLuminance() const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); return (static_cast<unsigned long>(mcBlueOrIndex) * 28UL + static_cast<unsigned long>(mcGreen) * 151UL + static_cast<unsigned long>(mcRed) * 77UL) >> 8; } inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uInt8 cTransparency ) { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); - DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); + assert( !rBitmapColor.mbIndex && "Pixel represents index into colortable" ); mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, rBitmapColor.mcBlueOrIndex, cTransparency ); mcGreen = COLOR_CHANNEL_MERGE( mcGreen, rBitmapColor.mcGreen, cTransparency ); mcRed = COLOR_CHANNEL_MERGE( mcRed, rBitmapColor.mcRed, cTransparency ); @@ -421,8 +421,8 @@ inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uIn inline sal_uInt16 BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const { - DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); - DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" ); + assert( !mbIndex && "Pixel represents index into colortable" ); + assert( !rBitmapColor.mbIndex && "Pixel represents index into colortable" ); return static_cast<sal_uInt16>( abs( static_cast<int>(mcBlueOrIndex) - static_cast<int>(rBitmapColor.mcBlueOrIndex) ) + abs( static_cast<int>(mcGreen) - static_cast<int>(rBitmapColor.mcGreen) ) + @@ -544,19 +544,19 @@ inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount ) inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const { - DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" ); + assert( nIndex < mnCount && "Palette index is out of range" ); return mpBitmapColor[ nIndex ]; } inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) { - DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" ); + assert( nIndex < mnCount && "Palette index is out of range" ); return mpBitmapColor[ nIndex ]; } inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const { - DBG_ASSERT( mpBitmapColor, "No color buffer available!" ); + assert( mpBitmapColor && "No color buffer available" ); return mpBitmapColor; } |