From 97be72453b4f943deb6bbb0dffcf31675ce8b7bf Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sun, 3 May 2020 13:46:23 +0200 Subject: [PATCH] more C++11 specifier --- src/common/QskRgbValue.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 9f194610..e6ebbe89 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -448,10 +448,9 @@ namespace QskRgbValue return toTransparent( QColor( color ), alpha ); } - inline QRgb toTransparent( QRgb rgb, int alpha = 0 ) + inline constexpr QRgb toTransparent( QRgb rgb, int alpha = 0 ) noexcept { - const auto alphaU = static_cast< uint >( alpha ); - return ( rgb & ColorMask ) | ( ( alphaU & 0xffu ) << 24 ); + return ( rgb & ColorMask ) | ( ( static_cast< uint >( alpha ) & 0xffu ) << 24 ); } }