diff options
author | Neil <nyamatongwe@gmail.com> | 2023-01-09 13:32:44 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-01-09 13:32:44 +1100 |
commit | f1b8ae2bc9ebcd534052fc1b81a10f24bf0630f6 (patch) | |
tree | 67f2daf3a4ae1bd33242ef8de7e3d66c25e10d37 /src/Geometry.h | |
parent | e4328d24681689a7fd0cb876a5fdd94ffd84f5f9 (diff) | |
download | scintilla-mirror-f1b8ae2bc9ebcd534052fc1b81a10f24bf0630f6.tar.gz |
Use unsigned literal and temporary to stop conversion warnings for each includer.
Diffstat (limited to 'src/Geometry.h')
-rw-r--r-- | src/Geometry.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Geometry.h b/src/Geometry.h index 4fd90afad..354f3ea25 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -200,16 +200,18 @@ public: // Red, green and blue values as bytes 0..255 constexpr unsigned char GetRed() const noexcept { - return co & 0xff; + return co & 0xffU; } constexpr unsigned char GetGreen() const noexcept { - return (co >> 8) & 0xff; + return (co >> 8) & 0xffU; } constexpr unsigned char GetBlue() const noexcept { - return (co >> 16) & 0xff; + return (co >> 16) & 0xffU; } constexpr unsigned char GetAlpha() const noexcept { - return (co >> 24) & 0xff; + // Use a temporary here to prevent a 'Wconversion' warning from GCC + const int shifted = co >> 24; + return shifted & 0xffU; } // Red, green, blue, and alpha values as float 0..1.0 |