EnumUtils: Add Common::ToUnderlying
Mirrors the C++23 <utility> function, std::to_underlying
This commit is contained in:
1 parent
5029924ba1
commit
07ad75f34f
22 files changed
+118
-78
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "Common/Align.h"
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/EnumUtils.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/HttpRequest.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
@@ -76,7 +77,7 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
|
||||
if (ret != IOS::HLE::IOSC_FAIL_CHECKVALUE)
|
||||
{
|
||||
PanicAlertFmtT("WAD installation failed: Could not initialise title import (error {0}).",
|
||||
static_cast<u32>(ret));
|
||||
Common::ToUnderlying(ret));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -548,7 +549,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||
auto& es = m_ios.GetESCore();
|
||||
if ((ret = es.ImportTicket(ticket.first, ticket.second)) < 0)
|
||||
{
|
||||
ERROR_LOG_FMT(CORE, "Failed to import ticket: error {}", static_cast<u32>(ret));
|
||||
ERROR_LOG_FMT(CORE, "Failed to import ticket: error {}", Common::ToUnderlying(ret));
|
||||
return UpdateResult::ImportFailed;
|
||||
}
|
||||
|
||||
@@ -580,7 +581,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||
IOS::HLE::ESCore::Context context;
|
||||
if ((ret = es.ImportTitleInit(context, tmd.first.GetBytes(), tmd.second)) < 0)
|
||||
{
|
||||
ERROR_LOG_FMT(CORE, "Failed to initialise title import: error {}", static_cast<u32>(ret));
|
||||
ERROR_LOG_FMT(CORE, "Failed to initialise title import: error {}", Common::ToUnderlying(ret));
|
||||
return UpdateResult::ImportFailed;
|
||||
}
|
||||
|
||||
@@ -601,7 +602,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||
if ((ret = es.ImportContentBegin(context, title.id, content.id)) < 0)
|
||||
{
|
||||
ERROR_LOG_FMT(CORE, "Failed to initialise import for content {:08x}: error {}", content.id,
|
||||
static_cast<u32>(ret));
|
||||
Common::ToUnderlying(ret));
|
||||
return UpdateResult::ImportFailed;
|
||||
}
|
||||
|
||||
@@ -626,7 +627,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||
if ((all_contents_imported && (ret = es.ImportTitleDone(context)) < 0) ||
|
||||
(!all_contents_imported && (ret = es.ImportTitleCancel(context)) < 0))
|
||||
{
|
||||
ERROR_LOG_FMT(CORE, "Failed to finalise title import: error {}", static_cast<u32>(ret));
|
||||
ERROR_LOG_FMT(CORE, "Failed to finalise title import: error {}", Common::ToUnderlying(ret));
|
||||
return UpdateResult::ImportFailed;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user