summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-06-23 15:59:56 +0200
committerLioncash <mathew1800@gmail.com>2021-06-23 19:48:21 +0200
commitd0b1f2bd05a2fcadbb4c148be2105e337dd986e8 (patch)
tree17e7abb608ab936ae6696e0507c9d1441256c66a /src/core
parentexternals: Update dynarmic to allow fmt compilation to succeed (diff)
downloadyuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar.gz
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar.bz2
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar.lz
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar.xz
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.tar.zst
yuzu-d0b1f2bd05a2fcadbb4c148be2105e337dd986e8.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/crypto/key_manager.cpp2
-rw-r--r--src/core/file_sys/registered_cache.cpp13
-rw-r--r--src/core/frontend/input.h1
-rw-r--r--src/core/hle/service/service.cpp6
4 files changed, 13 insertions, 9 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index fb451a423..a98daed89 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -835,7 +835,7 @@ void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) {
"key_area_key_ocean_{:02X}",
"key_area_key_system_{:02X}",
};
- WriteKeyToFile(category, fmt::format(kak_names.at(field2), field1), key);
+ WriteKeyToFile(category, fmt::format(fmt::runtime(kak_names.at(field2)), field1), key);
} else if (id == S128KeyType::Master) {
WriteKeyToFile(category, fmt::format("master_key_{:02X}", field1), key);
} else if (id == S128KeyType::Package1) {
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index 066c6789a..7a646b5f1 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -58,14 +58,17 @@ static bool FollowsNcaIdFormat(std::string_view name) {
static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bool second_hex_upper,
bool within_two_digit, bool cnmt_suffix) {
- if (!within_two_digit)
- return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca",
- Common::HexToString(nca_id, second_hex_upper));
+ if (!within_two_digit) {
+ const auto format_str = fmt::runtime(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca");
+ return fmt::format(format_str, Common::HexToString(nca_id, second_hex_upper));
+ }
Core::Crypto::SHA256Hash hash{};
mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0);
- return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0],
- Common::HexToString(nca_id, second_hex_upper));
+
+ const auto format_str =
+ fmt::runtime(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca");
+ return fmt::format(format_str, hash[0], Common::HexToString(nca_id, second_hex_upper));
}
static std::string GetCNMTName(TitleType type, u64 title_id) {
diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h
index 7a047803e..f1747c5b2 100644
--- a/src/core/frontend/input.h
+++ b/src/core/frontend/input.h
@@ -4,6 +4,7 @@
#pragma once
+#include <functional>
#include <memory>
#include <string>
#include <tuple>
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 4e1541630..663b83cd3 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -149,10 +149,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name;
fmt::memory_buffer buf;
- fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]=0x{:X}", function_name,
- service_name, cmd_buf[0]);
+ fmt::format_to(std::back_inserter(buf), "function '{}': port='{}' cmd_buf={{[0]=0x{:X}",
+ function_name, service_name, cmd_buf[0]);
for (int i = 1; i <= 8; ++i) {
- fmt::format_to(buf, ", [{}]=0x{:X}", i, cmd_buf[i]);
+ fmt::format_to(std::back_inserter(buf), ", [{}]=0x{:X}", i, cmd_buf[i]);
}
buf.push_back('}');