Kaydet (Commit) a25fa1cb authored tarafından Tor Lillqvist's avatar Tor Lillqvist

MSVC and gcc are wrong, Clang was right, apparently

The 'unsigned int(expression)' syntax is *not* correct, says
http://en.cppreference.com/w/cpp/language/explicit_cast, but
apparently MSVC and gcc don't mind. Clang doesn't like it, though.
Re-introduce kendy's change but use static_cast instead of functional
cast.

This reverts commit 33d2475d

Change-Id: I799cce13e9bebf1a375243c294c4fa8788502ec6
üst 33d2475d
...@@ -406,7 +406,7 @@ inline BitmapColor& BitmapColor::Invert() ...@@ -406,7 +406,7 @@ inline BitmapColor& BitmapColor::Invert()
inline sal_uInt8 BitmapColor::GetLuminance() const inline sal_uInt8 BitmapColor::GetLuminance() const
{ {
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) ); return (static_cast<unsigned long>(mcBlueOrIndex) * 28UL + static_cast<unsigned long>(mcGreen) * 151UL + static_cast<unsigned long>(mcRed) * 77UL) >> 8;
} }
inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc ) inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )
......
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