aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/registered_cache.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-04-15 15:59:23 -0400
committerLioncash <mathew1800@gmail.com>2020-04-15 21:33:46 -0400
commit1c340c6efad903580904297730d708ce8b947eb6 (patch)
treea79ad11775373ecf31912a7a50fcfbcc08d6e8b3 /src/core/file_sys/registered_cache.cpp
parente33196d4e7687dd29636decd4b52e01b10fe8984 (diff)
CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
Diffstat (limited to 'src/core/file_sys/registered_cache.cpp')
-rw-r--r--src/core/file_sys/registered_cache.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index 6e9cf67ef..ba5f76288 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -591,14 +591,18 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex
InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type,
bool overwrite_if_exists, const VfsCopyFunction& copy) {
CNMTHeader header{
- nca.GetTitleId(), ///< Title ID
- 0, ///< Ignore/Default title version
- type, ///< Type
- {}, ///< Padding
- 0x10, ///< Default table offset
- 1, ///< 1 Content Entry
- 0, ///< No Meta Entries
- {}, ///< Padding
+ nca.GetTitleId(), // Title ID
+ 0, // Ignore/Default title version
+ type, // Type
+ {}, // Padding
+ 0x10, // Default table offset
+ 1, // 1 Content Entry
+ 0, // No Meta Entries
+ {}, // Padding
+ {}, // Reserved 1
+ 0, // Is committed
+ 0, // Required download system version
+ {}, // Reserved 2
};
OptionalHeader opt_header{0, 0};
ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}};
@@ -848,7 +852,8 @@ VirtualFile ManualContentProvider::GetEntryUnparsed(u64 title_id, ContentRecordT
VirtualFile ManualContentProvider::GetEntryRaw(u64 title_id, ContentRecordType type) const {
const auto iter =
std::find_if(entries.begin(), entries.end(), [title_id, type](const auto& entry) {
- const auto [title_type, content_type, e_title_id] = entry.first;
+ const auto content_type = std::get<1>(entry.first);
+ const auto e_title_id = std::get<2>(entry.first);
return content_type == type && e_title_id == title_id;
});
if (iter == entries.end())