summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2021-06-23 15:31:04 -0700
committerGravatar GitHub2021-06-23 15:31:04 -0700
commit1b09d6628b7f268c256c12e4d3e373724671d2f1 (patch)
treeb1679d1c4bc044144798746332860939fe43d109 /src/core
parentMerge pull request #6504 from Kelebek1/samples-played (diff)
parentGeneral: Resolve fmt specifiers to adhere to 8.0.0 API where applicable (diff)
downloadyuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.gz
yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.xz
yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.zip
Merge pull request #6517 from lioncash/fmtlib
externals: Update fmt to 8.0.0
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) {
835 "key_area_key_ocean_{:02X}", 835 "key_area_key_ocean_{:02X}",
836 "key_area_key_system_{:02X}", 836 "key_area_key_system_{:02X}",
837 }; 837 };
838 WriteKeyToFile(category, fmt::format(kak_names.at(field2), field1), key); 838 WriteKeyToFile(category, fmt::format(fmt::runtime(kak_names.at(field2)), field1), key);
839 } else if (id == S128KeyType::Master) { 839 } else if (id == S128KeyType::Master) {
840 WriteKeyToFile(category, fmt::format("master_key_{:02X}", field1), key); 840 WriteKeyToFile(category, fmt::format("master_key_{:02X}", field1), key);
841 } else if (id == S128KeyType::Package1) { 841 } 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) {
58 58
59static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bool second_hex_upper, 59static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bool second_hex_upper,
60 bool within_two_digit, bool cnmt_suffix) { 60 bool within_two_digit, bool cnmt_suffix) {
61 if (!within_two_digit) 61 if (!within_two_digit) {
62 return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca", 62 const auto format_str = fmt::runtime(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca");
63 Common::HexToString(nca_id, second_hex_upper)); 63 return fmt::format(format_str, Common::HexToString(nca_id, second_hex_upper));
64 }
64 65
65 Core::Crypto::SHA256Hash hash{}; 66 Core::Crypto::SHA256Hash hash{};
66 mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0); 67 mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0);
67 return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0], 68
68 Common::HexToString(nca_id, second_hex_upper)); 69 const auto format_str =
70 fmt::runtime(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca");
71 return fmt::format(format_str, hash[0], Common::HexToString(nca_id, second_hex_upper));
69} 72}
70 73
71static std::string GetCNMTName(TitleType type, u64 title_id) { 74static 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 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <functional>
7#include <memory> 8#include <memory>
8#include <string> 9#include <string>
9#include <tuple> 10#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
149 std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name; 149 std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name;
150 150
151 fmt::memory_buffer buf; 151 fmt::memory_buffer buf;
152 fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]=0x{:X}", function_name, 152 fmt::format_to(std::back_inserter(buf), "function '{}': port='{}' cmd_buf={{[0]=0x{:X}",
153 service_name, cmd_buf[0]); 153 function_name, service_name, cmd_buf[0]);
154 for (int i = 1; i <= 8; ++i) { 154 for (int i = 1; i <= 8; ++i) {
155 fmt::format_to(buf, ", [{}]=0x{:X}", i, cmd_buf[i]); 155 fmt::format_to(std::back_inserter(buf), ", [{}]=0x{:X}", i, cmd_buf[i]);
156 } 156 }
157 buf.push_back('}'); 157 buf.push_back('}');
158 158