From 06fc72ca0cf3bda925d4dfc8dbcea9e952c4a2af Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Jan 2022 21:29:30 -0700 Subject: [PATCH] AK: Fix warnings when using FixedPoint with a precision >= 32 bits --- AK/FixedPoint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AK/FixedPoint.h b/AK/FixedPoint.h index 91d05af7df..dbb268caf8 100644 --- a/AK/FixedPoint.h +++ b/AK/FixedPoint.h @@ -18,19 +18,19 @@ namespace AK { template class FixedPoint { using This = FixedPoint; - constexpr static Underlying radix_mask = (1 << precision) - 1; + constexpr static Underlying radix_mask = (static_cast(1) << precision) - 1; public: constexpr FixedPoint() = default; template constexpr FixedPoint(I value) - : m_value(value << precision) + : m_value(static_cast(value) << precision) { } template constexpr FixedPoint(F value) - : m_value(static_cast(value * (1u << precision))) + : m_value(static_cast(value * (static_cast(1) << precision))) { }