libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user