From b9e209caa89e2693d030d24e0eb2428ab2fce09a Mon Sep 17 00:00:00 2001 From: Frederic Laing Date: Thu, 25 Oct 2018 01:15:16 +0200 Subject: [PATCH] Fix clang format part 2 --- src/core/crypto/key_manager.cpp | 6 +++--- src/core/crypto/key_manager.h | 4 ++-- src/core/file_sys/ips_layer.cpp | 2 +- src/core/file_sys/registered_cache.cpp | 8 ++++---- src/core/file_sys/registered_cache.h | 6 ++---- src/yuzu/main.h | 3 +-- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index f30f54d664..5e8435d906 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -306,7 +306,7 @@ static std::optional FindTicketOffset(const std::array& data) { } std::optional> ParseTicket(const TicketRaw& ticket, - const RSAKeyPair<2048>& key) { + const RSAKeyPair<2048>& key) { u32 cert_authority; std::memcpy(&cert_authority, ticket.data() + 0x140, sizeof(cert_authority)); if (cert_authority == 0) @@ -362,7 +362,7 @@ std::optional> ParseTicket(const TicketRaw& ticket, m_2 = m_2 ^ MGF1<0xDF>(m_1); const auto offset = FindTicketOffset(m_2); - if (offset ) + if (offset) return {}; ASSERT(offset.value() > 0); @@ -889,7 +889,7 @@ void KeyManager::DeriveETicket(PartitionDataManager& data) { for (const auto& raw : res) { const auto pair = ParseTicket(raw, rsa_key); - if (pair ) + if (pair) continue; const auto& [rid, key] = pair.value(); u128 rights_id; diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index c6cd7c9a84..22f268c655 100644 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h @@ -199,7 +199,7 @@ std::vector GetTicketblob(const FileUtil::IOFile& ticket_save); // Returns a pair of {rights_id, titlekey}. Fails if the ticket has no certificate authority (offset // 0x140-0x144 is zero) -std::optional> ParseTicket( - const TicketRaw& ticket, const RSAKeyPair<2048>& eticket_extended_key); +std::optional> ParseTicket(const TicketRaw& ticket, + const RSAKeyPair<2048>& eticket_extended_key); } // namespace Core::Crypto diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 0b8eb523b7..64b3a9e635 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -103,7 +103,7 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { offset += sizeof(u16); const auto data = ips->ReadByte(offset++); - if (data ) + if (data) return nullptr; if (real_offset + rle_size > in_data.size()) diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 7477fee004..a561662b26 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -175,7 +175,7 @@ static std::optional CheckMapForContentRecord( } std::optional RegisteredCache::GetNcaIDFromMetadata(u64 title_id, - ContentRecordType type) const { + ContentRecordType type) const { if (type == ContentRecordType::Meta && meta_id.find(title_id) != meta_id.end()) return meta_id.at(title_id); @@ -283,7 +283,7 @@ bool RegisteredCache::HasEntry(RegisteredCacheEntry entry) const { VirtualFile RegisteredCache::GetEntryUnparsed(u64 title_id, ContentRecordType type) const { const auto id = GetNcaIDFromMetadata(title_id, type); - if (id ) + if (id) return nullptr; return GetFileAtID(id.value()); @@ -307,7 +307,7 @@ std::optional RegisteredCache::GetEntryVersion(u64 title_id) const { VirtualFile RegisteredCache::GetEntryRaw(u64 title_id, ContentRecordType type) const { const auto id = GetNcaIDFromMetadata(title_id, type); - if (id ) + if (id) return nullptr; return parser(GetFileAtID(id.value()), id.value()); @@ -468,7 +468,7 @@ InstallResult RegisteredCache::RawInstallNCA(std::shared_ptr nca, const Vfs // game is massive), we're going to cheat and only hash the first MB of the NCA. // Also, for XCIs the NcaID matters, so if the override id isn't none, use that. NcaID id{}; - if (override_id ) { + if (override_id) { const auto& data = in->ReadBytes(0x100000); mbedtls_sha256(data.data(), data.size(), hash.data(), 0); memcpy(id.data(), hash.data(), 16); diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 3e6030dac8..6cfb160175 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -98,8 +98,7 @@ public: std::vector ListEntries() const; // If a parameter is not std::nullopt, it will be filtered for from all entries. std::vector ListEntriesFilter( - std::optional title_type = {}, - std::optional record_type = {}, + std::optional title_type = {}, std::optional record_type = {}, std::optional title_id = {}) const; // Raw copies all the ncas from the xci/nsp to the csache. Does some quick checks to make sure @@ -166,8 +165,7 @@ public: std::vector ListEntries() const; // If a parameter is not std::nullopt, it will be filtered for from all entries. std::vector ListEntriesFilter( - std::optional title_type = {}, - std::optional record_type = {}, + std::optional title_type = {}, std::optional record_type = {}, std::optional title_id = {}) const; private: diff --git a/src/yuzu/main.h b/src/yuzu/main.h index b18bd0f656..af637d89e3 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -178,8 +178,7 @@ private slots: void OnReinitializeKeys(ReinitializeKeyBehavior behavior); private: - std::optional SelectRomFSDumpTarget(const FileSys::RegisteredCacheUnion&, - u64 program_id); + std::optional SelectRomFSDumpTarget(const FileSys::RegisteredCacheUnion&, u64 program_id); void UpdateStatusBar(); Ui::MainWindow ui;