From 5a8d6332394fb227166f1ed8772d0f6633a6c0bb Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 7 Dec 2017 17:28:23 +0100 Subject: [PATCH] satisfying clang pedantic checks --- src/controls/QskRgbValue.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controls/QskRgbValue.h b/src/controls/QskRgbValue.h index e525502c..558a0dc9 100644 --- a/src/controls/QskRgbValue.h +++ b/src/controls/QskRgbValue.h @@ -439,7 +439,8 @@ QSK_RGB_VALUES inline QColor toTransparent( const QColor& c1, int alpha = 0 ) { - return QColor::fromRgba( ( c1.rgb() & ColorMask ) | ( ( alpha & 0xffu ) << 24 ) ); + const auto alphaU = static_cast< uint >( alpha ); + return QColor::fromRgba( ( c1.rgb() & ColorMask ) | ( ( alphaU & 0xffu ) << 24 ) ); } inline QColor toTransparent( Qt::GlobalColor color, int alpha = 0 ) @@ -449,7 +450,8 @@ QSK_RGB_VALUES inline QRgb toTransparent( QRgb rgb, int alpha = 0 ) { - return ( rgb & ColorMask ) | ( ( alpha & 0xffu ) << 24 ); + const auto alphaU = static_cast< uint >( alpha ); + return ( rgb & ColorMask ) | ( ( alphaU & 0xffu ) << 24 ); } }