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

@@ -19,6 +19,7 @@ namespace ams::fssrv {
void InitializeForFileSystemProxy(fscreator::FileSystemCreatorInterfaces *fs_creator_interfaces, fssystem::IBufferManager *buffer_manager, bool is_development_function_enabled) {
/* TODO FS-REIMPL */
AMS_UNUSED(fs_creator_interfaces, buffer_manager, is_development_function_enabled);
}
}

View File

@@ -123,7 +123,7 @@ namespace ams::fssrv::impl {
Result DirectoryInterfaceAdapter::Read(ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries) {
auto read_lock = this->parent_filesystem->AcquireCacheInvalidationReadLock();
const size_t max_num_entries = out_entries.GetSize() / sizeof(fs::DirectoryEntry);
const s64 max_num_entries = out_entries.GetSize() / sizeof(fs::DirectoryEntry);
R_UNLESS(max_num_entries >= 0, fs::ResultInvalidSize());
/* TODO: N retries on ResultDataCorrupted, we may want to eventually. */

View File

@@ -27,6 +27,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::OnAllocate(void *p, size_t size) {
AMS_UNUSED(size);
if (p != nullptr) {
this->current_free_size = GetUsedSize(p);
this->peak_free_size = std::min(this->peak_free_size, this->current_free_size);
@@ -34,6 +36,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::OnDeallocate(void *p, size_t size) {
AMS_UNUSED(size);
if (p != nullptr) {
this->current_free_size += GetUsedSize(p);
}
@@ -48,6 +52,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::DeallocateImpl(void *p, size_t size, size_t align) {
AMS_UNUSED(align);
std::scoped_lock lk(this->mutex);
this->OnDeallocate(p, size);

View File

@@ -44,6 +44,8 @@ namespace ams::fssrv {
}
void MemoryResourceFromStandardAllocator::DeallocateImpl(void *p, size_t size, size_t align) {
AMS_UNUSED(size, align);
std::scoped_lock lk(this->mutex);
this->current_free_size += this->allocator->GetSizeOf(p);