From a25fa1cb0266bb8461323b5d856c3c979d538114 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 19 Mar 2015 20:24:39 +0200 Subject: 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 --- include/vcl/salbtype.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/vcl') 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(mcBlueOrIndex) * 28UL + static_cast(mcGreen) * 151UL + static_cast(mcRed) * 77UL) >> 8; } inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc ) -- cgit