mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
AK: Silence -Wimplicit-const-int-float-conversion in clamp_to_int
This commit is contained in:
parent
871485cc0d
commit
f87a488b22
Notes:
sideshowbarker
2024-07-17 00:27:16 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/f87a488b22 Pull-request: https://github.com/SerenityOS/serenity/pull/20209
@ -1017,10 +1017,10 @@ constexpr T pow(T x, T y)
|
||||
template<typename T>
|
||||
constexpr int clamp_to_int(T value)
|
||||
{
|
||||
if (value >= NumericLimits<int>::max())
|
||||
if (value >= static_cast<T>(NumericLimits<int>::max()))
|
||||
return NumericLimits<int>::max();
|
||||
|
||||
if (value <= NumericLimits<int>::min())
|
||||
if (value <= static_cast<T>(NumericLimits<int>::min()))
|
||||
return NumericLimits<int>::min();
|
||||
|
||||
if constexpr (IsFloatingPoint<T>)
|
||||
|
Loading…
Reference in New Issue
Block a user