libstrat: enable -Wextra, -Werror

This caught an embarrassingly large number of bugs.
This commit is contained in:
Michael Scire 2021-10-06 15:20:48 -07:00
parent e1fbf27398
commit 7ca83c9d3b
160 changed files with 691 additions and 152 deletions

View file

@ -385,6 +385,8 @@ namespace ams::fssystem::save {
}
Result BlockCacheBufferedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
AMS_UNUSED(src, src_size);
/* Validate pre-conditions. */
AMS_ASSERT(this->data_storage != nullptr);
@ -636,6 +638,8 @@ namespace ams::fssystem::save {
}
Result BlockCacheBufferedStorage::GetAssociateBuffer(MemoryRange *out_range, CacheEntry *out_entry, s64 offset, size_t ideal_size, bool is_allocate_for_write) {
AMS_UNUSED(is_allocate_for_write);
/* Validate pre-conditions. */
AMS_ASSERT(this->data_storage != nullptr);
AMS_ASSERT(this->buffer_manager != nullptr);

View file

@ -315,6 +315,7 @@ namespace ams::fssystem::save {
this->CalcFetchParameter(std::addressof(fetch_param), offset);
AMS_ASSERT(fetch_param.offset == offset);
AMS_ASSERT(fetch_param.size <= buffer_size);
AMS_UNUSED(buffer_size);
std::memcpy(fetch_param.buffer, buffer, fetch_param.size);
this->offset = fetch_param.offset;

View file

@ -390,6 +390,7 @@ namespace ams::fssystem::save {
const s64 sign_offset = (offset >> this->verification_block_order) * HashSize;
const auto sign_size = static_cast<size_t>((size >> this->verification_block_order) * HashSize);
AMS_ASSERT(dst_size >= sign_size);
AMS_UNUSED(dst_size);
/* Create a guard in the event of failure. */
auto clear_guard = SCOPE_GUARD { std::memset(dst, 0, sign_size); };
@ -418,6 +419,7 @@ namespace ams::fssystem::save {
const s64 sign_offset = (offset >> this->verification_block_order) * HashSize;
const auto sign_size = static_cast<size_t>((size >> this->verification_block_order) * HashSize);
AMS_ASSERT(src_size >= sign_size);
AMS_UNUSED(src_size);
/* Write the signature. */
R_TRY(this->hash_storage.Write(sign_offset, src, sign_size));