Issue #1925 - Convert NS_SIDE_TO_FULL_CORNER to a constexpr function.

This commit is contained in:
Moonchild 2024-08-02 10:36:07 +02:00 committed by roytam1
commit 2a399b60a1
3 changed files with 13 additions and 5 deletions

View file

@ -380,10 +380,10 @@ CASE(eCornerBottomLeft, false, eCornerBottomLeftX);
CASE(eCornerBottomLeft, true, eCornerBottomLeftY);
#undef CASE
// Validation of NS_SIDE_TO_{FULL,HALF}_CORNER.
// Validation of SideToFullCorner.
#define CASE(side, second, result) \
static_assert(NS_SIDE_TO_FULL_CORNER(side, second) == result, \
"NS_SIDE_TO_FULL_CORNER is wrong")
static_assert(SideToFullCorner(side, second) == result, \
"SideToFullCorner is wrong")
CASE(eSideTop, false, eCornerTopLeft);
CASE(eSideTop, true, eCornerTopRight);