From 3ab712824e721d77805c56e20fac3b3a13a0af73 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:48:57 +0000 Subject: [PATCH] [XAM] Maintain usage of constant XUserIndexAny --- src/xenia/kernel/xam/profile_manager.cc | 4 ++-- src/xenia/kernel/xam/profile_manager.h | 2 +- src/xenia/kernel/xam/xam_ui.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xenia/kernel/xam/profile_manager.cc b/src/xenia/kernel/xam/profile_manager.cc index 1ca6b954c..e533af58a 100644 --- a/src/xenia/kernel/xam/profile_manager.cc +++ b/src/xenia/kernel/xam/profile_manager.cc @@ -393,7 +393,7 @@ uint8_t ProfileManager::FindFirstFreeProfileSlot() const { return i; } } - return -1; + return XUserIndexAny; } std::bitset ProfileManager::GetUsedUserSlots() const { @@ -422,7 +422,7 @@ uint8_t ProfileManager::GetUserIndexAssignedToProfile( return index; } - return -1; + return XUserIndexAny; } std::filesystem::path ProfileManager::GetProfileContentPath( diff --git a/src/xenia/kernel/xam/profile_manager.h b/src/xenia/kernel/xam/profile_manager.h index 75e26184b..8be96b596 100644 --- a/src/xenia/kernel/xam/profile_manager.h +++ b/src/xenia/kernel/xam/profile_manager.h @@ -89,7 +89,7 @@ class ProfileManager { bool MountProfile(const uint64_t xuid); bool DismountProfile(const uint64_t xuid); - void Login(const uint64_t xuid, const uint8_t user_index = -1, + void Login(const uint64_t xuid, const uint8_t user_index = XUserIndexAny, bool notify = true); void Logout(const uint8_t user_index, bool notify = true); void LoginMultiple(const std::map& profiles); diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index 73c45ea16..d17e7b86c 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -1251,7 +1251,7 @@ class SigninDialog : public XamDialog { uint64_t xuid = elem.first; uint8_t slot = profile_manager->GetUserIndexAssignedToProfile(xuid); for (uint32_t j = 0; j < users_needed_; j++) { - if (chosen_slots_[j] != 0xFF && slot == chosen_slots_[j]) { + if (chosen_slots_[j] != XUserIndexAny && slot == chosen_slots_[j]) { chosen_xuids_[j] = xuid; } }