Core/IOS/ES: Make use of fmt::format where applicable
Eliminates a deprecation warnings on macOS. While we're in the same area, we can remove the call to GetPointer() and instead use CopyToEmu() to copy the string data back to the emulated memory.
This commit is contained in:
parent
715a551dac
commit
04822d5a2c
|
@ -9,6 +9,8 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "Common/ChunkFile.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Common/EnumUtils.h"
|
#include "Common/EnumUtils.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
|
@ -218,10 +220,11 @@ IPCReply ESDevice::GetTitleDirectory(const IOCtlVRequest& request)
|
||||||
auto& memory = system.GetMemory();
|
auto& memory = system.GetMemory();
|
||||||
|
|
||||||
const u64 title_id = memory.Read_U64(request.in_vectors[0].address);
|
const u64 title_id = memory.Read_U64(request.in_vectors[0].address);
|
||||||
|
const auto path = fmt::format("/title/{:08x}/{:08x}/data", static_cast<u32>(title_id >> 32),
|
||||||
|
static_cast<u32>(title_id));
|
||||||
|
|
||||||
char* path = reinterpret_cast<char*>(memory.GetPointer(request.io_vectors[0].address));
|
const auto path_dst = request.io_vectors[0].address;
|
||||||
sprintf(path, "/title/%08x/%08x/data", static_cast<u32>(title_id >> 32),
|
memory.CopyToEmu(path_dst, path.data(), path.size());
|
||||||
static_cast<u32>(title_id));
|
|
||||||
|
|
||||||
INFO_LOG_FMT(IOS_ES, "IOCTL_ES_GETTITLEDIR: {}", path);
|
INFO_LOG_FMT(IOS_ES, "IOCTL_ES_GETTITLEDIR: {}", path);
|
||||||
return IPCReply(IPC_SUCCESS);
|
return IPCReply(IPC_SUCCESS);
|
||||||
|
|
Loading…
Reference in New Issue