EnumUtils: Add Common::ToUnderlying

Mirrors the C++23 <utility> function, std::to_underlying
This commit is contained in:
get
2023-06-17 00:08:07 -05:00
parent 5029924ba1
commit 07ad75f34f
22 changed files with 118 additions and 78 deletions

View File

@ -12,6 +12,7 @@
#include <fmt/format.h>
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
@ -132,7 +133,8 @@ std::string DSPDisassembler::DisassembleParameters(const DSPOPCTemplate& opc, u1
break;
default:
ERROR_LOG_FMT(DSPLLE, "Unknown parameter type: {:x}", static_cast<u32>(opc.params[j].type));
ERROR_LOG_FMT(DSPLLE, "Unknown parameter type: {:x}",
Common::ToUnderlying(opc.params[j].type));
break;
}
}

View File

@ -6,6 +6,7 @@
#include <cstddef>
#include "Common/Assert.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Core/DSP/DSPCore.h"
@ -366,38 +367,38 @@ void DSPJitRegCache::FlushRegs()
}
ASSERT_MSG(DSPLLE, m_xregs[RSP].guest_reg == DSP_REG_STATIC, "wrong xreg state for {}",
static_cast<u32>(RSP));
Common::ToUnderlying(RSP));
ASSERT_MSG(DSPLLE, m_xregs[RBX].guest_reg == DSP_REG_STATIC, "wrong xreg state for {}",
static_cast<u32>(RBX));
Common::ToUnderlying(RBX));
ASSERT_MSG(DSPLLE, m_xregs[RBP].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(RBP));
Common::ToUnderlying(RBP));
ASSERT_MSG(DSPLLE, m_xregs[RSI].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(RSI));
Common::ToUnderlying(RSI));
ASSERT_MSG(DSPLLE, m_xregs[RDI].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(RDI));
Common::ToUnderlying(RDI));
#ifdef STATIC_REG_ACCS
ASSERT_MSG(DSPLLE, m_xregs[R8].guest_reg == DSP_REG_STATIC, "wrong xreg state for {}",
static_cast<u32>(R8));
Common::ToUnderlying(R8));
ASSERT_MSG(DSPLLE, m_xregs[R9].guest_reg == DSP_REG_STATIC, "wrong xreg state for {}",
static_cast<u32>(R9));
Common::ToUnderlying(R9));
#else
ASSERT_MSG(DSPLLE, m_xregs[R8].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R8));
Common::ToUnderlying(R8));
ASSERT_MSG(DSPLLE, m_xregs[R9].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R9));
Common::ToUnderlying(R9));
#endif
ASSERT_MSG(DSPLLE, m_xregs[R10].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R10));
Common::ToUnderlying(R10));
ASSERT_MSG(DSPLLE, m_xregs[R11].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R11));
Common::ToUnderlying(R11));
ASSERT_MSG(DSPLLE, m_xregs[R12].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R12));
Common::ToUnderlying(R12));
ASSERT_MSG(DSPLLE, m_xregs[R13].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R13));
Common::ToUnderlying(R13));
ASSERT_MSG(DSPLLE, m_xregs[R14].guest_reg == DSP_REG_NONE, "wrong xreg state for {}",
static_cast<u32>(R14));
Common::ToUnderlying(R14));
ASSERT_MSG(DSPLLE, m_xregs[R15].guest_reg == DSP_REG_STATIC, "wrong xreg state for {}",
static_cast<u32>(R15));
Common::ToUnderlying(R15));
m_use_ctr = 0;
}
@ -984,14 +985,14 @@ void DSPJitRegCache::SpillXReg(X64Reg reg)
{
ASSERT_MSG(DSPLLE, !m_regs[m_xregs[reg].guest_reg].used,
"to be spilled host reg {:#x} (guest reg {:#x}) still in use!",
static_cast<u32>(reg), m_xregs[reg].guest_reg);
Common::ToUnderlying(reg), m_xregs[reg].guest_reg);
MovToMemory(m_xregs[reg].guest_reg);
}
else
{
ASSERT_MSG(DSPLLE, m_xregs[reg].guest_reg == DSP_REG_NONE,
"to be spilled host reg {:#x} still in use!", static_cast<u32>(reg));
"to be spilled host reg {:#x} still in use!", Common::ToUnderlying(reg));
}
}
@ -1036,7 +1037,7 @@ void DSPJitRegCache::GetXReg(X64Reg reg)
{
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
{
ERROR_LOG_FMT(DSPLLE, "Trying to get statically used XReg {}", static_cast<u32>(reg));
ERROR_LOG_FMT(DSPLLE, "Trying to get statically used XReg {}", Common::ToUnderlying(reg));
return;
}
@ -1052,7 +1053,7 @@ void DSPJitRegCache::PutXReg(X64Reg reg)
{
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
{
ERROR_LOG_FMT(DSPLLE, "Trying to put statically used XReg {}", static_cast<u32>(reg));
ERROR_LOG_FMT(DSPLLE, "Trying to put statically used XReg {}", Common::ToUnderlying(reg));
return;
}

View File

@ -10,6 +10,7 @@
#include "Common/BitUtils.h"
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
@ -210,7 +211,7 @@ void Wiimote::HandleExtensionSwap(ExtensionNumber desired_extension_number,
else
{
INFO_LOG_FMT(WIIMOTE, "Switching to Extension {} (Wiimote {} in slot {})",
static_cast<u8>(desired_extension_number), m_index, m_bt_device_index);
Common::ToUnderlying(desired_extension_number), m_index, m_bt_device_index);
m_active_extension = desired_extension_number;
}

View File

@ -10,6 +10,7 @@
#include <vector>
#include "Common/ChunkFile.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/NandPaths.h"
@ -92,7 +93,7 @@ ESCore::ESCore(Kernel& ios) : m_ios(ios)
if (result != FS::ResultCode::Success && result != FS::ResultCode::AlreadyExists)
{
ERROR_LOG_FMT(IOS_ES, "Failed to create {}: error {}", directory.path,
static_cast<s32>(FS::ConvertResult(result)));
Common::ToUnderlying(FS::ConvertResult(result)));
}
// Now update the UID/GID and other attributes.
@ -1101,7 +1102,7 @@ ReturnCode ESCore::VerifyContainer(VerifyContainerType type, VerifyMode mode,
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifyContainer: IOSC_ImportCertificate(ca) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -1116,7 +1117,7 @@ ReturnCode ESCore::VerifyContainer(VerifyContainerType type, VerifyMode mode,
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifyContainer: IOSC_ImportCertificate(issuer) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -1126,7 +1127,7 @@ ReturnCode ESCore::VerifyContainer(VerifyContainerType type, VerifyMode mode,
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifyContainer: IOSC_VerifyPublicKeySign failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -1136,13 +1137,13 @@ ReturnCode ESCore::VerifyContainer(VerifyContainerType type, VerifyMode mode,
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifyContainer: Writing the issuer cert failed with return code {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
}
ret = WriteNewCertToStore(ca_cert);
if (ret != IPC_SUCCESS)
ERROR_LOG_FMT(IOS_ES, "VerifyContainer: Writing the CA cert failed with return code {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
}
if (ret == IPC_SUCCESS && issuer_handle_out)

View File

@ -7,6 +7,7 @@
#include "Common/Crypto/SHA1.h"
#include "Common/Crypto/ec.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/ScopeGuard.h"
#include "Common/StringUtil.h"
@ -162,7 +163,7 @@ ReturnCode ESCore::VerifySign(const std::vector<u8>& hash, const std::vector<u8>
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifySign: VerifyContainer(ng) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -170,7 +171,7 @@ ReturnCode ESCore::VerifySign(const std::vector<u8>& hash, const std::vector<u8>
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifySign: IOSC_VerifyPublicKeySign(ap) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -184,7 +185,7 @@ ReturnCode ESCore::VerifySign(const std::vector<u8>& hash, const std::vector<u8>
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifySign: IOSC_ImportPublicKey(ap) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}
@ -193,7 +194,7 @@ ReturnCode ESCore::VerifySign(const std::vector<u8>& hash, const std::vector<u8>
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "VerifySign: IOSC_VerifyPublicKeySign(data) failed with error {}",
static_cast<s32>(ret));
Common::ToUnderlying(ret));
return ret;
}

View File

@ -12,6 +12,7 @@
#include "Common/Align.h"
#include "Common/Crypto/SHA1.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/NandPaths.h"
#include "Core/CommonTitles.h"
@ -72,7 +73,7 @@ ReturnCode ESCore::ImportTicket(const std::vector<u8>& ticket_bytes,
if (ret < 0)
{
ERROR_LOG_FMT(IOS_ES, "ImportTicket: Failed to unpersonalise ticket for {:016x} ({})",
ticket.GetTitleId(), static_cast<s32>(ret));
ticket.GetTitleId(), Common::ToUnderlying(ret));
return ret;
}
}
@ -160,7 +161,8 @@ ReturnCode ESCore::ImportTmd(Context& context, const std::vector<u8>& tmd_bytes,
context.title_import_export.tmd, cert_store);
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "ImportTmd: VerifyContainer failed with error {}", static_cast<s32>(ret));
ERROR_LOG_FMT(IOS_ES, "ImportTmd: VerifyContainer failed with error {}",
Common::ToUnderlying(ret));
return ret;
}
@ -174,7 +176,8 @@ ReturnCode ESCore::ImportTmd(Context& context, const std::vector<u8>& tmd_bytes,
&context.title_import_export.key_handle);
if (ret != IPC_SUCCESS)
{
ERROR_LOG_FMT(IOS_ES, "ImportTmd: InitBackupKey failed with error {}", static_cast<s32>(ret));
ERROR_LOG_FMT(IOS_ES, "ImportTmd: InitBackupKey failed with error {}",
Common::ToUnderlying(ret));
return ret;
}

View File

@ -10,6 +10,7 @@
#include <fmt/format.h>
#include "Common/ChunkFile.h"
#include "Common/EnumUtils.h"
#include "Common/StringUtil.h"
#include "Common/Swap.h"
#include "Core/HW/Memmap.h"
@ -119,7 +120,7 @@ static void LogResult(ResultCode code, fmt::format_string<Args...> format, Args&
code == ResultCode::Success ? Common::Log::LogLevel::LINFO : Common::Log::LogLevel::LERROR;
GENERIC_LOG_FMT(Common::Log::LogType::IOS_FS, type, "Command: {}: Result {}", command,
static_cast<s32>(ConvertResult(code)));
Common::ToUnderlying(ConvertResult(code)));
}
template <typename T, typename... Args>

View File

@ -14,6 +14,7 @@
#include "Common/Assert.h"
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/Timer.h"
@ -652,8 +653,8 @@ std::shared_ptr<Device> EmulationKernel::GetDeviceByName(std::string_view device
std::optional<IPCReply> EmulationKernel::OpenDevice(OpenRequest& request)
{
const s32 new_fd = GetFreeDeviceID();
INFO_LOG_FMT(IOS, "Opening {} (mode {}, fd {})", request.path, static_cast<u32>(request.flags),
new_fd);
INFO_LOG_FMT(IOS, "Opening {} (mode {}, fd {})", request.path,
Common::ToUnderlying(request.flags), new_fd);
if (new_fd < 0 || new_fd >= IPC_MAX_FDS)
{
ERROR_LOG_FMT(IOS, "Couldn't get a free fd, too many open files");
@ -731,7 +732,7 @@ std::optional<IPCReply> EmulationKernel::HandleIPCCommand(const Request& request
ret = device->IOCtlV(IOCtlVRequest{GetSystem(), request.address});
break;
default:
ASSERT_MSG(IOS, false, "Unexpected command: {:#x}", static_cast<u32>(request.command));
ASSERT_MSG(IOS, false, "Unexpected command: {:#x}", Common::ToUnderlying(request.command));
ret = IPCReply{IPC_EINVAL, 978_tbticks};
break;
}

View File

@ -17,6 +17,7 @@
// clang-format on
#include "Common/Align.h"
#include "Common/EnumUtils.h"
#include "Common/FatFsUtil.h"
#include "Common/Logging/Log.h"
#include "Common/ScopeGuard.h"
@ -211,7 +212,7 @@ static ErrorCode WriteFile(const std::string& filename, const std::vector<u8>& t
if (write_error_code != FR_OK)
{
ERROR_LOG_FMT(IOS_WC24, "Failed to write file {} to VFF: {}", filename,
static_cast<u32>(write_error_code));
Common::ToUnderlying(write_error_code));
return WC24_ERR_FILE_WRITE;
}

View File

@ -52,6 +52,7 @@ typedef struct pollfd pollfd_t;
#include <utility>
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h"
#include "Core/IOS/IOS.h"
@ -289,7 +290,7 @@ public:
if (socket_entry == WiiSockets.end())
{
ERROR_LOG_FMT(IOS_NET, "DoSock: Error, fd not found ({:08x}, {:08X}, {:08X})", sock,
request.address, static_cast<u32>(type));
request.address, Common::ToUnderlying(type));
GetIOS()->EnqueueIPCReply(request, -SO_EBADF);
}
else

View File

@ -19,6 +19,7 @@
#include <libusb.h>
#include "Common/ChunkFile.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/Network.h"
@ -683,7 +684,7 @@ void BluetoothRealDevice::HandleCtrlTransfer(libusb_transfer* tr)
if (tr->status != LIBUSB_TRANSFER_COMPLETED && tr->status != LIBUSB_TRANSFER_NO_DEVICE)
{
ERROR_LOG_FMT(IOS_WIIMOTE, "libusb command transfer failed, status: {:#04x}",
static_cast<u32>(tr->status));
Common::ToUnderlying(tr->status));
if (!m_showed_failed_transfer.IsSet())
{
Core::DisplayMessage("Failed to send a command to the Bluetooth adapter.", 10000);
@ -712,7 +713,7 @@ void BluetoothRealDevice::HandleBulkOrIntrTransfer(libusb_transfer* tr)
tr->status != LIBUSB_TRANSFER_NO_DEVICE)
{
ERROR_LOG_FMT(IOS_WIIMOTE, "libusb transfer failed, status: {:#04x}",
static_cast<u32>(tr->status));
Common::ToUnderlying(tr->status));
if (!m_showed_failed_transfer.IsSet())
{
Core::DisplayMessage("Failed to transfer to or from to the Bluetooth adapter.", 10000);

View File

@ -12,6 +12,7 @@
#include "Common/CommonTypes.h"
#include "Common/Crypto/AES.h"
#include "Common/EnumUtils.h"
#include "Common/FileUtil.h"
#include "Common/IOFile.h"
#include "Common/Logging/Log.h"
@ -143,7 +144,7 @@ std::optional<IPCReply> WFSIDevice::IOCtl(const IOCtlRequest& request)
m_continue_install = memory.Read_U32(request.buffer_in + 36);
INFO_LOG_FMT(IOS_WFS, "IOCTL_WFSI_IMPORT_TITLE_INIT: patch type {}, continue install: {}",
static_cast<u32>(m_patch_type), m_continue_install ? "true" : "false");
Common::ToUnderlying(m_patch_type), m_continue_install ? "true" : "false");
if (m_patch_type == PatchType::PATCH_TYPE_2)
{

View File

@ -12,6 +12,7 @@
#include "Common/Assert.h"
#include "Common/BitSet.h"
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/MsgHandler.h"
#include "Common/VariantUtil.h"
#include "Common/x64Emitter.h"
@ -389,7 +390,7 @@ void RegCache::Discard(BitSet32 pregs)
for (preg_t i : pregs)
{
ASSERT_MSG(DYNA_REC, !m_regs[i].IsLocked(), "Someone forgot to unlock PPC reg {} (X64 reg {}).",
i, static_cast<u32>(RX(i)));
i, Common::ToUnderlying(RX(i)));
ASSERT_MSG(DYNA_REC, !m_regs[i].IsRevertable(), "Register transaction is in progress for {}!",
i);
@ -413,7 +414,7 @@ void RegCache::Flush(BitSet32 pregs)
for (preg_t i : pregs)
{
ASSERT_MSG(DYNA_REC, !m_regs[i].IsLocked(), "Someone forgot to unlock PPC reg {} (X64 reg {}).",
i, static_cast<u32>(RX(i)));
i, Common::ToUnderlying(RX(i)));
ASSERT_MSG(DYNA_REC, !m_regs[i].IsRevertable(), "Register transaction is in progress for {}!",
i);
@ -497,7 +498,8 @@ BitSet32 RegCache::RegistersInUse() const
void RegCache::FlushX(X64Reg reg)
{
ASSERT_MSG(DYNA_REC, reg < m_xregs.size(), "Flushing non-existent reg {}", static_cast<u32>(reg));
ASSERT_MSG(DYNA_REC, reg < m_xregs.size(), "Flushing non-existent reg {}",
Common::ToUnderlying(reg));
ASSERT(!m_xregs[reg].IsLocked());
if (!m_xregs[reg].IsFree())
{
@ -521,7 +523,7 @@ void RegCache::BindToRegister(preg_t i, bool doLoad, bool makeDirty)
{
X64Reg xr = GetFreeXReg();
ASSERT_MSG(DYNA_REC, !m_xregs[xr].IsDirty(), "Xreg {} already dirty", static_cast<u32>(xr));
ASSERT_MSG(DYNA_REC, !m_xregs[xr].IsDirty(), "Xreg {} already dirty", Common::ToUnderlying(xr));
ASSERT_MSG(DYNA_REC, !m_xregs[xr].IsLocked(), "GetFreeXReg returned locked register");
ASSERT_MSG(DYNA_REC, !m_regs[i].IsRevertable(), "Invalid transaction state");
@ -538,7 +540,7 @@ void RegCache::BindToRegister(preg_t i, bool doLoad, bool makeDirty)
[xr](const auto& r) {
return r.Location().has_value() && r.Location()->IsSimpleReg(xr);
}),
"Xreg {} already bound", static_cast<u32>(xr));
"Xreg {} already bound", Common::ToUnderlying(xr));
m_regs[i].SetBoundTo(xr);
}
@ -551,7 +553,7 @@ void RegCache::BindToRegister(preg_t i, bool doLoad, bool makeDirty)
}
ASSERT_MSG(DYNA_REC, !m_xregs[RX(i)].IsLocked(),
"WTF, this reg ({} -> {}) should have been flushed", i, static_cast<u32>(RX(i)));
"WTF, this reg ({} -> {}) should have been flushed", i, Common::ToUnderlying(RX(i)));
}
void RegCache::StoreFromRegister(preg_t i, FlushMode mode)

View File

@ -7,6 +7,7 @@
#include "Common/CPUDetect.h"
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/FloatUtils.h"
#include "Common/Intrinsics.h"
#include "Common/JitRegister.h"
@ -370,7 +371,7 @@ const u8* CommonAsmRoutines::GenQuantizedStoreRuntime(bool single, EQuantizeType
GenQuantizedStore(single, type, -1);
RET();
Common::JitRegister::Register(start, GetCodePtr(), "JIT_QuantizedStore_{}_{}",
static_cast<u32>(type), single);
Common::ToUnderlying(type), single);
return load;
}
@ -402,7 +403,7 @@ const u8* CommonAsmRoutines::GenQuantizedLoadRuntime(bool single, EQuantizeType
GenQuantizedLoad(single, type, -1);
RET();
Common::JitRegister::Register(start, GetCodePtr(), "JIT_QuantizedLoad_{}_{}",
static_cast<u32>(type), single);
Common::ToUnderlying(type), single);
return load;
}

View File

@ -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;
}