From b6d3c0c6eeb27f9a40dfe229b3faff2f2999c299 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Sat, 14 Mar 2026 07:27:39 +1100 Subject: [PATCH] Use integer locator sizes in XUI scenes --- Minecraft.Client/Platform/Common/XUI/XUI_DLCOffers.cpp | 2 +- Minecraft.Client/Platform/Common/XUI/XUI_DebugOverlay.cpp | 4 ++-- Minecraft.Client/Platform/Common/XUI/XUI_MainMenu.cpp | 4 ++-- .../Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_DLCOffers.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_DLCOffers.cpp index 79d64a674..956457fa1 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_DLCOffers.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_DLCOffers.cpp @@ -262,7 +262,7 @@ HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) CXuiCtrl4JList::LIST_ITEM_INFO *pListInfo=NULL; //XMARKETPLACE_CONTENTOFFER_INFO xOffer; XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO xOffer; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; ZeroMemory(szResourceLocator,sizeof(WCHAR)*LOCATOR_SIZE); const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_DebugOverlay.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_DebugOverlay.cpp index 6764fb23f..9a321290f 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_DebugOverlay.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_DebugOverlay.cpp @@ -171,7 +171,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress HXUIOBJ hScene; HRESULT hr; //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); @@ -189,7 +189,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress HXUIOBJ hScene; HRESULT hr; //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MainMenu.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MainMenu.cpp index 03643d023..2423a7a72 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MainMenu.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MainMenu.cpp @@ -68,7 +68,7 @@ HRESULT CScene_Main::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) CXuiSceneBase::ShowBackground( DEFAULT_XUI_MENU_USER, TRUE ); CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE ); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; // load from the .xzp file @@ -1291,4 +1291,4 @@ HRESULT CScene_Main::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) } return S_OK; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp index 0b1cb7633..5bf3db581 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -48,7 +48,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand XuiControlSetText(m_SavesList,app.GetString(IDS_START_GAME)); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); @@ -2700,7 +2700,7 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave else { // we could put in a damaged save icon here - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + constexpr int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);