From 49999006ef85d28bc1f0010a390bd54cff5d9363 Mon Sep 17 00:00:00 2001 From: Samuel Kelemen Date: Thu, 6 May 2021 11:38:35 +0200 Subject: [PATCH] LibGfx: remove constexpr, add noexcept on interpolate method This removes `constexpr` from the interpolate method in Color.h and adds `noexcept`. The roundf call cannot be constexpr on clang. This is the only incompatibility preventing serenity from building under clang. I tested this on OSX Big Sur 11.3 and 11.3.1, and everything works with this change. --- Userland/Libraries/LibGfx/Color.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h index 5a0d490d8f..c505441759 100644 --- a/Userland/Libraries/LibGfx/Color.h +++ b/Userland/Libraries/LibGfx/Color.h @@ -149,7 +149,7 @@ public: #endif } - constexpr Color interpolate(const Color& other, float weight) const + Color interpolate(const Color& other, float weight) const noexcept { u8 r = red() + roundf(static_cast(other.red() - red()) * weight); u8 g = green() + roundf(static_cast(other.green() - green()) * weight);