From cb3ef488c7d75bf00b728e10cc14db5dd694ec99 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Tue, 28 Aug 2018 20:42:10 +0200 Subject: [PATCH] Fixup! string_util: Remove StringFromFormat() and related functions --- src/core/file_sys/archive_extsavedata.cpp | 7 +++---- src/core/file_sys/archive_source_sd_savedata.cpp | 6 +++--- src/core/file_sys/archive_systemsavedata.cpp | 4 ++-- src/core/hle/kernel/svc.cpp | 2 +- src/core/hle/service/am/am.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 830a363e2..48dae3e8f 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -166,15 +166,14 @@ std::string GetExtSaveDataPath(const std::string& mount_point, const Path& path) ExtSaveDataArchivePath path_data; std::memcpy(&path_data, vec_data.data(), sizeof(path_data)); - return fmt::format("{}{:08x}/{:08x}/", mount_point.c_str(), path_data.save_high, - path_data.save_low); + return fmt::format("{}{:08X}/{:08X}/", mount_point, path_data.save_high, path_data.save_low); } std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) { if (shared) - return fmt::format("{}data/{}/extdata/", mount_point.c_str(), SYSTEM_ID); + return fmt::format("{}data/{}/extdata/", mount_point, SYSTEM_ID); - return fmt::format("{}Nintendo 3DS/{}/{}/extdata/", mount_point.c_str(), SYSTEM_ID, SDCARD_ID); + return fmt::format("{}Nintendo 3DS/{}/{}/extdata/", mount_point, SYSTEM_ID, SDCARD_ID); } Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) { diff --git a/src/core/file_sys/archive_source_sd_savedata.cpp b/src/core/file_sys/archive_source_sd_savedata.cpp index b7fb549ff..b9e8895bb 100644 --- a/src/core/file_sys/archive_source_sd_savedata.cpp +++ b/src/core/file_sys/archive_source_sd_savedata.cpp @@ -19,19 +19,19 @@ namespace FileSys { namespace { std::string GetSaveDataContainerPath(const std::string& sdmc_directory) { - return fmt::format("{}Nintendo 3DS/{}/{}/title/", sdmc_directory.c_str(), SYSTEM_ID, SDCARD_ID); + return fmt::format("{}Nintendo 3DS/{}/{}/title/", sdmc_directory, SYSTEM_ID, SDCARD_ID); } std::string GetSaveDataPath(const std::string& mount_location, u64 program_id) { u32 high = static_cast(program_id >> 32); u32 low = static_cast(program_id & 0xFFFFFFFF); - return fmt::format("{}{:08x}/{:08x}/data/00000001/", mount_location.c_str(), high, low); + return fmt::format("{}{:08x}/{:08x}/data/00000001/", mount_location, high, low); } std::string GetSaveDataMetadataPath(const std::string& mount_location, u64 program_id) { u32 high = static_cast(program_id >> 32); u32 low = static_cast(program_id & 0xFFFFFFFF); - return fmt::format("{}{:08x}/{:08x}/data/00000001.metadata", mount_location.c_str(), high, low); + return fmt::format("{}{:08x}/{:08x}/data/00000001.metadata", mount_location, high, low); } } // namespace diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 322e98fa4..1e6a41166 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -26,11 +26,11 @@ std::string GetSystemSaveDataPath(const std::string& mount_point, const Path& pa u32 save_high; std::memcpy(&save_low, &vec_data[4], sizeof(u32)); std::memcpy(&save_high, &vec_data[0], sizeof(u32)); - return fmt::format("{}{:08X}/{:08X}/", mount_point.c_str(), save_low, save_high); + return fmt::format("{}{:08X}/{:08X}/", mount_point, save_low, save_high); } std::string GetSystemSaveDataContainerPath(const std::string& mount_point) { - return fmt::format("{}data/{}/sysdata/", mount_point.c_str(), SYSTEM_ID); + return fmt::format("{}data/{}/sysdata/", mount_point, SYSTEM_ID); } Path ConstructSystemSaveDataBinaryPath(u32 high, u32 low) { diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 3da279cea..c07e09b9a 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -724,7 +724,7 @@ static ResultCode GetResourceLimitLimitValues(VAddr values, Handle resource_limi /// Creates a new thread static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point, u32 arg, u32 stack_top, s32 processor_id) { - std::string name = fmt::format("unknown-{:08X}" PRIX32, entry_point); + std::string name = fmt::format("unknown-{:08X}", entry_point); if (priority > THREADPRIO_LOWEST) { return ERR_OUT_OF_RANGE; diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d6db9ae6a..beafb6e48 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -418,7 +418,7 @@ std::string GetTitleContentPath(Service::FS::MediaType media_type, u64 tid, u16 } } - return fmt::format("{}{:08x}.app", content_path.c_str(), content_id); + return fmt::format("{}{:08x}.app", content_path, content_id); } std::string GetTitlePath(Service::FS::MediaType media_type, u64 tid) { @@ -426,7 +426,7 @@ std::string GetTitlePath(Service::FS::MediaType media_type, u64 tid) { u32 low = static_cast(tid & 0xFFFFFFFF); if (media_type == Service::FS::MediaType::NAND || media_type == Service::FS::MediaType::SDMC) - return fmt::format("{}{:08x}/{:08x}/", GetMediaTitlePath(media_type).c_str(), high, low); + return fmt::format("{}{:08x}/{:08x}/", GetMediaTitlePath(media_type), high, low); if (media_type == Service::FS::MediaType::GameCard) { // TODO(shinyquagsire23): get current app path if TID matches? @@ -439,10 +439,10 @@ std::string GetTitlePath(Service::FS::MediaType media_type, u64 tid) { std::string GetMediaTitlePath(Service::FS::MediaType media_type) { if (media_type == Service::FS::MediaType::NAND) - return fmt::format("{}{}/title/", FileUtil::GetUserPath(D_NAND_IDX).c_str(), SYSTEM_ID); + return fmt::format("{}{}/title/", FileUtil::GetUserPath(D_NAND_IDX), SYSTEM_ID); if (media_type == Service::FS::MediaType::SDMC) - return fmt::format("{}Nintendo 3DS/{}/{}/title/", FileUtil::GetUserPath(D_SDMC_IDX).c_str(), + return fmt::format("{}Nintendo 3DS/{}/{}/title/", FileUtil::GetUserPath(D_SDMC_IDX), SYSTEM_ID, SDCARD_ID); if (media_type == Service::FS::MediaType::GameCard) {