diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-03-19 20:24:39 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-03-19 20:34:31 +0200 |
commit | a25fa1cb0266bb8461323b5d856c3c979d538114 (patch) | |
tree | dcdd7d4fed35a93ac7282946d5e005b081f43cd5 /include | |
parent | 33d2475d9f2f01308ba4675ac99aaabb43870e0f (diff) |
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 33d2475d9f2f01308ba4675ac99aaabb43870e0f
Change-Id: I799cce13e9bebf1a375243c294c4fa8788502ec6
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/salbtype.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index 40dfd8f8ba17..d5bbc7310ac4 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -406,7 +406,7 @@ inline BitmapColor& BitmapColor::Invert() inline sal_uInt8 BitmapColor::GetLuminance() const { 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 ) |