libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -72,6 +72,8 @@ namespace ams::fs {
|
||||
} else {
|
||||
g_local_access_log_target &= ~(fs::impl::AccessLogTarget_Application | fs::impl::AccessLogTarget_System);
|
||||
}
|
||||
#else
|
||||
AMS_UNUSED(enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -511,6 +513,7 @@ namespace ams::fs::impl {
|
||||
}
|
||||
|
||||
bool IsEnabledHandleAccessLog(fs::impl::IdentifyAccessLogHandle handle) {
|
||||
AMS_UNUSED(handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace ams::fs {
|
||||
R_TRY(impl::CheckMountNameAllowingReserved(name));
|
||||
|
||||
/* Open the partition. This uses libnx bindings. */
|
||||
/* Note: Nintendo ignores the root_path here. */
|
||||
/* NOTE: Nintendo ignores the root_path here. */
|
||||
AMS_UNUSED(root_path);
|
||||
FsFileSystem fs;
|
||||
R_TRY(fsOpenBisFileSystem(std::addressof(fs), static_cast<::FsBisPartitionId>(id), ""));
|
||||
|
||||
@@ -80,6 +81,7 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
/* TODO: Libnx binding for fsSetBisRootForHost */
|
||||
AMS_UNUSED(id);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
|
||||
@@ -184,54 +184,67 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
virtual Result DoOpenDirectory(std::unique_ptr<fsa::IDirectory> *out_dir, const char *path, OpenDirectoryMode mode) override final {
|
||||
AMS_UNUSED(out_dir, path, mode);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoGetEntryType(DirectoryEntryType *out, const char *path) override final {
|
||||
AMS_UNUSED(out, path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoCreateFile(const char *path, s64 size, int flags) override final {
|
||||
AMS_UNUSED(path, size, flags);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoDeleteFile(const char *path) override final {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoCreateDirectory(const char *path) override final {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoDeleteDirectory(const char *path) override final {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoDeleteDirectoryRecursively(const char *path) override final {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoRenameFile(const char *old_path, const char *new_path) override final {
|
||||
AMS_UNUSED(old_path, new_path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoRenameDirectory(const char *old_path, const char *new_path) override final {
|
||||
AMS_UNUSED(old_path, new_path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoCleanDirectoryRecursively(const char *path) override final {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) override final {
|
||||
AMS_UNUSED(out, path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) override final {
|
||||
AMS_UNUSED(out, path);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
|
||||
virtual Result DoCommitProvisionally(s64 counter) override final {
|
||||
AMS_UNUSED(counter);
|
||||
return fs::ResultUnsupportedOperation();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
AbortSpecifier DefaultResultHandler(Result result) {
|
||||
AMS_UNUSED(result);
|
||||
if (g_auto_abort_enabled) {
|
||||
return AbortSpecifier::Default;
|
||||
} else {
|
||||
@@ -39,6 +40,7 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
AbortSpecifier AlwaysReturnResultHandler(Result result) {
|
||||
AMS_UNUSED(result);
|
||||
return AbortSpecifier::Return;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
void DefaultDeallocate(void *ptr, size_t size) {
|
||||
AMS_UNUSED(size);
|
||||
ams::Free(ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace ams::fs {
|
||||
|
||||
void LogResultErrorMessage(Result result) {
|
||||
/* TODO: log specific results */
|
||||
AMS_UNUSED(result);
|
||||
}
|
||||
|
||||
void LogErrorMessage(Result result, const char *function) {
|
||||
@@ -62,6 +63,7 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
/* TODO: Actually log stuff. */
|
||||
AMS_UNUSED(function);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -179,6 +179,7 @@ namespace ams::fs {
|
||||
AMS_ASSERT(this->GetStorage() != nullptr);
|
||||
AMS_ASSERT(offset >= 0);
|
||||
AMS_ASSERT(buf != nullptr || size == 0);
|
||||
AMS_UNUSED(buf);
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
@@ -219,10 +220,12 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
|
||||
AMS_UNUSED(offset, buffer, size, option);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileA();
|
||||
}
|
||||
|
||||
virtual Result DoSetSize(s64 size) override {
|
||||
AMS_UNUSED(size);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileA();
|
||||
}
|
||||
|
||||
@@ -441,30 +444,37 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoCreateFile(const char *path, s64 size, int flags) {
|
||||
AMS_UNUSED(path, size, flags);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoDeleteFile(const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoCreateDirectory(const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoDeleteDirectory(const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoRenameFile(const char *old_path, const char *new_path) {
|
||||
AMS_UNUSED(old_path, new_path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoRenameDirectory(const char *old_path, const char *new_path) {
|
||||
AMS_UNUSED(old_path, new_path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
@@ -522,19 +532,24 @@ namespace ams::fs {
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
|
||||
*out = 0;
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoGetTotalSpaceSize(s64 *out, const char *path) {
|
||||
AMS_UNUSED(out, path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemC();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoCleanDirectoryRecursively(const char *path) {
|
||||
AMS_UNUSED(path);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
|
||||
AMS_UNUSED(counter);
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemB();
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace ams::fs {
|
||||
|
||||
Result DeleteSaveData(SaveDataId id) {
|
||||
/* TODO: Libnx binding for DeleteSaveDataFileSystem */
|
||||
AMS_UNUSED(id);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
@@ -89,7 +90,7 @@ namespace ams::fs {
|
||||
const auto attribute = SaveDataAttribute::Make(ncm::InvalidProgramId, SaveDataType::System, user_id, id);
|
||||
|
||||
/* TODO: Libnx binding for DeleteSaveDataFileSystemBySaveDataAttribute */
|
||||
AMS_UNUSED(attribute);
|
||||
AMS_UNUSED(space_id, attribute);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace ams::fs::impl {
|
||||
|
||||
Result FileAccessor::ReadWithCacheAccessLog(size_t *out, s64 offset, void *buf, size_t size, const ReadOption &option, bool use_path_cache, bool use_data_cache) {
|
||||
/* TODO */
|
||||
AMS_UNUSED(out, offset, buf, size, option, use_path_cache, use_data_cache);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user