summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-06-21 02:31:17 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-30 23:28:23 +0200
commitbcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f (patch)
treea63e45e3d4d53667357f927987374fa151a08f6b /src/core
parentbcat: Implement DeliveryCacheProgressImpl structure (diff)
downloadyuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar.gz
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar.bz2
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar.lz
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar.xz
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.tar.zst
yuzu-bcf1eafb8bd1a810fd33a7e7e06a86173b4bfb9f.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/bcat/backend/backend.cpp13
-rw-r--r--src/core/hle/service/bcat/backend/boxcat.cpp5
-rw-r--r--src/core/hle/service/bcat/module.cpp8
3 files changed, 14 insertions, 12 deletions
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp
index e389ad568..9b677debe 100644
--- a/src/core/hle/service/bcat/backend/backend.cpp
+++ b/src/core/hle/service/bcat/backend/backend.cpp
@@ -13,7 +13,7 @@ namespace Service::BCAT {
ProgressServiceBackend::ProgressServiceBackend(std::string event_name) : impl{} {
auto& kernel{Core::System::GetInstance().Kernel()};
event = Kernel::WritableEvent::CreateEventPair(
- kernel, Kernel::ResetType::OneShot, "ProgressServiceBackend:UpdateEvent:" + event_name);
+ kernel, Kernel::ResetType::Automatic, "ProgressServiceBackend:UpdateEvent:" + event_name);
}
Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() {
@@ -48,8 +48,10 @@ void ProgressServiceBackend::StartDownloadingFile(std::string_view dir_name,
impl.status = DeliveryCacheProgressImpl::Status::Downloading;
impl.current_downloaded_bytes = 0;
impl.current_total_bytes = file_size;
- std::memcpy(impl.current_directory.data(), dir_name.data(), std::min(dir_name.size(), 0x31ull));
- std::memcpy(impl.current_file.data(), file_name.data(), std::min(file_name.size(), 0x31ull));
+ std::memcpy(impl.current_directory.data(), dir_name.data(),
+ std::min<u64>(dir_name.size(), 0x31ull));
+ std::memcpy(impl.current_file.data(), file_name.data(),
+ std::min<u64>(file_name.size(), 0x31ull));
SignalUpdate();
}
@@ -68,7 +70,8 @@ void ProgressServiceBackend::CommitDirectory(std::string_view dir_name) {
impl.current_file.fill(0);
impl.current_downloaded_bytes = 0;
impl.current_total_bytes = 0;
- std::memcpy(impl.current_directory.data(), dir_name.data(), std::min(dir_name.size(), 0x31ull));
+ std::memcpy(impl.current_directory.data(), dir_name.data(),
+ std::min<u64>(dir_name.size(), 0x31ull));
SignalUpdate();
}
@@ -121,7 +124,7 @@ bool NullBackend::Clear(u64 title_id) {
void NullBackend::SetPassphrase(u64 title_id, const Passphrase& passphrase) {
LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, passphrase = {}", title_id,
- Common::HexArrayToString(passphrase));
+ Common::HexToString(passphrase));
}
std::optional<std::vector<u8>> NullBackend::GetLaunchParameter(TitleIDVersion title) {
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp
index 3754594df..5bc2e22d7 100644
--- a/src/core/hle/service/bcat/backend/boxcat.cpp
+++ b/src/core/hle/service/bcat/backend/boxcat.cpp
@@ -214,8 +214,7 @@ private:
std::vector<u8> bytes(file.GetSize());
file.ReadBytes(bytes.data(), bytes.size());
const auto digest = DigestFile(bytes);
- headers.insert(
- {std::string("If-None-Match"), Common::HexArrayToString(digest, false)});
+ headers.insert({std::string("If-None-Match"), Common::HexToString(digest, false)});
}
}
@@ -402,7 +401,7 @@ bool Boxcat::Clear(u64 title_id) {
void Boxcat::SetPassphrase(u64 title_id, const Passphrase& passphrase) {
LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, passphrase={}", title_id,
- Common::HexArrayToString(passphrase));
+ Common::HexToString(passphrase));
}
std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title) {
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index d5f9e9d3b..1b9a75a1c 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -195,7 +195,7 @@ private:
const auto passphrase_raw = ctx.ReadBuffer();
LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, passphrase={}", title_id,
- Common::HexVectorToString(passphrase_raw));
+ Common::HexToString(passphrase_raw));
if (title_id == 0) {
LOG_ERROR(Service_BCAT, "Invalid title ID!");
@@ -335,7 +335,7 @@ private:
rb.Push(ERROR_NO_OPEN_ENTITY);
}
- size = std::min(current_file->GetSize() - offset, size);
+ size = std::min<u64>(current_file->GetSize() - offset, size);
const auto buffer = current_file->ReadBytes(size, offset);
ctx.WriteBuffer(buffer);
@@ -437,7 +437,7 @@ private:
}
const auto files = current_dir->GetFiles();
- write_size = std::min(write_size, files.size());
+ write_size = std::min<u64>(write_size, files.size());
std::vector<DeliveryCacheDirectoryEntry> entries(write_size);
std::transform(
files.begin(), files.begin() + write_size, entries.begin(), [](const auto& file) {
@@ -519,7 +519,7 @@ private:
LOG_DEBUG(Service_BCAT, "called, size={:016X}", size);
- size = std::min(size, entries.size() - next_read_index);
+ size = std::min<u64>(size, entries.size() - next_read_index);
ctx.WriteBuffer(entries.data() + next_read_index, size * sizeof(DirectoryName));
next_read_index += size;