From c8ca5050cf8c908e49d28eda5642542f7ac1155b Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 1 Dec 2023 16:29:33 +1100 Subject: Remove gcc Wconversion warnings from header. --- src/Geometry.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Geometry.h') diff --git a/src/Geometry.h b/src/Geometry.h index 28f2f022d..a9daa5516 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -173,7 +173,7 @@ PRectangle PixelAlignOutside(const PRectangle &rc, int pixelDivisions) noexcept; constexpr float componentMaximum = 255.0F; constexpr unsigned int maximumByte = 0xffU; class ColourRGBA { - static constexpr float ComponentAsFloat(unsigned int component) { + static constexpr float ComponentAsFloat(unsigned char component) { return component / componentMaximum; } static constexpr int rgbMask = 0xffffff; @@ -195,7 +195,8 @@ public: } static constexpr ColourRGBA FromIpRGB(intptr_t co_) noexcept { - return ColourRGBA((co_ & rgbMask) | (maximumByte << 24)); + const int rgb = co_ & rgbMask; + return ColourRGBA(rgb | (maximumByte << 24)); } constexpr ColourRGBA WithoutAlpha() const noexcept { -- cgit v1.2.3