From 3a153f32e31a295ee7e5f97b47bc8889160cee53 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 1 Aug 2024 18:58:14 +0200 Subject: [PATCH] Issue #1925 - Change Side's operator++ from postfix to prefix. The postfix operator++ was actually incorrectly implemented (the implementation is a prefix version). Since it's only used in the adjacent macro, there's no risk with this change to correct that. --- gfx/2d/Types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index 63545946c2..6fb9d955db 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -397,9 +397,9 @@ enum SideBits { for (mozilla::Side var_; \ MOZ_CONCAT(var_,__LINE__) <= mozilla::eSideLeft && \ ((var_ = mozilla::Side(MOZ_CONCAT(var_,__LINE__))), true); \ - MOZ_CONCAT(var_,__LINE__)++) + ++MOZ_CONCAT(var_,__LINE__)) -static inline Side operator++(Side& side, int) { +static inline Side& operator++(Side& side) { MOZ_ASSERT(side >= eSideTop && side <= eSideLeft, "Out of range side"); side = Side(side + 1);