From 31cd51ab911d0edf10bbac98c58d8d2881686683 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 1 May 2026 21:43:33 -0700
Subject: [PATCH] Fixed deprecated-enum-enum-conversion warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bitwise operation between different enumeration types ‘AnchorLocation’ and ‘’ is deprecated [-Wdeprecated-enum-enum-conversion
Closes https://github.com/libsdl-org/Maelstrom/pull/61
---
screenlib/UIArea.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/screenlib/UIArea.cpp b/screenlib/UIArea.cpp
index 433600ed..73dbdfbb 100644
--- a/screenlib/UIArea.cpp
+++ b/screenlib/UIArea.cpp
@@ -330,7 +330,7 @@ UIArea::SetAnchorElement(UIArea *anchor)
void
UIArea::GetAnchorLocation(AnchorLocation spot, int *x, int *y) const
{
- switch (spot & X_MASK) {
+ switch ((int)spot & X_MASK) {
case X_LEFT:
*x = m_rect.x;
break;
@@ -343,7 +343,7 @@ UIArea::GetAnchorLocation(AnchorLocation spot, int *x, int *y) const
default:
assert(0);
}
- switch (spot & Y_MASK) {
+ switch ((int)spot & Y_MASK) {
case Y_TOP:
*y = m_rect.y;
break;
@@ -368,7 +368,7 @@ UIArea::CalculateAnchor(bool triggerRectChanged)
}
m_anchor.element->GetAnchorLocation(m_anchor.anchorTo, &x, &y);
- switch (m_anchor.anchorFrom & X_MASK) {
+ switch ((int)m_anchor.anchorFrom & X_MASK) {
case X_CENTER:
x -= Width() / 2;
break;
@@ -378,7 +378,7 @@ UIArea::CalculateAnchor(bool triggerRectChanged)
default:
break;
}
- switch (m_anchor.anchorFrom & Y_MASK) {
+ switch ((int)m_anchor.anchorFrom & Y_MASK) {
case Y_CENTER:
y -= Height() / 2;
break;