From 7ff7c9e84fa485503c39be22a3562cebb4d3d42a Mon Sep 17 00:00:00 2001
From: Dentomologist <dentomologist@gmail.com>
Date: Tue, 13 Jun 2023 13:22:56 -0700
Subject: [PATCH] Common: Convert FromWhichRoot to enum class

---
 Source/Core/Common/NandPaths.cpp     | 2 +-
 Source/Core/Common/NandPaths.h       | 6 +++---
 Source/Core/Core/Movie.cpp           | 4 ++--
 Source/Core/Core/WiiRoot.cpp         | 2 +-
 Source/Core/Core/WiiUtils.cpp        | 6 +++---
 Source/Core/DiscIO/WiiSaveBanner.cpp | 2 +-
 Source/Core/UICommon/GameFile.cpp    | 2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp
index 9b08cd263d..a69ccfe9b5 100644
--- a/Source/Core/Common/NandPaths.cpp
+++ b/Source/Core/Common/NandPaths.cpp
@@ -18,7 +18,7 @@ namespace Common
 {
 std::string RootUserPath(FromWhichRoot from)
 {
-  int idx = from == FROM_CONFIGURED_ROOT ? D_WIIROOT_IDX : D_SESSION_WIIROOT_IDX;
+  int idx = from == FromWhichRoot::Configured ? D_WIIROOT_IDX : D_SESSION_WIIROOT_IDX;
   std::string dir = File::GetUserPath(idx);
   dir.pop_back();  // remove trailing path separator
   return dir;
diff --git a/Source/Core/Common/NandPaths.h b/Source/Core/Common/NandPaths.h
index 01bd8aa3ed..dd27b904b6 100644
--- a/Source/Core/Common/NandPaths.h
+++ b/Source/Core/Common/NandPaths.h
@@ -10,10 +10,10 @@
 
 namespace Common
 {
-enum FromWhichRoot
+enum class FromWhichRoot
 {
-  FROM_CONFIGURED_ROOT,  // not related to currently running game - use D_WIIROOT_IDX
-  FROM_SESSION_ROOT,     // request from currently running game - use D_SESSION_WIIROOT_IDX
+  Configured,  // not related to currently running game - use D_WIIROOT_IDX
+  Session,     // request from currently running game - use D_SESSION_WIIROOT_IDX
 };
 
 std::string RootUserPath(FromWhichRoot from);
diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp
index 3218959978..152f5617b2 100644
--- a/Source/Core/Core/Movie.cpp
+++ b/Source/Core/Core/Movie.cpp
@@ -1473,8 +1473,8 @@ void GetSettings()
   if (SConfig::GetInstance().bWii)
   {
     u64 title_id = SConfig::GetInstance().GetTitleID();
-    s_bClearSave = !File::Exists(Common::GetTitleDataPath(title_id, Common::FROM_SESSION_ROOT) +
-                                 "/banner.bin");
+    s_bClearSave = !File::Exists(
+        Common::GetTitleDataPath(title_id, Common::FromWhichRoot::Session) + "/banner.bin");
   }
   else
   {
diff --git a/Source/Core/Core/WiiRoot.cpp b/Source/Core/Core/WiiRoot.cpp
index ef56bcb397..94024d63ea 100644
--- a/Source/Core/Core/WiiRoot.cpp
+++ b/Source/Core/Core/WiiRoot.cpp
@@ -356,7 +356,7 @@ void InitializeWiiFileSystemContents(
       File::CreateDirs(save_redirect->m_target_path);
       if (save_redirect->m_clone)
       {
-        File::Copy(Common::GetTitleDataPath(title_id, Common::FROM_SESSION_ROOT),
+        File::Copy(Common::GetTitleDataPath(title_id, Common::FromWhichRoot::Session),
                    save_redirect->m_target_path);
       }
     }
diff --git a/Source/Core/Core/WiiUtils.cpp b/Source/Core/Core/WiiUtils.cpp
index 5e36e13cfd..a28cc469d7 100644
--- a/Source/Core/Core/WiiUtils.cpp
+++ b/Source/Core/Core/WiiUtils.cpp
@@ -870,7 +870,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
 
   // Check for NANDs that were used with old Dolphin versions.
   const std::string sys_replace_path =
-      Common::RootUserPath(Common::FROM_CONFIGURED_ROOT) + "/sys/replace";
+      Common::RootUserPath(Common::FromWhichRoot::Configured) + "/sys/replace";
   if (File::Exists(sys_replace_path))
   {
     ERROR_LOG_FMT(CORE,
@@ -882,7 +882,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
   }
 
   // Clean up after a bug fixed in https://github.com/dolphin-emu/dolphin/pull/8802
-  const std::string rfl_db_path = Common::GetMiiDatabasePath(Common::FROM_CONFIGURED_ROOT);
+  const std::string rfl_db_path = Common::GetMiiDatabasePath(Common::FromWhichRoot::Configured);
   const File::FileInfo rfl_db(rfl_db_path);
   if (rfl_db.Exists() && rfl_db.GetSize() == 0)
   {
@@ -895,7 +895,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
 
   for (const u64 title_id : es.GetInstalledTitles())
   {
-    const std::string title_dir = Common::GetTitlePath(title_id, Common::FROM_CONFIGURED_ROOT);
+    const std::string title_dir = Common::GetTitlePath(title_id, Common::FromWhichRoot::Configured);
     const std::string content_dir = title_dir + "/content";
     const std::string data_dir = title_dir + "/data";
 
diff --git a/Source/Core/DiscIO/WiiSaveBanner.cpp b/Source/Core/DiscIO/WiiSaveBanner.cpp
index 7c2bdbca5b..91350fb030 100644
--- a/Source/Core/DiscIO/WiiSaveBanner.cpp
+++ b/Source/Core/DiscIO/WiiSaveBanner.cpp
@@ -24,7 +24,7 @@ constexpr u32 ICON_HEIGHT = 48;
 constexpr u32 ICON_SIZE = ICON_WIDTH * ICON_HEIGHT * 2;
 
 WiiSaveBanner::WiiSaveBanner(u64 title_id)
-    : WiiSaveBanner(Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT) +
+    : WiiSaveBanner(Common::GetTitleDataPath(title_id, Common::FromWhichRoot::Configured) +
                     "/banner.bin")
 {
 }
diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp
index 4ee251b2ab..2d467e8110 100644
--- a/Source/Core/UICommon/GameFile.cpp
+++ b/Source/Core/UICommon/GameFile.cpp
@@ -731,7 +731,7 @@ GameFile::CompareSyncIdentifier(const NetPlay::SyncIdentifier& sync_identifier)
 std::string GameFile::GetWiiFSPath() const
 {
   ASSERT(DiscIO::IsWii(m_platform));
-  return Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT);
+  return Common::GetTitleDataPath(m_title_id, Common::FromWhichRoot::Configured);
 }
 
 bool GameFile::ShouldShowFileFormatDetails() const