From 79022090bf72577473ca0997ab9cf072e0fa4c70 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 3 Sep 2023 22:52:53 +0300 Subject: [PATCH] LibWeb: Add CSSPixels operator overloads for unsigned int Fixes building on 32-bit, where using operators with size_t (aka unsigned int) results in ambiguity between the overloads for int and unsigned long. --- Userland/Libraries/LibWeb/PixelUnits.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/PixelUnits.h b/Userland/Libraries/LibWeb/PixelUnits.h index 841dfe6137..89b89128c6 100644 --- a/Userland/Libraries/LibWeb/PixelUnits.h +++ b/Userland/Libraries/LibWeb/PixelUnits.h @@ -275,11 +275,13 @@ inline bool operator<(CSSPixels left, float right) { return left.to_float() < ri inline bool operator<(CSSPixels left, double right) { return left.to_double() < right; } constexpr CSSPixels operator*(CSSPixels left, int right) { return left * CSSPixels(right); } +constexpr CSSPixels operator*(CSSPixels left, unsigned int right) { return left * CSSPixels(right); } constexpr CSSPixels operator*(CSSPixels left, unsigned long right) { return left * CSSPixels(right); } inline float operator*(CSSPixels left, float right) { return left.to_float() * right; } inline double operator*(CSSPixels left, double right) { return left.to_double() * right; } constexpr CSSPixels operator*(int left, CSSPixels right) { return right * CSSPixels(left); } +constexpr CSSPixels operator*(unsigned int left, CSSPixels right) { return right * CSSPixels(left); } constexpr CSSPixels operator*(unsigned long left, CSSPixels right) { return right * CSSPixels(left); } inline float operator*(float left, CSSPixels right) { return right.to_float() * left; } inline double operator*(double left, CSSPixels right) { return right.to_double() * left; } @@ -372,6 +374,7 @@ constexpr CSSPixels CSSPixels::operator/(CSSPixelFraction const& other) const } constexpr CSSPixels operator/(CSSPixels left, int right) { return left / CSSPixels(right); } +constexpr CSSPixels operator/(CSSPixels left, unsigned int right) { return left / CSSPixels(right); } constexpr CSSPixels operator/(CSSPixels left, unsigned long right) { return left / CSSPixels(right); } inline float operator/(CSSPixels left, float right) { return left.to_float() / right; } inline double operator/(CSSPixels left, double right) { return left.to_double() / right; }