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

@@ -92,6 +92,7 @@ namespace ams::fs {
.dir = InvalidPosition,
.file = InvalidPosition,
};
AMS_UNUSED(info);
Position new_pos = 0;
R_TRY_CATCH(this->dir_table.Add(std::addressof(new_pos), new_key, new_entry)) {
@@ -221,6 +222,8 @@ namespace ams::fs {
RomDirectoryEntry entry = {};
R_TRY(this->GetDirectoryEntry(std::addressof(entry), id));
AMS_UNUSED(out);
return ResultSuccess();
}
@@ -275,6 +278,7 @@ namespace ams::fs {
AMS_ASSERT(out != nullptr);
AMS_ASSERT(find != nullptr);
AMS_ASSERT(length > RomPathTool::MaxPathLength);
AMS_UNUSED(length);
R_UNLESS(find->next_dir != InvalidPosition, fs::ResultDbmFindFinished());
@@ -294,6 +298,7 @@ namespace ams::fs {
AMS_ASSERT(out != nullptr);
AMS_ASSERT(find != nullptr);
AMS_ASSERT(length > RomPathTool::MaxPathLength);
AMS_UNUSED(length);
R_UNLESS(find->next_file != InvalidPosition, fs::ResultDbmFindFinished());
@@ -544,6 +549,8 @@ namespace ams::fs {
RomDirectoryEntry entry = {};
R_TRY(this->GetDirectoryEntry(std::addressof(pos), std::addressof(entry), key));
AMS_UNUSED(out);
return ResultSuccess();
}

View File

@@ -161,6 +161,8 @@ namespace ams::fs {
}
Result FileHandleStorage::OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
AMS_UNUSED(src, src_size);
switch (op_id) {
case OperationId::QueryRange:
/* Validate buffer and size. */