Issue #1925 - Convert NS_FULL_TO_HALF_CORNER to a constexpr function.

Note: Because the new function checks types, we need to change the
fullCorner type in `nsComputedDOMStyle::GetEllipseRadii()` and
`StyleAnimationValue::ExtractComputedValue()` to `Corner` instead of the
underlying base type.
This commit is contained in:
Moonchild 2024-08-02 10:15:50 +02:00 committed by roytam1
commit 8a2bc8ef4d
7 changed files with 28 additions and 25 deletions

View file

@ -20,8 +20,6 @@ namespace mozilla {
// nsStyleCoord.cpp.
// Arguments must not have side effects.
#define NS_FULL_TO_HALF_CORNER(var_, vert_) ((var_)*2 + !!(vert_))
#define NS_SIDE_IS_VERTICAL(side_) ((side_) % 2)
#define NS_SIDE_TO_FULL_CORNER(side_, second_) \
(((side_) + !!(second_)) % 4)