diff --git a/libraries/libstratosphere/Makefile b/libraries/libstratosphere/Makefile index 8c3fbc990..82a45017f 100644 --- a/libraries/libstratosphere/Makefile +++ b/libraries/libstratosphere/Makefile @@ -21,7 +21,7 @@ PRECOMPILED_HEADERS := $(CURRENT_DIRECTORY)/include/stratosphere.hpp #PRECOMPILED_HEADERS := DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE -SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -flto +SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -Wextra -Werror -Wno-missing-field-initializers -flto CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_read_only_filesystem.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_read_only_filesystem.hpp index 3067e8a55..2610f29f5 100644 --- a/libraries/libstratosphere/include/stratosphere/fs/fs_read_only_filesystem.hpp +++ b/libraries/libstratosphere/include/stratosphere/fs/fs_read_only_filesystem.hpp @@ -107,46 +107,57 @@ namespace ams::fs { } virtual Result DoCreateFile(const char *path, s64 size, int flags) override final { + AMS_UNUSED(path, size, flags); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoDeleteFile(const char *path) override final { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoCreateDirectory(const char *path) override final { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoDeleteDirectory(const char *path) override final { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoDeleteDirectoryRecursively(const char *path) override final { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoRenameFile(const char *old_path, const char *new_path) override final { + AMS_UNUSED(old_path, new_path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoRenameDirectory(const char *old_path, const char *new_path) override final { + AMS_UNUSED(old_path, new_path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoCleanDirectoryRecursively(const char *path) override final { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA(); } virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) override final { + AMS_UNUSED(out, path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB(); } virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) override final { + AMS_UNUSED(out, path); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB(); } virtual Result DoCommitProvisionally(s64 counter) override final { + AMS_UNUSED(counter); return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateC(); } }; diff --git a/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp b/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp index d3298d354..072b273a0 100644 --- a/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp +++ b/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp @@ -34,6 +34,7 @@ namespace ams::fssystem::buffers { R_CATCH(fs::ResultBufferAllocationFailed) { if ((1 <= count && count <= BufferAllocationRetryLogCountMax) || ((count % BufferAllocationRetryLogInterval) == 0)) { /* TODO: Log */ + AMS_UNUSED(function_name); } R_TRY(on_failure()); diff --git a/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_allocator_utility.hpp b/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_allocator_utility.hpp index 54bfe9e23..2222aa99a 100644 --- a/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_allocator_utility.hpp +++ b/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_allocator_utility.hpp @@ -29,10 +29,10 @@ namespace ams::fssystem { template class StdAllocator : public std::allocator { public: - StdAllocator() { /* ... */ } - StdAllocator(const StdAllocator &) { /* ... */ } + StdAllocator() = default; + StdAllocator(const StdAllocator &) = default; template - StdAllocator(const StdAllocator &) { /* ... */ } + StdAllocator(const StdAllocator &) : std::allocator() { /* ... */ }; template struct rebind { @@ -40,6 +40,7 @@ namespace ams::fssystem { }; T *Allocate(size_t size, const T *hint = nullptr) { + AMS_UNUSED(hint); return static_cast(::ams::fssystem::Allocate(sizeof(T) * size)); } diff --git a/libraries/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp b/libraries/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp index 5ed4b95ec..52ec86ca9 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp @@ -292,13 +292,17 @@ namespace ams::sf::hipc { } protected: virtual ServerSession *AllocateSession() override final { - std::scoped_lock lk(this->resource_mutex); - for (size_t i = 0; i < MaxSessions; i++) { - if (!this->session_allocated[i]) { - this->session_allocated[i] = true; - return GetPointer(this->session_storages[i]); + if constexpr (MaxSessions > 0) { + std::scoped_lock lk(this->resource_mutex); + + for (size_t i = 0; i < MaxSessions; i++) { + if (!this->session_allocated[i]) { + this->session_allocated[i] = true; + return GetPointer(this->session_storages[i]); + } } } + return nullptr; } @@ -310,13 +314,17 @@ namespace ams::sf::hipc { } virtual Server *AllocateServer() override final { - std::scoped_lock lk(this->resource_mutex); - for (size_t i = 0; i < MaxServers; i++) { - if (!this->server_allocated[i]) { - this->server_allocated[i] = true; - return GetPointer(this->server_storages[i]); + if constexpr (MaxServers > 0) { + std::scoped_lock lk(this->resource_mutex); + + for (size_t i = 0; i < MaxServers; i++) { + if (!this->server_allocated[i]) { + this->server_allocated[i] = true; + return GetPointer(this->server_storages[i]); + } } } + return nullptr; } @@ -390,16 +398,20 @@ namespace ams::sf::hipc { ~ServerManager() { /* Close all sessions. */ - for (size_t i = 0; i < MaxSessions; i++) { - if (this->session_allocated[i]) { - this->CloseSessionImpl(GetPointer(this->session_storages[i])); + if constexpr (MaxSessions > 0) { + for (size_t i = 0; i < MaxSessions; i++) { + if (this->session_allocated[i]) { + this->CloseSessionImpl(GetPointer(this->session_storages[i])); + } } } /* Close all servers. */ - for (size_t i = 0; i < MaxServers; i++) { - if (this->server_allocated[i]) { - this->DestroyServer(GetPointer(this->server_storages[i])); + if constexpr (MaxServers > 0) { + for (size_t i = 0; i < MaxServers; i++) { + if (this->server_allocated[i]) { + this->DestroyServer(GetPointer(this->server_storages[i])); + } } } } diff --git a/libraries/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp b/libraries/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp index f31ab63de..ab0cb59a1 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp @@ -835,6 +835,8 @@ namespace ams::sf::impl { } virtual void SetOutObjects(const cmif::ServiceDispatchContext &ctx, const HipcRequest &response, cmif::ServiceObjectHolder *out_objects, cmif::DomainObjectId *ids) override final { + AMS_UNUSED(ids); + #define _SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(n) do { if constexpr (CommandMeta::NumOutObjects > n) { SetOutObjectImpl(response, ctx.manager, std::move(out_objects[n])); } } while (0) _SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(0); _SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(1); diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_allocation_policies.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_allocation_policies.hpp index 9e2bef268..f154ded69 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_allocation_policies.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_allocation_policies.hpp @@ -36,11 +36,13 @@ namespace ams::sf { template static void *AllocateAligned(size_t size, size_t align) { + AMS_UNUSED(align); return A().Allocate(size); } template static void DeallocateAligned(void *ptr, size_t size, size_t align) { + AMS_UNUSED(align); A().Deallocate(ptr, size); } }; @@ -56,11 +58,13 @@ namespace ams::sf { template static void *AllocateAligned(size_t size, size_t align) { + AMS_UNUSED(align); return StatelessAllocator().Allocate(size); } template static void DeallocateAligned(void *ptr, size_t size, size_t align) { + AMS_UNUSED(align); StatelessAllocator().Deallocate(ptr, size); } }; @@ -72,10 +76,12 @@ namespace ams::sf { using Allocator = A; static void *AllocateAligned(Allocator *allocator, size_t size, size_t align) { + AMS_UNUSED(align); return allocator->Allocate(size); } static void DeallocateAligned(Allocator *allocator, void *ptr, size_t size, size_t align) { + AMS_UNUSED(align); allocator->Deallocate(ptr, size); } }; diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp index bd2db329b..8c243960f 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp @@ -34,11 +34,13 @@ namespace ams::sf { public: void *Allocate(size_t size) { AMS_ASSERT(size == sizeof(T)); + AMS_UNUSED(size); return DefaultAllocateImpl(sizeof(Holder), alignof(Holder), offsetof(Holder, storage)); } void Deallocate(void *ptr, size_t size) { AMS_ASSERT(size == sizeof(T)); + AMS_UNUSED(size); return DefaultDeallocateImpl(ptr, sizeof(Holder), alignof(Holder), offsetof(Holder, storage)); } }; diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_object_impl_factory.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_object_impl_factory.hpp index 357cc4eeb..6c442fac2 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_object_impl_factory.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_object_impl_factory.hpp @@ -100,7 +100,7 @@ namespace ams::sf { static void *operator new(size_t size); static void operator delete(void *ptr, size_t size) { - /* ... */ + AMS_UNUSED(ptr, size); } static void *operator new(size_t size, Allocator *a) { diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_std_allocation_policy.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_std_allocation_policy.hpp index 516684b08..7542a287e 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_std_allocation_policy.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_std_allocation_policy.hpp @@ -37,11 +37,13 @@ namespace ams::sf { template static void *AllocateAligned(size_t size, size_t align) { + AMS_UNUSED(align); return StdAllocator().allocate(size / sizeof(T)); } template static void DeallocateAligned(void *ptr, size_t size, size_t align) { + AMS_UNUSED(align); StdAllocator().deallocate(static_cast(ptr), size / sizeof(T)); } }; diff --git a/libraries/libstratosphere/source/capsrv/server/jpeg/capsrv_server_jpeg_error_handler.hpp b/libraries/libstratosphere/source/capsrv/server/jpeg/capsrv_server_jpeg_error_handler.hpp index 384dd45b1..164aaaa14 100644 --- a/libraries/libstratosphere/source/capsrv/server/jpeg/capsrv_server_jpeg_error_handler.hpp +++ b/libraries/libstratosphere/source/capsrv/server/jpeg/capsrv_server_jpeg_error_handler.hpp @@ -37,6 +37,10 @@ namespace ams::capsrv::server::jpeg { } static Result GetResult(int msg_code, int msg_param) { + /* NOTE: Nintendo uses msg_param for error codes that we never trigger. */ + /* TODO: Fully support all J_MESSAGE_CODEs that Nintendo handles? */ + AMS_UNUSED(msg_param); + switch (msg_code) { case JpegLibraryType::J_MESSAGE_CODE::JERR_BUFFER_SIZE: case JpegLibraryType::J_MESSAGE_CODE::JERR_NO_BACKING_STORE: diff --git a/libraries/libstratosphere/source/cfg/cfg_override.cpp b/libraries/libstratosphere/source/cfg/cfg_override.cpp index 369fdbefc..2451074cb 100644 --- a/libraries/libstratosphere/source/cfg/cfg_override.cpp +++ b/libraries/libstratosphere/source/cfg/cfg_override.cpp @@ -186,6 +186,8 @@ namespace ams::cfg { } int OverrideConfigIniHandler(void *user, const char *section, const char *name, const char *value) { + AMS_UNUSED(user); + /* Taken and modified, with love, from Rajkosto's implementation. */ if (strcasecmp(section, "hbl_config") == 0) { if (strcasecmp(name, "program_id") == 0 || strcasecmp(name, "program_id_0") == 0) { diff --git a/libraries/libstratosphere/source/diag/diag_assertion_impl.cpp b/libraries/libstratosphere/source/diag/diag_assertion_impl.cpp index 992ad7a8c..a41f6468b 100644 --- a/libraries/libstratosphere/source/diag/diag_assertion_impl.cpp +++ b/libraries/libstratosphere/source/diag/diag_assertion_impl.cpp @@ -57,7 +57,7 @@ namespace ams::diag { } #else - void DebugLog(const char *format, ...) { /* ... */ } + void DebugLog(const char *format, ...) { AMS_UNUSED(format); } #endif } @@ -76,6 +76,8 @@ namespace ams::diag { DebugLogImpl(format, vl); va_end(vl); } +#else + AMS_UNUSED(format); #endif DebugLog("\n"); @@ -108,6 +110,8 @@ namespace ams::diag { DebugLogImpl(format, vl); va_end(vl); } +#else + AMS_UNUSED(format); #endif DebugLog("\n"); diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_allocator.hpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_allocator.hpp index 01f728f35..063ec4805 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_allocator.hpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_allocator.hpp @@ -44,6 +44,8 @@ namespace ams::erpt::srv { } inline void DeallocateWithSize(void *p, size_t size) { + AMS_UNUSED(size); + return lmem::FreeToExpHeap(g_heap_handle, p); } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_impl.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_impl.cpp index 7b56577c5..410c65934 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_impl.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_impl.cpp @@ -82,7 +82,7 @@ namespace ams::erpt::srv { } Result ContextImpl::SubmitMultipleCategoryContext(const MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer) { - R_UNLESS(0 <= ctx_entry.category_count && ctx_entry.category_count <= CategoriesPerMultipleCategoryContext, erpt::ResultInvalidArgument()); + R_UNLESS(ctx_entry.category_count <= CategoriesPerMultipleCategoryContext, erpt::ResultInvalidArgument()); const u8 *str = reinterpret_cast(str_buffer.GetPointer()); const u32 str_size = static_cast(str_buffer.GetSize()); diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_formatter.hpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_formatter.hpp index 1aa42a171..ef10226c4 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_formatter.hpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_formatter.hpp @@ -132,6 +132,7 @@ namespace ams::erpt::srv { } static Result End(Report *report) { + AMS_UNUSED(report); return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_attachments.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_attachments.cpp index 988465c6d..3579385aa 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_attachments.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_attachments.cpp @@ -138,7 +138,9 @@ namespace ams::erpt::srv { JournalRecord *JournalForAttachments::RetrieveRecord(AttachmentId attachment_id) { for (auto it = s_attachment_list.begin(); it != s_attachment_list.end(); it++) { - return std::addressof(*it); + if (auto *record = std::addressof(*it); record->info.attachment_id == attachment_id) { + return record; + } } return nullptr; } @@ -213,6 +215,8 @@ namespace ams::erpt::srv { R_TRY(StoreRecord(record)); } + *out = info.attachment_id; + return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_reports.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_reports.cpp index 746811c75..bd6a0ab2b 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_reports.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_journal_for_reports.cpp @@ -174,8 +174,11 @@ namespace ams::erpt::srv { JournalRecord *JournalForReports::RetrieveRecord(ReportId report_id) { for (auto it = s_record_list.begin(); it != s_record_list.end(); it++) { - return std::addressof(*it); + if (auto *record = std::addressof(*it); record->info.id == report_id) { + return record; + } } + return nullptr; } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp index 7a0b82c95..83f913ac8 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp @@ -280,6 +280,7 @@ namespace ams::erpt::srv { if (needs_save_syslog) { /* Here nintendo sends a report to srepo:u (vtable offset 0xE8) with data report_id. */ /* We will not send report ids to srepo:u. */ + AMS_UNUSED(report_id); } } @@ -308,6 +309,7 @@ namespace ams::erpt::srv { const auto program_id_len = program_id_entry->value_array.size; AMS_ASSERT(16 <= program_id_len && program_id_len <= 17); AMS_ASSERT(program_id_ofs + program_id_len <= data_size); + AMS_UNUSED(data_size); /* Get the program id string. */ char program_id_str[17]; diff --git a/libraries/libstratosphere/source/fs/common/fs_dbm_hierarchical_rom_file_table.cpp b/libraries/libstratosphere/source/fs/common/fs_dbm_hierarchical_rom_file_table.cpp index 98b0cb451..86d4867d2 100644 --- a/libraries/libstratosphere/source/fs/common/fs_dbm_hierarchical_rom_file_table.cpp +++ b/libraries/libstratosphere/source/fs/common/fs_dbm_hierarchical_rom_file_table.cpp @@ -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(); } diff --git a/libraries/libstratosphere/source/fs/common/fs_file_storage.cpp b/libraries/libstratosphere/source/fs/common/fs_file_storage.cpp index ed4d77ca3..f7ebcc38e 100644 --- a/libraries/libstratosphere/source/fs/common/fs_file_storage.cpp +++ b/libraries/libstratosphere/source/fs/common/fs_file_storage.cpp @@ -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. */ diff --git a/libraries/libstratosphere/source/fs/fs_access_log.cpp b/libraries/libstratosphere/source/fs/fs_access_log.cpp index d96b98660..c0602854c 100644 --- a/libraries/libstratosphere/source/fs/fs_access_log.cpp +++ b/libraries/libstratosphere/source/fs/fs_access_log.cpp @@ -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; } diff --git a/libraries/libstratosphere/source/fs/fs_bis.cpp b/libraries/libstratosphere/source/fs/fs_bis.cpp index 138d3c19f..4ae441bb3 100644 --- a/libraries/libstratosphere/source/fs/fs_bis.cpp +++ b/libraries/libstratosphere/source/fs/fs_bis.cpp @@ -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(); } diff --git a/libraries/libstratosphere/source/fs/fs_code.cpp b/libraries/libstratosphere/source/fs/fs_code.cpp index 278866d7f..d9a671dbe 100644 --- a/libraries/libstratosphere/source/fs/fs_code.cpp +++ b/libraries/libstratosphere/source/fs/fs_code.cpp @@ -184,54 +184,67 @@ namespace ams::fs { } virtual Result DoOpenDirectory(std::unique_ptr *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(); } }; diff --git a/libraries/libstratosphere/source/fs/fs_context.cpp b/libraries/libstratosphere/source/fs/fs_context.cpp index 1f7c4685c..338478a7e 100644 --- a/libraries/libstratosphere/source/fs/fs_context.cpp +++ b/libraries/libstratosphere/source/fs/fs_context.cpp @@ -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; } diff --git a/libraries/libstratosphere/source/fs/fs_memory_management.cpp b/libraries/libstratosphere/source/fs/fs_memory_management.cpp index eb06f850e..70a71f86f 100644 --- a/libraries/libstratosphere/source/fs/fs_memory_management.cpp +++ b/libraries/libstratosphere/source/fs/fs_memory_management.cpp @@ -27,6 +27,7 @@ namespace ams::fs { } void DefaultDeallocate(void *ptr, size_t size) { + AMS_UNUSED(size); ams::Free(ptr); } diff --git a/libraries/libstratosphere/source/fs/fs_result_utils.cpp b/libraries/libstratosphere/source/fs/fs_result_utils.cpp index 2e7ded3db..94e7da6e7 100644 --- a/libraries/libstratosphere/source/fs/fs_result_utils.cpp +++ b/libraries/libstratosphere/source/fs/fs_result_utils.cpp @@ -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); } } diff --git a/libraries/libstratosphere/source/fs/fs_romfs_filesystem.cpp b/libraries/libstratosphere/source/fs/fs_romfs_filesystem.cpp index 7c8670a3a..2f8da85a4 100644 --- a/libraries/libstratosphere/source/fs/fs_romfs_filesystem.cpp +++ b/libraries/libstratosphere/source/fs/fs_romfs_filesystem.cpp @@ -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(); } diff --git a/libraries/libstratosphere/source/fs/fs_save_data_management.cpp b/libraries/libstratosphere/source/fs/fs_save_data_management.cpp index 14091920c..63d72e769 100644 --- a/libraries/libstratosphere/source/fs/fs_save_data_management.cpp +++ b/libraries/libstratosphere/source/fs/fs_save_data_management.cpp @@ -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(); } diff --git a/libraries/libstratosphere/source/fs/fsa/fs_file_accessor.cpp b/libraries/libstratosphere/source/fs/fsa/fs_file_accessor.cpp index 25f254913..3ea0d08e3 100644 --- a/libraries/libstratosphere/source/fs/fsa/fs_file_accessor.cpp +++ b/libraries/libstratosphere/source/fs/fsa/fs_file_accessor.cpp @@ -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(); } diff --git a/libraries/libstratosphere/source/fssrv/fssrv_file_system_proxy_api.cpp b/libraries/libstratosphere/source/fssrv/fssrv_file_system_proxy_api.cpp index 26c533cb4..0a4fe2d63 100644 --- a/libraries/libstratosphere/source/fssrv/fssrv_file_system_proxy_api.cpp +++ b/libraries/libstratosphere/source/fssrv/fssrv_file_system_proxy_api.cpp @@ -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); } } diff --git a/libraries/libstratosphere/source/fssrv/fssrv_filesystem_interface_adapter.cpp b/libraries/libstratosphere/source/fssrv/fssrv_filesystem_interface_adapter.cpp index d677bec79..cf69c7343 100644 --- a/libraries/libstratosphere/source/fssrv/fssrv_filesystem_interface_adapter.cpp +++ b/libraries/libstratosphere/source/fssrv/fssrv_filesystem_interface_adapter.cpp @@ -123,7 +123,7 @@ namespace ams::fssrv::impl { Result DirectoryInterfaceAdapter::Read(ams::sf::Out 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. */ diff --git a/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_exp_heap.cpp b/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_exp_heap.cpp index 9f20df3b9..ce2b7c989 100644 --- a/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_exp_heap.cpp +++ b/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_exp_heap.cpp @@ -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); diff --git a/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_standard_allocator.cpp b/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_standard_allocator.cpp index 3930b94bf..52d2f876c 100644 --- a/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_standard_allocator.cpp +++ b/libraries/libstratosphere/source/fssrv/fssrv_memory_resource_from_standard_allocator.cpp @@ -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); diff --git a/libraries/libstratosphere/source/fssystem/buffers/fssystem_file_system_buffer_manager.cpp b/libraries/libstratosphere/source/fssystem/buffers/fssystem_file_system_buffer_manager.cpp index 87b6bcf5c..6ecf3244c 100644 --- a/libraries/libstratosphere/source/fssystem/buffers/fssystem_file_system_buffer_manager.cpp +++ b/libraries/libstratosphere/source/fssystem/buffers/fssystem_file_system_buffer_manager.cpp @@ -127,6 +127,8 @@ namespace ams::fssystem { } bool FileSystemBufferManager::CacheHandleTable::UnregisterOldest(uintptr_t *out_address, size_t *out_size, const BufferAttribute &attr, size_t required_size) { + AMS_UNUSED(attr, required_size); + /* Validate pre-conditions. */ AMS_ASSERT(this->entries != nullptr); AMS_ASSERT(out_address != nullptr); diff --git a/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_counter_extended_storage.cpp b/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_counter_extended_storage.cpp index 27d1b9370..db1566142 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_counter_extended_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_counter_extended_storage.cpp @@ -261,6 +261,7 @@ namespace ams::fssystem { AMS_ASSERT(enc_key_size == KeySize); AMS_ASSERT(iv != nullptr); AMS_ASSERT(iv_size == IvSize); + AMS_UNUSED(iv_size); /* Copy the ctr. */ u8 ctr[IvSize]; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_storage.cpp b/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_storage.cpp index e20c9946c..a93e68a53 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_aes_ctr_storage.cpp @@ -22,6 +22,7 @@ namespace ams::fssystem { AMS_ASSERT(dst != nullptr); AMS_ASSERT(dst_size == IvSize); AMS_ASSERT(offset >= 0); + AMS_UNUSED(dst_size); const uintptr_t out_addr = reinterpret_cast(dst); @@ -35,6 +36,7 @@ namespace ams::fssystem { AMS_ASSERT(iv != nullptr); AMS_ASSERT(key_size == KeySize); AMS_ASSERT(iv_size == IvSize); + AMS_UNUSED(key_size, iv_size); std::memcpy(this->key, key, KeySize); std::memcpy(this->iv, iv, IvSize); @@ -127,6 +129,7 @@ namespace ams::fssystem { } Result AesCtrStorage::SetSize(s64 size) { + AMS_UNUSED(size); return fs::ResultUnsupportedOperationInAesCtrStorageA(); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_aes_xts_storage.cpp b/libraries/libstratosphere/source/fssystem/fssystem_aes_xts_storage.cpp index 71b32ba81..78c1a3f68 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_aes_xts_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_aes_xts_storage.cpp @@ -25,6 +25,7 @@ namespace ams::fssystem { AMS_ASSERT(key_size == KeySize); AMS_ASSERT(iv_size == IvSize); AMS_ASSERT(util::IsAligned(this->block_size, AesBlockSize)); + AMS_UNUSED(key_size, iv_size); std::memcpy(this->key[0], key1, KeySize); std::memcpy(this->key[1], key2, KeySize); diff --git a/libraries/libstratosphere/source/fssystem/fssystem_alignment_matching_storage_impl.cpp b/libraries/libstratosphere/source/fssystem/fssystem_alignment_matching_storage_impl.cpp index 79467c53c..c779b669d 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_alignment_matching_storage_impl.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_alignment_matching_storage_impl.cpp @@ -39,6 +39,7 @@ namespace ams::fssystem { Result AlignmentMatchingStorageImpl::Read(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, char *buffer, size_t size) { /* Check preconditions. */ AMS_ASSERT(work_buf_size >= data_alignment); + AMS_UNUSED(work_buf_size); /* Succeed if zero size. */ R_SUCCEED_IF(size == 0); @@ -120,6 +121,7 @@ namespace ams::fssystem { Result AlignmentMatchingStorageImpl::Write(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, const char *buffer, size_t size) { /* Check preconditions. */ AMS_ASSERT(work_buf_size >= data_alignment); + AMS_UNUSED(work_buf_size); /* Succeed if zero size. */ R_SUCCEED_IF(size == 0); diff --git a/libraries/libstratosphere/source/fssystem/fssystem_allocator_utility.cpp b/libraries/libstratosphere/source/fssystem/fssystem_allocator_utility.cpp index da7e31fe0..cb93483c2 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_allocator_utility.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_allocator_utility.cpp @@ -29,6 +29,7 @@ namespace ams::fssystem { } void DefaultDeallocate(void *ptr, size_t size) { + AMS_UNUSED(size); std::free(ptr); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_crypto_configuration.cpp b/libraries/libstratosphere/source/fssystem/fssystem_crypto_configuration.cpp index 657eca96a..f68c4a8c2 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_crypto_configuration.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_crypto_configuration.cpp @@ -130,6 +130,8 @@ namespace ams::fssystem { } void GenerateNcaKey(void *dst, size_t dst_size, const void *src, size_t src_size, s32 key_type, const NcaCryptoConfiguration &cfg) { + AMS_UNUSED(cfg); + R_ABORT_UNLESS(spl::GenerateAesKey(dst, dst_size, GetNcaKekAccessKey(key_type), src, src_size)); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_directory_savedata_filesystem.cpp b/libraries/libstratosphere/source/fssystem/fssystem_directory_savedata_filesystem.cpp index 9f6a003e7..a58af030e 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_directory_savedata_filesystem.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_directory_savedata_filesystem.cpp @@ -240,6 +240,7 @@ namespace ams::fssystem { /* Overridden from IPathResolutionFileSystem but not commands. */ Result DirectorySaveDataFileSystem::DoCommitProvisionally(s64 counter) { /* Nintendo does nothing here. */ + AMS_UNUSED(counter); return ResultSuccess(); } @@ -250,18 +251,22 @@ namespace ams::fssystem { /* Explicitly overridden to be not implemented. */ Result DirectorySaveDataFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) { + AMS_UNUSED(out, path); return fs::ResultNotImplemented(); } Result DirectorySaveDataFileSystem::DoGetTotalSpaceSize(s64 *out, const char *path) { + AMS_UNUSED(out, path); return fs::ResultNotImplemented(); } Result DirectorySaveDataFileSystem::DoGetFileTimeStampRaw(fs::FileTimeStampRaw *out, const char *path) { + AMS_UNUSED(out, path); return fs::ResultNotImplemented(); } Result DirectorySaveDataFileSystem::DoQueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, fs::fsa::QueryId query, const char *path) { + AMS_UNUSED(dst, dst_size, src, src_size, query, path); return fs::ResultNotImplemented(); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.cpp b/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.cpp index 70aff23a7..256a5e95a 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.cpp @@ -38,6 +38,7 @@ namespace ams::fssystem { AMS_ASSERT(layer_count == LayerCount); AMS_ASSERT(util::IsPowerOfTwo(htbs)); AMS_ASSERT(hash_buf != nullptr); + AMS_UNUSED(layer_count); /* Set size tracking members. */ this->hash_target_block_size = htbs; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.hpp b/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.hpp index 0ecb813b2..351219ff1 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.hpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_hierarchical_sha256_storage.hpp @@ -50,6 +50,7 @@ namespace ams::fssystem { } virtual Result SetSize(s64 size) override { + AMS_UNUSED(size); return fs::ResultUnsupportedOperationInHierarchicalSha256StorageA(); } }; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_indirect_storage.cpp b/libraries/libstratosphere/source/fssystem/fssystem_indirect_storage.cpp index 39d545604..91d470d42 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_indirect_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_indirect_storage.cpp @@ -131,6 +131,7 @@ namespace ams::fssystem { /* Operate on our entries. */ R_TRY(this->OperatePerEntry(offset, size, [=](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result { + AMS_UNUSED(cur_offset); R_TRY(storage->OperateRange(dst, dst_size, op_id, data_offset, cur_size, src, src_size)); return ResultSuccess(); })); @@ -155,6 +156,8 @@ namespace ams::fssystem { /* Operate on our entries. */ R_TRY(this->OperatePerEntry(offset, size, [=, &merged_info](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result { + AMS_UNUSED(cur_offset); + fs::QueryRangeInfo cur_info; R_TRY(storage->OperateRange(std::addressof(cur_info), sizeof(cur_info), op_id, data_offset, cur_size, src, src_size)); merged_info.Merge(cur_info); diff --git a/libraries/libstratosphere/source/fssystem/fssystem_key_slot_cache.hpp b/libraries/libstratosphere/source/fssystem/fssystem_key_slot_cache.hpp index 3415fc43a..8ee7cedc9 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_key_slot_cache.hpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_key_slot_cache.hpp @@ -46,6 +46,8 @@ namespace ams::fssystem { bool Contains(const void *key, size_t key_size, s32 key2) const { AMS_ASSERT(key_size == KeySize); + AMS_UNUSED(key_size); + return key2 == this->key2 && std::memcmp(this->key1, key, KeySize) == 0; } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_nca_file_system_driver.cpp b/libraries/libstratosphere/source/fssystem/fssystem_nca_file_system_driver.cpp index ef90841f0..918129e4c 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_nca_file_system_driver.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_nca_file_system_driver.cpp @@ -149,6 +149,7 @@ namespace ams::fssystem { AMS_ASSERT(enc_key_size == KeySize); AMS_ASSERT(iv != nullptr); AMS_ASSERT(iv_size == IvSize); + AMS_UNUSED(iv_size); std::memcpy(this->iv, iv, IvSize); std::memcpy(this->encrypted_key, enc_key, enc_key_size); @@ -221,6 +222,10 @@ namespace ams::fssystem { fs::QueryRangeInfo new_info; new_info.Clear(); new_info.aes_ctr_key_type = static_cast(this->key_index >= 0 ? fs::AesCtrKeyTypeFlag::InternalKeyForHardwareAes : fs::AesCtrKeyTypeFlag::ExternalKeyForHardwareAes); + + /* Merge the new info in. */ + reinterpret_cast(dst)->Merge(new_info); + return ResultSuccess(); } default: { @@ -240,10 +245,12 @@ namespace ams::fssystem { } virtual Result Write(s64 offset, const void *buffer, size_t size) override { + AMS_UNUSED(offset, buffer, size); return fs::ResultUnsupportedOperationInAesCtrStorageExternalA(); } virtual Result SetSize(s64 size) override { + AMS_UNUSED(size); return fs::ResultUnsupportedOperationInAesCtrStorageExternalB(); } }; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp b/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp index f1ac8558b..ff011fbc2 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp @@ -187,6 +187,8 @@ namespace ams::fssystem { void NcaReader::GetRightsId(u8 *dst, size_t dst_size) const { AMS_ASSERT(dst != nullptr); AMS_ASSERT(dst_size >= NcaHeader::RightsIdSize); + AMS_UNUSED(dst_size); + std::memcpy(dst, this->header.rights_id, NcaHeader::RightsIdSize); } @@ -247,6 +249,8 @@ namespace ams::fssystem { AMS_ASSERT(this->body_storage != nullptr); AMS_ASSERT(dst != nullptr); AMS_ASSERT(size >= NcaHeader::EncryptedKeyAreaSize); + AMS_UNUSED(size); + std::memcpy(dst, this->header.encrypted_key_area, NcaHeader::EncryptedKeyAreaSize); } @@ -291,6 +295,8 @@ namespace ams::fssystem { void NcaReader::SetExternalDecryptionKey(const void *src, size_t size) { AMS_ASSERT(src != nullptr); AMS_ASSERT(size == sizeof(this->external_decryption_key)); + AMS_UNUSED(size); + std::memcpy(this->external_decryption_key, src, sizeof(this->external_decryption_key)); } @@ -298,6 +304,7 @@ namespace ams::fssystem { AMS_ASSERT(this->body_storage != nullptr); AMS_ASSERT(dst != nullptr); AMS_ASSERT(dst_size >= sizeof(NcaHeader)); + AMS_UNUSED(dst_size); std::memcpy(dst, std::addressof(this->header), sizeof(NcaHeader)); } @@ -363,6 +370,8 @@ namespace ams::fssystem { AMS_ASSERT(this->IsInitialized()); AMS_ASSERT(dst != nullptr); AMS_ASSERT(dst_size >= sizeof(NcaFsHeader)); + AMS_UNUSED(dst_size); + std::memcpy(dst, std::addressof(this->data), sizeof(NcaFsHeader)); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_partition_file_system.cpp b/libraries/libstratosphere/source/fssystem/fssystem_partition_file_system.cpp index f8b124782..764a69fb5 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_partition_file_system.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_partition_file_system.cpp @@ -22,10 +22,12 @@ namespace ams::fssystem { class PartitionFileSystemDefaultAllocator : public MemoryResource { private: virtual void *AllocateImpl(size_t size, size_t alignment) override { + AMS_UNUSED(alignment); return ::ams::fs::impl::Allocate(size); } virtual void DeallocateImpl(void *buffer, size_t size, size_t alignment) override { + AMS_UNUSED(alignment); ::ams::fs::impl::Deallocate(buffer, size); } @@ -401,46 +403,55 @@ namespace ams::fssystem { template Result PartitionFileSystemCore::DoCleanDirectoryRecursively(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoCreateDirectory(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoCreateFile(const char *path, s64 size, int option) { + AMS_UNUSED(path, size, option); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoDeleteDirectory(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoDeleteDirectoryRecursively(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoDeleteFile(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoRenameDirectory(const char *old_path, const char *new_path) { + AMS_UNUSED(old_path, new_path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoRenameFile(const char *old_path, const char *new_path) { + AMS_UNUSED(old_path, new_path); return fs::ResultUnsupportedOperationInPartitionFileSystemA(); } template Result PartitionFileSystemCore::DoCommitProvisionally(s64 counter) { + AMS_UNUSED(counter); return fs::ResultUnsupportedOperationInPartitionFileSystemB(); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp b/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp index 085ff6d5c..ca2b29e6e 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp @@ -35,7 +35,7 @@ namespace ams::fssystem { if (!this->is_registered) { this->is_registered = true; this->address = addr; - this->size = size; + this->size = sz; } } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_read_only_block_cache_storage.hpp b/libraries/libstratosphere/source/fssystem/fssystem_read_only_block_cache_storage.hpp index 7dd82eb68..efc98f732 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_read_only_block_cache_storage.hpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_read_only_block_cache_storage.hpp @@ -36,6 +36,7 @@ namespace ams::fssystem { AMS_ASSERT(util::IsPowerOfTwo(this->block_size)); AMS_ASSERT(cache_block_count > 0); AMS_ASSERT(buf_size >= static_cast(this->block_size * cache_block_count)); + AMS_UNUSED(buf_size); /* Create a node for each cache block. */ for (auto i = 0; i < cache_block_count; i++) { @@ -128,10 +129,12 @@ namespace ams::fssystem { } virtual Result Write(s64 offset, const void *buffer, size_t size) override { + AMS_UNUSED(offset, buffer, size); return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageA(); } virtual Result SetSize(s64 size) override { + AMS_UNUSED(size); return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageB(); } }; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_romfs_filesystem.cpp b/libraries/libstratosphere/source/fssystem/fssystem_romfs_filesystem.cpp index 523e5ebcb..339b0836c 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_romfs_filesystem.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_romfs_filesystem.cpp @@ -60,9 +60,12 @@ namespace ams::fssystem { } virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override { + AMS_UNUSED(buffer); + bool needs_append; R_TRY(this->DryWrite(std::addressof(needs_append), offset, size, option, fs::OpenMode_Read)); AMS_ASSERT(needs_append == false); + return fs::ResultUnsupportedOperationInRomFsFileA(); } @@ -297,30 +300,37 @@ namespace ams::fssystem { } 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(); } @@ -381,15 +391,19 @@ namespace ams::fssystem { } Result RomFsFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) { + AMS_UNUSED(path); + *out = 0; return ResultSuccess(); } Result RomFsFileSystem::DoCleanDirectoryRecursively(const char *path) { + AMS_UNUSED(path); return fs::ResultUnsupportedOperationInRomFsFileSystemA(); } Result RomFsFileSystem::DoCommitProvisionally(s64 counter) { + AMS_UNUSED(counter); return fs::ResultUnsupportedOperationInRomFsFileSystemB(); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_thread_priority_changer.cpp b/libraries/libstratosphere/source/fssystem/fssystem_thread_priority_changer.cpp index d6f91a4e1..6dc515565 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_thread_priority_changer.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_thread_priority_changer.cpp @@ -19,6 +19,7 @@ namespace ams::fssystem { s32 ScopedThreadPriorityChangerByAccessPriority::GetThreadPriorityByAccessPriority(AccessMode mode) { /* TODO: Actually implement this for real. */ + AMS_UNUSED(mode); return os::GetThreadPriority(os::GetCurrentThread()); } diff --git a/libraries/libstratosphere/source/fssystem/fssystem_utility.cpp b/libraries/libstratosphere/source/fssystem/fssystem_utility.cpp index a164543eb..1a6e4bce9 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_utility.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_utility.cpp @@ -108,12 +108,16 @@ namespace ams::fssystem { return IterateDirectoryRecursively(src_fs, src_path, [&](const char *path, const fs::DirectoryEntry &entry) -> Result { /* On Enter Directory */ + AMS_UNUSED(path); + /* Update path, create new dir. */ std::strncat(dst_path_buf, entry.name, sizeof(dst_path_buf) - strnlen(dst_path_buf, sizeof(dst_path_buf) - 1) - 1); std::strncat(dst_path_buf, "/", sizeof(dst_path_buf) - strnlen(dst_path_buf, sizeof(dst_path_buf) - 1) - 1); return dst_fs->CreateDirectory(dst_path_buf); }, [&](const char *path, const fs::DirectoryEntry &entry) -> Result { /* On Exit Directory */ + AMS_UNUSED(path, entry); + /* Check we have a parent directory. */ const size_t len = strnlen(dst_path_buf, sizeof(dst_path_buf)); R_UNLESS(len >= 2, fs::ResultInvalidPathFormat()); diff --git a/libraries/libstratosphere/source/fssystem/save/fssystem_block_cache_buffered_storage.cpp b/libraries/libstratosphere/source/fssystem/save/fssystem_block_cache_buffered_storage.cpp index 28f1070af..b79c5f6e0 100644 --- a/libraries/libstratosphere/source/fssystem/save/fssystem_block_cache_buffered_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/save/fssystem_block_cache_buffered_storage.cpp @@ -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); diff --git a/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp b/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp index 50a4b6f4e..3c66f7ef9 100644 --- a/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp @@ -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; diff --git a/libraries/libstratosphere/source/fssystem/save/fssystem_integrity_verification_storage.cpp b/libraries/libstratosphere/source/fssystem/save/fssystem_integrity_verification_storage.cpp index 14f4f0b97..c72cc02db 100644 --- a/libraries/libstratosphere/source/fssystem/save/fssystem_integrity_verification_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/save/fssystem_integrity_verification_storage.cpp @@ -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 >> 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 >> 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)); diff --git a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_driver_impl.cpp b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_driver_impl.cpp index 3479ac689..3017400a0 100644 --- a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_driver_impl.cpp +++ b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_driver_impl.cpp @@ -256,41 +256,49 @@ namespace ams::gpio::driver::board::nintendo::nx::impl { Result DriverImpl::SetInterruptEnabled(Pad *pad, bool en) { /* TODO */ + AMS_UNUSED(pad, en); AMS_ABORT(); } Result DriverImpl::GetInterruptStatus(InterruptStatus *out, Pad *pad) { /* TODO */ + AMS_UNUSED(out, pad); AMS_ABORT(); } Result DriverImpl::ClearInterruptStatus(Pad *pad) { /* TODO */ + AMS_UNUSED(pad); AMS_ABORT(); } Result DriverImpl::GetDebounceEnabled(bool *out, Pad *pad) const { /* TODO */ + AMS_UNUSED(out, pad); AMS_ABORT(); } Result DriverImpl::SetDebounceEnabled(Pad *pad, bool en) { + AMS_UNUSED(pad, en); /* TODO */ AMS_ABORT(); } Result DriverImpl::GetDebounceTime(s32 *out_ms, Pad *pad) const { /* TODO */ + AMS_UNUSED(out_ms, pad); AMS_ABORT(); } Result DriverImpl::SetDebounceTime(Pad *pad, s32 ms) { /* TODO */ + AMS_UNUSED(pad, ms); AMS_ABORT(); } Result DriverImpl::GetUnknown22(u32 *out) { /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -301,21 +309,25 @@ namespace ams::gpio::driver::board::nintendo::nx::impl { Result DriverImpl::SetValueForSleepState(Pad *pad, GpioValue value) { /* TODO */ + AMS_UNUSED(pad, value); AMS_ABORT(); } Result DriverImpl::IsWakeEventActive(bool *out, Pad *pad) const { /* TODO */ + AMS_UNUSED(out, pad); AMS_ABORT(); } Result DriverImpl::SetWakeEventActiveFlagSetForDebug(Pad *pad, bool en) { /* TODO */ + AMS_UNUSED(pad, en); AMS_ABORT(); } Result DriverImpl::SetWakePinDebugMode(WakePinDebugMode mode) { /* TODO */ + AMS_UNUSED(mode); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_suspend_handler.cpp b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_suspend_handler.cpp index 1fe3b8052..b8ca333d7 100644 --- a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_suspend_handler.cpp +++ b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_suspend_handler.cpp @@ -28,21 +28,25 @@ namespace ams::gpio::driver::board::nintendo::nx::impl { void SuspendHandler::SetValueForSleepState(TegraPad *pad, GpioValue value) { /* TODO */ + AMS_UNUSED(pad, value); AMS_ABORT(); } Result SuspendHandler::IsWakeEventActive(bool *out, TegraPad *pad) const { /* TODO */ + AMS_UNUSED(out, pad); AMS_ABORT(); } Result SuspendHandler::SetWakeEventActiveFlagSetForDebug(TegraPad *pad, bool en) { /* TODO */ + AMS_UNUSED(pad, en); AMS_ABORT(); } void SuspendHandler::SetWakePinDebugMode(WakePinDebugMode mode) { /* TODO */ + AMS_UNUSED(mode); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_tegra_pad.hpp b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_tegra_pad.hpp index ffefa90a8..735c9f0fe 100644 --- a/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_tegra_pad.hpp +++ b/libraries/libstratosphere/source/gpio/driver/board/nintendo/nx/impl/gpio_tegra_pad.hpp @@ -366,7 +366,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl { void SetParameters(int pad, const PadInfo &i) { Base::SetPadNumber(pad); - this->info = info; + this->info = i; } bool IsLinkedToInterruptBoundPadList() const { diff --git a/libraries/libstratosphere/source/gpio/gpio_remote_manager_impl.hpp b/libraries/libstratosphere/source/gpio/gpio_remote_manager_impl.hpp index 1cfd82dc4..768f6a598 100644 --- a/libraries/libstratosphere/source/gpio/gpio_remote_manager_impl.hpp +++ b/libraries/libstratosphere/source/gpio/gpio_remote_manager_impl.hpp @@ -28,6 +28,7 @@ namespace ams::gpio { /* Actual commands. */ Result OpenSessionForDev(ams::sf::Out> out, s32 pad_descriptor) { /* TODO: libnx bindings */ + AMS_UNUSED(out, pad_descriptor); AMS_ABORT(); } @@ -35,6 +36,7 @@ namespace ams::gpio { Result OpenSessionForTest(ams::sf::Out> out, gpio::GpioPadName pad_name) { /* TODO: libnx bindings */ + AMS_UNUSED(out, pad_name); AMS_ABORT(); } @@ -44,16 +46,19 @@ namespace ams::gpio { Result GetWakeEventActiveFlagSet(ams::sf::Out out) { /* TODO: libnx bindings */ + AMS_UNUSED(out); AMS_ABORT(); } Result SetWakeEventActiveFlagSetForDebug(gpio::GpioPadName pad_name, bool is_enabled) { /* TODO: libnx bindings */ + AMS_UNUSED(pad_name, is_enabled); AMS_ABORT(); } Result SetWakePinDebugMode(s32 mode) { /* TODO: libnx bindings */ + AMS_UNUSED(mode); AMS_ABORT(); } @@ -65,11 +70,13 @@ namespace ams::gpio { Result SetWakeEventActiveFlagSetForDebug2(DeviceCode device_code, bool is_enabled) { /* TODO: libnx bindings */ + AMS_UNUSED(device_code, is_enabled); AMS_ABORT(); } Result SetRetryValues(u32 arg0, u32 arg1) { /* TODO: libnx bindings */ + AMS_UNUSED(arg0, arg1); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/gpio/gpio_remote_pad_session_impl.hpp b/libraries/libstratosphere/source/gpio/gpio_remote_pad_session_impl.hpp index ca650712f..069f5a8e7 100644 --- a/libraries/libstratosphere/source/gpio/gpio_remote_pad_session_impl.hpp +++ b/libraries/libstratosphere/source/gpio/gpio_remote_pad_session_impl.hpp @@ -100,11 +100,13 @@ namespace ams::gpio { Result SetValueForSleepState(gpio::GpioValue value) { /* TODO: libnx bindings. */ + AMS_UNUSED(value); AMS_ABORT(); } Result GetValueForSleepState(ams::sf::Out out) { /* TODO: libnx bindings. */ + AMS_UNUSED(out); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/gpio/server/gpio_server_manager_impl.cpp b/libraries/libstratosphere/source/gpio/server/gpio_server_manager_impl.cpp index 6b4ab4544..f41aff5da 100644 --- a/libraries/libstratosphere/source/gpio/server/gpio_server_manager_impl.cpp +++ b/libraries/libstratosphere/source/gpio/server/gpio_server_manager_impl.cpp @@ -29,6 +29,7 @@ namespace ams::gpio::server { Result ManagerImpl::OpenSessionForDev(ams::sf::Out> out, s32 pad_descriptor) { /* TODO */ + AMS_UNUSED(out, pad_descriptor); AMS_ABORT(); } @@ -38,26 +39,31 @@ namespace ams::gpio::server { Result ManagerImpl::OpenSessionForTest(ams::sf::Out> out, gpio::GpioPadName pad_name) { /* TODO */ + AMS_UNUSED(out, pad_name); AMS_ABORT(); } Result ManagerImpl::IsWakeEventActive(ams::sf::Out out, gpio::GpioPadName pad_name) { /* TODO */ + AMS_UNUSED(out, pad_name); AMS_ABORT(); } Result ManagerImpl::GetWakeEventActiveFlagSet(ams::sf::Out out) { /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } Result ManagerImpl::SetWakeEventActiveFlagSetForDebug(gpio::GpioPadName pad_name, bool is_enabled) { /* TODO */ + AMS_UNUSED(pad_name, is_enabled); AMS_ABORT(); } Result ManagerImpl::SetWakePinDebugMode(s32 mode) { /* TODO */ + AMS_UNUSED(mode); AMS_ABORT(); } @@ -75,16 +81,19 @@ namespace ams::gpio::server { Result ManagerImpl::IsWakeEventActive2(ams::sf::Out out, DeviceCode device_code) { /* TODO */ + AMS_UNUSED(out, device_code); AMS_ABORT(); } Result ManagerImpl::SetWakeEventActiveFlagSetForDebug2(DeviceCode device_code, bool is_enabled) { /* TODO */ + AMS_UNUSED(device_code, is_enabled); AMS_ABORT(); } Result ManagerImpl::SetRetryValues(u32 arg0, u32 arg1) { /* TODO */ + AMS_UNUSED(arg0, arg1); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/gpio/server/gpio_server_pad_session_impl.hpp b/libraries/libstratosphere/source/gpio/server/gpio_server_pad_session_impl.hpp index 0676744ad..fe0989d48 100644 --- a/libraries/libstratosphere/source/gpio/server/gpio_server_pad_session_impl.hpp +++ b/libraries/libstratosphere/source/gpio/server/gpio_server_pad_session_impl.hpp @@ -72,6 +72,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(mode); AMS_ABORT(); } @@ -80,6 +81,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -88,6 +90,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(enable); AMS_ABORT(); } @@ -96,6 +99,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -104,6 +108,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -143,6 +148,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -159,6 +165,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(enable); AMS_ABORT(); } @@ -167,6 +174,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -175,6 +183,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(ms); AMS_ABORT(); } @@ -183,6 +192,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } @@ -191,6 +201,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(value); AMS_ABORT(); } @@ -199,6 +210,7 @@ namespace ams::gpio::server { AMS_ASSERT(this->has_session); /* TODO */ + AMS_UNUSED(out); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/htc/server/driver/htc_htclow_driver.cpp b/libraries/libstratosphere/source/htc/server/driver/htc_htclow_driver.cpp index 064ed4394..48822f71d 100644 --- a/libraries/libstratosphere/source/htc/server/driver/htc_htclow_driver.cpp +++ b/libraries/libstratosphere/source/htc/server/driver/htc_htclow_driver.cpp @@ -36,6 +36,7 @@ namespace ams::htc::server::driver { void HtclowDriver::SetDisconnectionEmulationEnabled(bool en) { /* NOTE: Nintendo ignores the input, here. */ + AMS_UNUSED(en); m_disconnection_emulation_enabled = false; } diff --git a/libraries/libstratosphere/source/htc/server/htc_htc_service_object.cpp b/libraries/libstratosphere/source/htc/server/htc_htc_service_object.cpp index 54fb92525..6d22f2746 100644 --- a/libraries/libstratosphere/source/htc/server/htc_htc_service_object.cpp +++ b/libraries/libstratosphere/source/htc/server/htc_htc_service_object.cpp @@ -69,11 +69,13 @@ namespace ams::htc::server { Result HtcServiceObject::GetHostConnectionEventForSystem(sf::OutCopyHandle out) { /* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */ + AMS_UNUSED(out); AMS_ABORT("HostEventForSystem not implemented."); } Result HtcServiceObject::GetHostDisconnectionEventForSystem(sf::OutCopyHandle out) { /* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */ + AMS_UNUSED(out); AMS_ABORT("HostEventForSystem not implemented."); } @@ -114,41 +116,49 @@ namespace ams::htc::server { Result HtcServiceObject::GetBridgeIpAddress(const sf::OutBuffer &out) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(out); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::GetBridgePort(const sf::OutBuffer &out) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(out); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::SetCradleAttached(bool attached) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(attached); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::GetBridgeSubnetMask(const sf::OutBuffer &out) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(out); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::GetBridgeMacAddress(const sf::OutBuffer &out) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(out); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::SetBridgeIpAddress(const sf::InBuffer &arg) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(arg); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::SetBridgeSubnetMask(const sf::InBuffer &arg) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(arg); AMS_ABORT("HostBridge currently not supported."); } Result HtcServiceObject::SetBridgePort(const sf::InBuffer &arg) { /* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */ + AMS_UNUSED(arg); AMS_ABORT("HostBridge currently not supported."); } diff --git a/libraries/libstratosphere/source/htc/server/htc_power_state_control.cpp b/libraries/libstratosphere/source/htc/server/htc_power_state_control.cpp index ba22d1cad..243cc49ef 100644 --- a/libraries/libstratosphere/source/htc/server/htc_power_state_control.cpp +++ b/libraries/libstratosphere/source/htc/server/htc_power_state_control.cpp @@ -31,6 +31,8 @@ namespace ams::htc::server { } void InitializePowerStateMonitor(htclow::impl::DriverType driver_type, htclow::HtclowManager *htclow_manager) { + AMS_UNUSED(driver_type); + /* Set the htclow manager. */ g_htclow_manager = htclow_manager; diff --git a/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_server.cpp b/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_server.cpp index cc2ac7670..48a11b5a2 100644 --- a/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_server.cpp +++ b/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_server.cpp @@ -135,6 +135,7 @@ namespace ams::htc::server::rpc { Result HtcmiscRpcServer::ProcessSetTargetNameRequest(const char *name, size_t size, u32 task_id) { /* TODO: we need to use settings::fwdbg::SetSettingsItemValue here, but this will require ams support for set:fd re-enable? */ /* Needs some thought. */ + AMS_UNUSED(name, size, task_id); AMS_ABORT("HtcmiscRpcServer::ProcessSetTargetNameRequest"); } diff --git a/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_tasks.cpp b/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_tasks.cpp index 7f0282f87..504ac89b2 100644 --- a/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_tasks.cpp +++ b/libraries/libstratosphere/source/htc/server/rpc/htc_htcmisc_rpc_tasks.cpp @@ -84,6 +84,7 @@ namespace ams::htc::server::rpc { Result GetEnvironmentVariableTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { /* Validate pre-conditions. */ AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket)); + AMS_UNUSED(size); /* Create the packet. */ auto *packet = reinterpret_cast(data); @@ -182,6 +183,7 @@ namespace ams::htc::server::rpc { Result GetEnvironmentVariableLengthTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { /* Validate pre-conditions. */ AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket)); + AMS_UNUSED(size); /* Create the packet. */ auto *packet = reinterpret_cast(data); @@ -257,6 +259,7 @@ namespace ams::htc::server::rpc { Result RunOnHostTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { /* Validate pre-conditions. */ AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket)); + AMS_UNUSED(size); /* Create the packet. */ auto *packet = reinterpret_cast(data); @@ -282,6 +285,10 @@ namespace ams::htc::server::rpc { } Result RunOnHostTask::ProcessResponse(const char *data, size_t size) { + /* Validate pre-conditions. */ + AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket)); + AMS_UNUSED(size); + this->Complete(reinterpret_cast(data)->params[0]); return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_client.hpp b/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_client.hpp index ea5b7066c..7adf7da55 100644 --- a/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_client.hpp +++ b/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_client.hpp @@ -360,6 +360,8 @@ namespace ams::htc::server::rpc { /* Copy the received data. */ AMS_ASSERT(0 <= result_size && result_size <= buffer_size); + AMS_UNUSED(buffer_size); + std::memcpy(buffer, result_buffer, result_size); return ResultSuccess(); diff --git a/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_tasks.hpp b/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_tasks.hpp index 3d0a91979..2ecb519cf 100644 --- a/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_tasks.hpp +++ b/libraries/libstratosphere/source/htc/server/rpc/htc_rpc_tasks.hpp @@ -88,18 +88,22 @@ namespace ams::htc::server::rpc { } virtual Result ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(data, size); return ResultSuccess(); } virtual Result CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(out, data, size, task_id); return ResultSuccess(); } virtual Result ProcessNotification(const char *data, size_t size) { + AMS_UNUSED(data, size); return ResultSuccess(); } virtual Result CreateNotification(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(out, data, size, task_id); return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/htc/tenv/htc_tenv_service.cpp b/libraries/libstratosphere/source/htc/tenv/htc_tenv_service.cpp index 6c834f1f0..f7cda6787 100644 --- a/libraries/libstratosphere/source/htc/tenv/htc_tenv_service.cpp +++ b/libraries/libstratosphere/source/htc/tenv/htc_tenv_service.cpp @@ -20,16 +20,19 @@ namespace ams::htc::tenv { Result Service::GetVariable(sf::Out out_size, const sf::OutBuffer &out_buffer, const htc::tenv::VariableName &name) { /* TODO */ + AMS_UNUSED(out_size, out_buffer, name); AMS_ABORT("Service::GetVariable"); } - Result Service::GetVariableLength(sf::Out out_size,const htc::tenv::VariableName &name) { + Result Service::GetVariableLength(sf::Out out_size, const htc::tenv::VariableName &name) { /* TODO */ + AMS_UNUSED(out_size, name); AMS_ABORT("Service::GetVariableLength"); } Result Service::WaitUntilVariableAvailable(s64 timeout_ms) { /* TODO */ + AMS_UNUSED(timeout_ms); AMS_ABORT("Service::WaitUntilVariableAvailable"); } diff --git a/libraries/libstratosphere/source/htcfs/htcfs_client_impl.cpp b/libraries/libstratosphere/source/htcfs/htcfs_client_impl.cpp index 8e8328f56..fa2defd00 100644 --- a/libraries/libstratosphere/source/htcfs/htcfs_client_impl.cpp +++ b/libraries/libstratosphere/source/htcfs/htcfs_client_impl.cpp @@ -1170,6 +1170,8 @@ namespace ams::htcfs { } Result ClientImpl::ReadFile(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { + AMS_UNUSED(option); + /* Lock ourselves. */ std::scoped_lock lk(m_mutex); @@ -1229,6 +1231,8 @@ namespace ams::htcfs { } Result ClientImpl::ReadFileLarge(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { + AMS_UNUSED(option); + /* Check our buffer size. */ R_UNLESS(util::IsIntValueRepresentable(buffer_size), htcfs::ResultInvalidArgument()); diff --git a/libraries/libstratosphere/source/htclow/ctrl/htclow_ctrl_service.cpp b/libraries/libstratosphere/source/htclow/ctrl/htclow_ctrl_service.cpp index e7db74e09..e270cfdc6 100644 --- a/libraries/libstratosphere/source/htclow/ctrl/htclow_ctrl_service.cpp +++ b/libraries/libstratosphere/source/htclow/ctrl/htclow_ctrl_service.cpp @@ -107,7 +107,7 @@ namespace ams::htclow::ctrl { R_UNLESS(header.body_size == 0, htclow::ResultProtocolError()); break; case HtcctrlPacketType_ReadyFromHost: - R_UNLESS(0 <= header.body_size && header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError()); + R_UNLESS(header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError()); break; default: return htclow::ResultProtocolError(); diff --git a/libraries/libstratosphere/source/htclow/ctrl/htclow_json.cpp b/libraries/libstratosphere/source/htclow/ctrl/htclow_json.cpp index e7ab7bae4..57b7899e4 100644 --- a/libraries/libstratosphere/source/htclow/ctrl/htclow_json.cpp +++ b/libraries/libstratosphere/source/htclow/ctrl/htclow_json.cpp @@ -26,6 +26,8 @@ namespace ams::htclow::ctrl { } bool JsonHandler::Key(const Ch *str, rapidjson::SizeType len, bool copy) { + AMS_UNUSED(len, copy); + if (m_state == State::ParseObject) { if (!util::Strncmp(str, ChannelKey, sizeof(ChannelKey))) { m_state = State::ParseServiceChannels; @@ -45,6 +47,8 @@ namespace ams::htclow::ctrl { } bool JsonHandler::String(const Ch *str, rapidjson::SizeType len, bool copy) { + AMS_UNUSED(len, copy); + if (m_state == State::ParseServiceChannelsArray && *m_num_strings < m_max_strings) { m_strings[(*m_num_strings)++] = str; } diff --git a/libraries/libstratosphere/source/htclow/ctrl/htclow_service_channel_parser.cpp b/libraries/libstratosphere/source/htclow/ctrl/htclow_service_channel_parser.cpp index 2c252512e..bba6ea0a5 100644 --- a/libraries/libstratosphere/source/htclow/ctrl/htclow_service_channel_parser.cpp +++ b/libraries/libstratosphere/source/htclow/ctrl/htclow_service_channel_parser.cpp @@ -24,6 +24,8 @@ namespace ams::htclow::ctrl { constexpr auto JsonParseFlags = rapidjson::kParseTrailingCommasFlag | rapidjson::kParseInsituFlag; void ParseBody(s16 *out_version, const char **out_channels, int *out_num_channels, int max_channels, void *str, size_t str_size) { + AMS_UNUSED(str_size); + /* Create JSON handler. */ JsonHandler json_handler(out_version, out_channels, out_num_channels, max_channels); diff --git a/libraries/libstratosphere/source/htclow/driver/htclow_socket_discovery_manager.cpp b/libraries/libstratosphere/source/htclow/driver/htclow_socket_discovery_manager.cpp index 1c7bffc5f..481616538 100644 --- a/libraries/libstratosphere/source/htclow/driver/htclow_socket_discovery_manager.cpp +++ b/libraries/libstratosphere/source/htclow/driver/htclow_socket_discovery_manager.cpp @@ -59,7 +59,7 @@ namespace ams::htclow::driver { } void SocketDiscoveryManager::OnSocketAcceptBegin(u16 port) { - /* ... */ + AMS_UNUSED(port); } void SocketDiscoveryManager::OnSocketAcceptEnd() { diff --git a/libraries/libstratosphere/source/htclow/driver/htclow_usb_impl.cpp b/libraries/libstratosphere/source/htclow/driver/htclow_usb_impl.cpp index 0a67311fa..905baef45 100644 --- a/libraries/libstratosphere/source/htclow/driver/htclow_usb_impl.cpp +++ b/libraries/libstratosphere/source/htclow/driver/htclow_usb_impl.cpp @@ -272,7 +272,7 @@ namespace ams::htclow::driver { return ResultSuccess(); } - void UsbIndicationThreadFunction(void *arg) { + void UsbIndicationThreadFunction(void *) { /* Get the state change event. */ os::SystemEventType *state_change_event = g_ds_client.GetStateChangeEvent(); diff --git a/libraries/libstratosphere/source/htclow/mux/htclow_mux.cpp b/libraries/libstratosphere/source/htclow/mux/htclow_mux.cpp index 011f5d96d..76795c0d3 100644 --- a/libraries/libstratosphere/source/htclow/mux/htclow_mux.cpp +++ b/libraries/libstratosphere/source/htclow/mux/htclow_mux.cpp @@ -157,6 +157,8 @@ namespace ams::htclow::mux { } bool Mux::IsSendable(PacketType packet_type) const { + AMS_UNUSED(packet_type); + switch (m_state) { case MuxState::Normal: return true; diff --git a/libraries/libstratosphere/source/htcs/client/htcs_session.cpp b/libraries/libstratosphere/source/htcs/client/htcs_session.cpp index 4e9981aca..37e30c1b6 100644 --- a/libraries/libstratosphere/source/htcs/client/htcs_session.cpp +++ b/libraries/libstratosphere/source/htcs/client/htcs_session.cpp @@ -48,13 +48,13 @@ namespace ams::htcs::client { RemoteSocket(::HtcsSocket &s) : m_s(s) { /* ... */ } ~RemoteSocket() { ::htcsCloseSocket(std::addressof(m_s)); } public: - Result Accept(sf::Out out_err, sf::Out> out, sf::Out out_address) { AMS_ABORT("Not Implemented"); } - Result Recv(sf::Out out_err, sf::Out out_size, const sf::OutAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); } - Result Send(sf::Out out_err, sf::Out out_size, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); } - Result RecvLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, s32 unaligned_size_start, s32 unaligned_size_end, s64 aligned_size, sf::CopyHandle &&mem_handle, s32 flags) { AMS_ABORT("Not Implemented"); } - Result SendStartOld(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); } - Result SendLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &start_buffer, const sf::InAutoSelectBuffer &end_buffer, sf::CopyHandle &&mem_handle, s64 aligned_size, s32 flags) { AMS_ABORT("Not Implemented"); } - Result ContinueSendOld(sf::Out out_size, sf::Out out_wait, const sf::InAutoSelectBuffer &buffer, u32 task_id) { AMS_ABORT("Not Implemented"); } + Result Accept(sf::Out out_err, sf::Out> out, sf::Out out_address) { AMS_UNUSED(out_err, out, out_address); AMS_ABORT("Not Implemented"); } + Result Recv(sf::Out out_err, sf::Out out_size, const sf::OutAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, flags); AMS_ABORT("Not Implemented"); } + Result Send(sf::Out out_err, sf::Out out_size, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, flags); AMS_ABORT("Not Implemented"); } + Result RecvLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, s32 unaligned_size_start, s32 unaligned_size_end, s64 aligned_size, sf::CopyHandle &&mem_handle, s32 flags) { AMS_UNUSED(out_task_id, out_event, unaligned_size_start, unaligned_size_end, aligned_size, mem_handle, flags); AMS_ABORT("Not Implemented"); } + Result SendStartOld(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_task_id, out_event, buffer, flags); AMS_ABORT("Not Implemented"); } + Result SendLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &start_buffer, const sf::InAutoSelectBuffer &end_buffer, sf::CopyHandle &&mem_handle, s64 aligned_size, s32 flags) { AMS_UNUSED(out_task_id, out_event, start_buffer, end_buffer, mem_handle, aligned_size, flags); AMS_ABORT("Not Implemented"); } + Result ContinueSendOld(sf::Out out_size, sf::Out out_wait, const sf::InAutoSelectBuffer &buffer, u32 task_id) { AMS_UNUSED(out_size, out_wait, buffer, task_id); AMS_ABORT("Not Implemented"); } Result Close(sf::Out out_err, sf::Out out_res); Result Connect(sf::Out out_err, sf::Out out_res, const htcs::SockAddrHtcs &address); @@ -85,17 +85,17 @@ namespace ams::htcs::client { class RemoteManager { public: - Result Socket(sf::Out out_err, sf::Out out_sock) { AMS_ABORT("Not Implemented"); } - Result Close(sf::Out out_err, sf::Out out_res, s32 desc) { AMS_ABORT("Not Implemented"); } - Result Connect(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_ABORT("Not Implemented"); } - Result Bind(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_ABORT("Not Implemented"); } - Result Listen(sf::Out out_err, sf::Out out_res, s32 desc, s32 backlog_count) { AMS_ABORT("Not Implemented"); } - Result Accept(sf::Out out_err, sf::Out out_res, sf::Out out_address, s32 desc) { AMS_ABORT("Not Implemented"); } - Result Recv(sf::Out out_err, sf::Out out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) { AMS_ABORT("Not Implemented"); } - Result Send(sf::Out out_err, sf::Out out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); } - Result Shutdown(sf::Out out_err, sf::Out out_res, s32 desc, s32 how) { AMS_ABORT("Not Implemented"); } - Result Fcntl(sf::Out out_err, sf::Out out_res, s32 desc, s32 command, s32 value) { AMS_ABORT("Not Implemented"); } - Result CreateSocketOld(sf::Out out_err, sf::Out> out) { AMS_ABORT("Not Implemented"); } + Result Socket(sf::Out out_err, sf::Out out_sock) { AMS_UNUSED(out_err, out_sock); AMS_ABORT("Not Implemented"); } + Result Close(sf::Out out_err, sf::Out out_res, s32 desc) { AMS_UNUSED(out_err, out_res, desc); AMS_ABORT("Not Implemented"); } + Result Connect(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_UNUSED(out_err, out_res, desc, address); AMS_ABORT("Not Implemented"); } + Result Bind(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_UNUSED(out_err, out_res, desc, address); AMS_ABORT("Not Implemented"); } + Result Listen(sf::Out out_err, sf::Out out_res, s32 desc, s32 backlog_count) { AMS_UNUSED(out_err, out_res, desc, backlog_count); AMS_ABORT("Not Implemented"); } + Result Accept(sf::Out out_err, sf::Out out_res, sf::Out out_address, s32 desc) { AMS_UNUSED(out_err, out_res, out_address, desc); AMS_ABORT("Not Implemented"); } + Result Recv(sf::Out out_err, sf::Out out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, desc, flags); AMS_ABORT("Not Implemented"); } + Result Send(sf::Out out_err, sf::Out out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, desc, buffer, flags); AMS_ABORT("Not Implemented"); } + Result Shutdown(sf::Out out_err, sf::Out out_res, s32 desc, s32 how) { AMS_UNUSED(out_err, out_res, desc, how); AMS_ABORT("Not Implemented"); } + Result Fcntl(sf::Out out_err, sf::Out out_res, s32 desc, s32 command, s32 value) { AMS_UNUSED(out_err, out_res, desc, command, value); AMS_ABORT("Not Implemented"); } + Result CreateSocketOld(sf::Out out_err, sf::Out> out) { AMS_UNUSED(out_err, out); AMS_ABORT("Not Implemented"); } Result GetPeerNameAny(sf::Out out); Result GetDefaultHostName(sf::Out out); @@ -129,11 +129,13 @@ namespace ams::htcs::client { Result RemoteManager::RegisterProcessId(const sf::ClientProcessId &client_pid) { /* Handled by libnx init. */ + AMS_UNUSED(client_pid); return ResultSuccess(); } Result RemoteManager::MonitorManager(const sf::ClientProcessId &client_pid) { /* Handled by libnx init. */ + AMS_UNUSED(client_pid); return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/htcs/client/htcs_virtual_socket_collection.cpp b/libraries/libstratosphere/source/htcs/client/htcs_virtual_socket_collection.cpp index ca72f1133..525939c6f 100644 --- a/libraries/libstratosphere/source/htcs/client/htcs_virtual_socket_collection.cpp +++ b/libraries/libstratosphere/source/htcs/client/htcs_virtual_socket_collection.cpp @@ -602,7 +602,7 @@ namespace ams::htcs::client { } void VirtualSocketCollection::SetSize(s32 size) { - /* ... */ + AMS_UNUSED(size); } s32 VirtualSocketCollection::Find(s32 id, s32 *error_code) { diff --git a/libraries/libstratosphere/source/htcs/htcs_socket.cpp b/libraries/libstratosphere/source/htcs/htcs_socket.cpp index ec4b1cb2f..06a70710b 100644 --- a/libraries/libstratosphere/source/htcs/htcs_socket.cpp +++ b/libraries/libstratosphere/source/htcs/htcs_socket.cpp @@ -357,6 +357,8 @@ namespace ams::htcs { } s32 Select(s32 count, FdSet *read, FdSet *write, FdSet *exception, TimeVal *timeout) { + AMS_UNUSED(count); + /* Check that we have a manager. */ AMS_ASSERT(g_manager != nullptr); diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.cpp b/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.cpp index b836c2c1e..df9558137 100644 --- a/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.cpp +++ b/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.cpp @@ -128,6 +128,7 @@ namespace ams::htcs::impl { Result HtcsManagerImpl::SendLargeStart(u32 *out_task_id, os::NativeHandle *out_handle, const char **buffers, const s64 *sizes, s32 count, s32 desc, s32 flags) { /* NOTE: Nintendo aborts here, too. */ + AMS_UNUSED(out_task_id, out_handle, buffers, sizes, count, desc, flags); AMS_ABORT("HtcsManagerImpl::SendLargeStart is not implemented"); } diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_service.cpp b/libraries/libstratosphere/source/htcs/impl/htcs_service.cpp index 3a00947b4..28e3648a1 100644 --- a/libraries/libstratosphere/source/htcs/impl/htcs_service.cpp +++ b/libraries/libstratosphere/source/htcs/impl/htcs_service.cpp @@ -209,6 +209,8 @@ namespace ams::htcs::impl { } Result HtcsService::AcceptResults(s32 *out_err, s32 *out_desc, SockAddrHtcs *out_address, u32 task_id, s32 desc) { + AMS_UNUSED(out_address); + /* Finish the task. */ htcs::SocketError err; s32 ret_desc; @@ -233,6 +235,8 @@ namespace ams::htcs::impl { } Result HtcsService::ReceiveSmallResults(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc) { + AMS_UNUSED(desc); + /* Continue the task. */ m_rpc_client->ReceiveContinue(task_id, buffer, buffer_size); @@ -270,6 +274,7 @@ namespace ams::htcs::impl { } Result HtcsService::SendSmallResults(s32 *out_err, s64 *out_size, u32 task_id, s32 desc) { + AMS_UNUSED(desc); /* Finish the task. */ htcs::SocketError err; R_TRY(m_rpc_client->End(task_id, std::addressof(err), out_size)); diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_accept_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_accept_task.cpp index 3201512ed..8782b2eba 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_accept_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_accept_task.cpp @@ -52,6 +52,8 @@ namespace ams::htcs::impl::rpc { } Result AcceptTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -62,6 +64,8 @@ namespace ams::htcs::impl::rpc { } Result AcceptTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_bind_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_bind_task.cpp index 9149a25f0..27f7f6ec8 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_bind_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_bind_task.cpp @@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc { } Result BindTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc { } Result BindTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_close_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_close_task.cpp index 10c537471..18c31db00 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_close_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_close_task.cpp @@ -44,6 +44,8 @@ namespace ams::htcs::impl::rpc { } Result CloseTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -54,6 +56,8 @@ namespace ams::htcs::impl::rpc { } Result CloseTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_connect_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_connect_task.cpp index 0609e5793..e58682fa6 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_connect_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_connect_task.cpp @@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc { } Result ConnectTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc { } Result ConnectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_fcntl_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_fcntl_task.cpp index 348f7bac1..b004042ce 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_fcntl_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_fcntl_task.cpp @@ -48,6 +48,8 @@ namespace ams::htcs::impl::rpc { } Result FcntlTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -58,6 +60,8 @@ namespace ams::htcs::impl::rpc { } Result FcntlTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_listen_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_listen_task.cpp index eb167394f..1f8d9be6e 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_listen_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_listen_task.cpp @@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc { } Result ListenTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc { } Result ListenTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_small_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_small_task.cpp index 1f8abbe3f..e2c3ef9e5 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_small_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_small_task.cpp @@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc { } Result ReceiveSmallTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -64,6 +66,8 @@ namespace ams::htcs::impl::rpc { } Result ReceiveSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_task.cpp index 4cee43440..3f7d732c5 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_receive_task.cpp @@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc { } Result ReceiveTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -61,6 +63,8 @@ namespace ams::htcs::impl::rpc { } Result ReceiveTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { @@ -85,6 +89,8 @@ namespace ams::htcs::impl::rpc { } Result ReceiveTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_select_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_select_task.cpp index 0ce328fa7..eef41bb54 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_select_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_select_task.cpp @@ -49,7 +49,7 @@ namespace ams::htcs::impl::rpc { AMS_ASSERT(0 <= write_handle_count && write_handle_count < SocketCountMax); AMS_ASSERT(0 <= exception_handle_count && exception_handle_count < SocketCountMax); AMS_ASSERT(handle_count * static_cast(sizeof(s32)) == body_size); - AMS_UNUSED(handle_count); + AMS_UNUSED(handle_count, body_size); /* Set our results. */ m_err = err; @@ -106,6 +106,8 @@ namespace ams::htcs::impl::rpc { } Result SelectTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -116,6 +118,8 @@ namespace ams::htcs::impl::rpc { } Result SelectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Determine the body size. */ const auto handle_count = m_read_handle_count + m_write_handle_count + m_exception_handle_count; const s64 body_size = static_cast(handle_count * sizeof(s32)); diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_small_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_small_task.cpp index 003dc5a3a..62664ebfd 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_small_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_small_task.cpp @@ -86,6 +86,8 @@ namespace ams::htcs::impl::rpc { } Result SendSmallTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -96,6 +98,8 @@ namespace ams::htcs::impl::rpc { } Result SendSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Sanity check our size. */ AMS_ASSERT(sizeof(HtcsRpcPacket) + this->GetBufferSize() <= size); diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_task.cpp index 29d37f10c..760af7736 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_send_task.cpp @@ -81,6 +81,8 @@ namespace ams::htcs::impl::rpc { } Result SendTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -91,6 +93,8 @@ namespace ams::htcs::impl::rpc { } Result SendTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { @@ -115,11 +119,15 @@ namespace ams::htcs::impl::rpc { } Result SendTask::ProcessNotification(const char *data, size_t size) { + AMS_UNUSED(data, size); + this->NotifyDataChannelReady(); return ResultSuccess(); } Result SendTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_shutdown_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_shutdown_task.cpp index 706bf71f4..92b2006d9 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_shutdown_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_shutdown_task.cpp @@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc { } Result ShutdownTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc { } Result ShutdownTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_socket_task.cpp b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_socket_task.cpp index 863f77b9c..8984fc5d3 100644 --- a/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_socket_task.cpp +++ b/libraries/libstratosphere/source/htcs/impl/rpc/htcs_rpc_socket_task.cpp @@ -53,6 +53,8 @@ namespace ams::htcs::impl::rpc { } Result SocketTask::ProcessResponse(const char *data, size_t size) { + AMS_UNUSED(size); + /* Convert the input to a packet. */ auto *packet = reinterpret_cast(data); @@ -66,6 +68,8 @@ namespace ams::htcs::impl::rpc { } Result SocketTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) { + AMS_UNUSED(size); + /* Create the packet. */ auto *packet = reinterpret_cast(data); *packet = { diff --git a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp index 5d47f0ef9..88aacc8cf 100644 --- a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp +++ b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp @@ -66,11 +66,13 @@ namespace ams::htcs::server { Result ManagerServiceObject::RegisterProcessId(const sf::ClientProcessId &client_pid) { /* NOTE: Nintendo does nothing here. */ + AMS_UNUSED(client_pid); return ResultSuccess(); } Result ManagerServiceObject::MonitorManager(const sf::ClientProcessId &client_pid) { /* NOTE: Nintendo does nothing here. */ + AMS_UNUSED(client_pid); return ResultSuccess(); } diff --git a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object_deprecated.cpp b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object_deprecated.cpp index f317a79fe..a32643eed 100644 --- a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object_deprecated.cpp +++ b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object_deprecated.cpp @@ -19,56 +19,56 @@ namespace ams::htcs::server { - #define AMS_HTCS_MANAGER_DEPRECATED_API() AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME) + #define AMS_HTCS_MANAGER_DEPRECATED_API(...) ({ AMS_UNUSED(__VA_ARGS__); AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME); }) Result ManagerServiceObject::Socket(sf::Out out_err, sf::Out out_sock) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_sock); } Result ManagerServiceObject::Close(sf::Out out_err, sf::Out out_res, s32 desc) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc); } Result ManagerServiceObject::Connect(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, address); } Result ManagerServiceObject::Bind(sf::Out out_err, sf::Out out_res, s32 desc, const htcs::SockAddrHtcs &address) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, address); } Result ManagerServiceObject::Listen(sf::Out out_err, sf::Out out_res, s32 desc, s32 backlog_count) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, backlog_count); } Result ManagerServiceObject::Accept(sf::Out out_err, sf::Out out_res, sf::Out out_address, s32 desc) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, out_address, desc); } Result ManagerServiceObject::Recv(sf::Out out_err, sf::Out out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_size, buffer, desc, flags); } Result ManagerServiceObject::Send(sf::Out out_err, sf::Out out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_size, desc, buffer, flags); } Result ManagerServiceObject::Shutdown(sf::Out out_err, sf::Out out_res, s32 desc, s32 how) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, how); } Result ManagerServiceObject::Fcntl(sf::Out out_err, sf::Out out_res, s32 desc, s32 command, s32 value) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, command, value); } } diff --git a/libraries/libstratosphere/source/htcs/server/htcs_socket_service_object_deprecated.cpp b/libraries/libstratosphere/source/htcs/server/htcs_socket_service_object_deprecated.cpp index b804a682d..9421e9d69 100644 --- a/libraries/libstratosphere/source/htcs/server/htcs_socket_service_object_deprecated.cpp +++ b/libraries/libstratosphere/source/htcs/server/htcs_socket_service_object_deprecated.cpp @@ -19,11 +19,11 @@ namespace ams::htcs::server { - #define AMS_HTCS_MANAGER_DEPRECATED_API() AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME) + #define AMS_HTCS_MANAGER_DEPRECATED_API(...) ({ AMS_UNUSED(__VA_ARGS__); AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME); }) Result SocketServiceObject::Accept(sf::Out out_err, sf::Out> out, sf::Out out_address) { /* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */ - AMS_HTCS_MANAGER_DEPRECATED_API(); + AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out, out_address); } } diff --git a/libraries/libstratosphere/source/i2c/driver/board/nintendo/nx/impl/i2c_bus_accessor.cpp b/libraries/libstratosphere/source/i2c/driver/board/nintendo/nx/impl/i2c_bus_accessor.cpp index 55202630b..4b2a5346b 100644 --- a/libraries/libstratosphere/source/i2c/driver/board/nintendo/nx/impl/i2c_bus_accessor.cpp +++ b/libraries/libstratosphere/source/i2c/driver/board/nintendo/nx/impl/i2c_bus_accessor.cpp @@ -89,6 +89,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl { /* Check that the device is valid. */ AMS_ASSERT(device != nullptr); AMS_ASSERT(this->state == State::Initialized); + AMS_UNUSED(device); /* Acquire exclusive access. */ std::scoped_lock lk(this->user_count_mutex); @@ -144,6 +145,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl { /* Check that the device is valid. */ AMS_ASSERT(device != nullptr); AMS_ASSERT(this->state == State::Initialized); + AMS_UNUSED(device); /* Acquire exclusive access. */ std::scoped_lock lk(this->user_count_mutex); diff --git a/libraries/libstratosphere/source/i2c/driver/impl/i2c_i2c_session_impl.cpp b/libraries/libstratosphere/source/i2c/driver/impl/i2c_i2c_session_impl.cpp index f1850d005..745217313 100644 --- a/libraries/libstratosphere/source/i2c/driver/impl/i2c_i2c_session_impl.cpp +++ b/libraries/libstratosphere/source/i2c/driver/impl/i2c_i2c_session_impl.cpp @@ -22,7 +22,7 @@ namespace ams::i2c::driver::impl { namespace { constexpr TransactionOption EncodeTransactionOption(bool start, bool stop) { - return static_cast((start ? TransactionOption_StartCondition : 0) | (stop ? TransactionOption_StopCondition : 0)); + return static_cast((start ? util::ToUnderlying(TransactionOption_StartCondition) : 0) | (stop ? util::ToUnderlying(TransactionOption_StopCondition) : 0)); } } @@ -66,6 +66,8 @@ namespace ams::i2c::driver::impl { } Result I2cSessionImpl::SendHandler(const u8 **cur_cmd, u8 **cur_dst) { + AMS_UNUSED(cur_dst); + /* Read the header bytes. */ const util::BitPack8 hdr0{*((*cur_cmd)++)}; const util::BitPack8 hdr1{*((*cur_cmd)++)}; @@ -104,6 +106,8 @@ namespace ams::i2c::driver::impl { } Result I2cSessionImpl::ExtensionHandler(const u8 **cur_cmd, u8 **cur_dst) { + AMS_UNUSED(cur_dst); + /* Read the header bytes. */ const util::BitPack8 hdr0{*((*cur_cmd)++)}; @@ -167,6 +171,8 @@ namespace ams::i2c::driver::impl { } Result I2cSessionImpl::ExecuteCommandList(void *dst, size_t dst_size, const void *src, size_t src_size) { + AMS_UNUSED(dst_size); + /* Acquire exclusive access to the device. */ std::scoped_lock lk(this->GetDevice().SafeCastTo().GetDriver().SafeCastTo().GetTransactionOrderMutex()); diff --git a/libraries/libstratosphere/source/i2c/i2c_client_api.cpp b/libraries/libstratosphere/source/i2c/i2c_client_api.cpp index 00c93fa77..c8fdf8b3f 100644 --- a/libraries/libstratosphere/source/i2c/i2c_client_api.cpp +++ b/libraries/libstratosphere/source/i2c/i2c_client_api.cpp @@ -59,7 +59,7 @@ namespace ams::i2c { { std::scoped_lock lk(g_i2c_pcv_mutex); - g_i2c_pcv_manager = std::move(sp); + g_i2c_pcv_manager = std::move(sp_pcv); AMS_ABORT_UNLESS(g_i2c_pcv_count == 0); g_i2c_pcv_count = 1; } diff --git a/libraries/libstratosphere/source/i2c/server/i2c_server_manager_impl.cpp b/libraries/libstratosphere/source/i2c/server/i2c_server_manager_impl.cpp index 9ec42cdc2..b0c1e6509 100644 --- a/libraries/libstratosphere/source/i2c/server/i2c_server_manager_impl.cpp +++ b/libraries/libstratosphere/source/i2c/server/i2c_server_manager_impl.cpp @@ -29,6 +29,7 @@ namespace ams::i2c::server { Result ManagerImpl::OpenSessionForDev(ams::sf::Out> out, s32 bus_idx, u16 slave_address, i2c::AddressingMode addressing_mode, i2c::SpeedMode speed_mode) { /* TODO */ + AMS_UNUSED(out, bus_idx, slave_address, addressing_mode, speed_mode); AMS_ABORT(); } @@ -38,11 +39,13 @@ namespace ams::i2c::server { Result ManagerImpl::HasDevice(ams::sf::Out out, i2c::I2cDevice device) { /* TODO */ + AMS_UNUSED(out, device); AMS_ABORT(); } Result ManagerImpl::HasDeviceForDev(ams::sf::Out out, i2c::I2cDevice device) { /* TODO */ + AMS_UNUSED(out, device); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/lm/lm_remote_log_service.cpp b/libraries/libstratosphere/source/lm/lm_remote_log_service.cpp index 7eac16f54..9ea31ee99 100644 --- a/libraries/libstratosphere/source/lm/lm_remote_log_service.cpp +++ b/libraries/libstratosphere/source/lm/lm_remote_log_service.cpp @@ -35,11 +35,16 @@ namespace ams::lm { } Result RemoteLogService::OpenLogger(sf::Out> out, const sf::ClientProcessId &client_process_id) { + AMS_UNUSED(client_process_id); + /* Send libnx command. */ ::Service logger_srv; { + u64 pid_placeholder; + #define NX_SERVICE_ASSUME_NON_DOMAIN - R_TRY(serviceDispatch(&m_srv, 0, + R_TRY(serviceDispatchIn(&m_srv, 0, pid_placeholder, + .in_send_pid = true, .out_num_objects = 1, .out_objects = &logger_srv, )); diff --git a/libraries/libstratosphere/source/lm/srv/lm_flush_thread.cpp b/libraries/libstratosphere/source/lm/srv/lm_flush_thread.cpp index 2a810f544..b8c966c3f 100644 --- a/libraries/libstratosphere/source/lm/srv/lm_flush_thread.cpp +++ b/libraries/libstratosphere/source/lm/srv/lm_flush_thread.cpp @@ -44,6 +44,7 @@ namespace ams::lm::srv { } void DeallocateForFs(void *ptr, size_t size) { + AMS_UNUSED(size); return lmem::FreeToExpHeap(g_fs_heap_handle, ptr); } diff --git a/libraries/libstratosphere/source/lm/srv/lm_logger_impl.cpp b/libraries/libstratosphere/source/lm/srv/lm_logger_impl.cpp index 11f6a564c..4eef1e785 100644 --- a/libraries/libstratosphere/source/lm/srv/lm_logger_impl.cpp +++ b/libraries/libstratosphere/source/lm/srv/lm_logger_impl.cpp @@ -91,6 +91,10 @@ namespace ams::lm::srv { diag::impl::PutImpl(meta, txt, size); }, const_cast(std::addressof(log_meta))); } + #else + { + AMS_UNUSED(message); + } #endif } diff --git a/libraries/libstratosphere/source/lmem/impl/lmem_impl_common_heap.cpp b/libraries/libstratosphere/source/lmem/impl/lmem_impl_common_heap.cpp index f34085e0a..8a9042089 100644 --- a/libraries/libstratosphere/source/lmem/impl/lmem_impl_common_heap.cpp +++ b/libraries/libstratosphere/source/lmem/impl/lmem_impl_common_heap.cpp @@ -45,6 +45,7 @@ namespace ams::lmem::impl { void FinalizeHeap(HeapHead *heap) { /* Nothing actually needs to be done here. */ + AMS_UNUSED(heap); } bool ContainsAddress(HeapHandle handle, const void *address) { diff --git a/libraries/libstratosphere/source/lmem/impl/lmem_impl_unit_heap.cpp b/libraries/libstratosphere/source/lmem/impl/lmem_impl_unit_heap.cpp index c863fdd9e..f08763b85 100644 --- a/libraries/libstratosphere/source/lmem/impl/lmem_impl_unit_heap.cpp +++ b/libraries/libstratosphere/source/lmem/impl/lmem_impl_unit_heap.cpp @@ -257,7 +257,7 @@ namespace ams::lmem::impl { AMS_ASSERT(static_cast(MinimumAlignment) <= alignment); AMS_ASSERT(unit_size >= sizeof(uintptr_t)); - return (alignment - 1) + util::AlignUp(unit_size, alignment) + (internal_metadata ? sizeof(HeapHead) : 0); + return (alignment - 1) + (unit_count * util::AlignUp(unit_size, alignment)) + (internal_metadata ? sizeof(HeapHead) : 0); } } diff --git a/libraries/libstratosphere/source/lr/lr_api.cpp b/libraries/libstratosphere/source/lr/lr_api.cpp index f7156ca2e..a952b0cec 100644 --- a/libraries/libstratosphere/source/lr/lr_api.cpp +++ b/libraries/libstratosphere/source/lr/lr_api.cpp @@ -68,11 +68,13 @@ namespace ams::lr { Result OpenAddOnContentLocationResolver(AddOnContentLocationResolver *out) { /* TODO: libnx binding */ + AMS_UNUSED(out); AMS_ABORT(); } Result RefreshLocationResolver(ncm::StorageId storage_id) { /* TODO: libnx binding */ + AMS_UNUSED(storage_id); AMS_ABORT(); } } diff --git a/libraries/libstratosphere/source/lr/lr_redirect_only_location_resolver_impl.cpp b/libraries/libstratosphere/source/lr/lr_redirect_only_location_resolver_impl.cpp index 935c5641b..98c1473f1 100644 --- a/libraries/libstratosphere/source/lr/lr_redirect_only_location_resolver_impl.cpp +++ b/libraries/libstratosphere/source/lr/lr_redirect_only_location_resolver_impl.cpp @@ -44,7 +44,8 @@ namespace ams::lr { } Result RedirectOnlyLocationResolverImpl::ResolveDataPath(sf::Out out, ncm::DataId id) { - return ResultDataNotFound(); + AMS_UNUSED(out, id); + return lr::ResultDataNotFound(); } Result RedirectOnlyLocationResolverImpl::RedirectApplicationControlPathDeprecated(const Path &path, ncm::ProgramId id) { diff --git a/libraries/libstratosphere/source/lr/lr_remote_location_resolver_impl.hpp b/libraries/libstratosphere/source/lr/lr_remote_location_resolver_impl.hpp index 67ce0489b..9b8c67161 100644 --- a/libraries/libstratosphere/source/lr/lr_remote_location_resolver_impl.hpp +++ b/libraries/libstratosphere/source/lr/lr_remote_location_resolver_impl.hpp @@ -81,11 +81,13 @@ namespace ams::lr { Result RedirectApplicationProgramPathDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RedirectApplicationProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } @@ -96,6 +98,7 @@ namespace ams::lr { Result ClearApplicationRedirection(const sf::InArray &excluding_ids) { /* TODO: libnx bindings */ + AMS_UNUSED(excluding_ids); AMS_ABORT(); } @@ -105,41 +108,49 @@ namespace ams::lr { Result EraseApplicationControlRedirection(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } Result EraseApplicationHtmlDocumentRedirection(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } Result EraseApplicationLegalInformationRedirection(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } Result ResolveProgramPathForDebug(sf::Out out, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(out, id); AMS_ABORT(); } Result RedirectProgramPathForDebug(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RedirectApplicationProgramPathForDebugDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RedirectApplicationProgramPathForDebug(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } Result EraseProgramRedirectionForDebug(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/lr/lr_remote_registered_location_resolver_impl.hpp b/libraries/libstratosphere/source/lr/lr_remote_registered_location_resolver_impl.hpp index 78c7d9d08..1f0ff9afc 100644 --- a/libraries/libstratosphere/source/lr/lr_remote_registered_location_resolver_impl.hpp +++ b/libraries/libstratosphere/source/lr/lr_remote_registered_location_resolver_impl.hpp @@ -34,56 +34,67 @@ namespace ams::lr { Result RegisterProgramPathDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RegisterProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } Result UnregisterProgramPath(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } Result RedirectProgramPathDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RedirectProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } Result ResolveHtmlDocumentPath(sf::Out out, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(out, id); AMS_ABORT(); } Result RegisterHtmlDocumentPathDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RegisterHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } Result UnregisterHtmlDocumentPath(ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(id); AMS_ABORT(); } Result RedirectHtmlDocumentPathDeprecated(const Path &path, ncm::ProgramId id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id); AMS_ABORT(); } Result RedirectHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) { /* TODO: libnx bindings */ + AMS_UNUSED(path, id, owner_id); AMS_ABORT(); } @@ -94,6 +105,7 @@ namespace ams::lr { Result RefreshExcluding(const sf::InArray &ids) { /* TODO: libnx bindings */ + AMS_UNUSED(ids); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_central_heap.cpp b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_central_heap.cpp index dd09997a5..6bc297b27 100644 --- a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_central_heap.cpp +++ b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_central_heap.cpp @@ -185,7 +185,7 @@ namespace ams::mem::impl::heap { if (cls_from_ptr) { if (cls_from_ptr <= 0) { return EFAULT; - } else if (cls_from_size && cls_from_size <= cls_from_ptr) { + } else if (cls_from_size && static_cast(cls_from_size) <= cls_from_ptr) { *p = ptr; return 0; } else { @@ -225,7 +225,7 @@ namespace ams::mem::impl::heap { if (cls_from_ptr) { if (cls_from_ptr <= 0) { return EFAULT; - } else if (cls_from_size && cls_from_size <= cls_from_ptr) { + } else if (cls_from_size && static_cast(cls_from_size) <= cls_from_ptr) { return 0; } else { return EINVAL; diff --git a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_cache.cpp b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_cache.cpp index 080722c78..3e730bc3f 100644 --- a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_cache.cpp +++ b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_cache.cpp @@ -289,14 +289,14 @@ namespace ams::mem::impl::heap { template<> errno_t TlsHeapCache::FreeImpl(TlsHeapCache *_this, void *ptr) { - const size_t cls = _this->central->GetClassFromPointer(ptr); + const auto cls = _this->central->GetClassFromPointer(ptr); if (cls == 0) { return _this->central->UncacheLargeMemory(ptr); } AMS_ASSERT(cls < TlsHeapStatic::NumClassInfo); - if (static_cast(cls) >= 0) { + if (cls >= 0) { return _this->central->UncacheSmallMemory(ptr); } else if (ptr == nullptr) { return 0; @@ -307,14 +307,14 @@ namespace ams::mem::impl::heap { template<> errno_t TlsHeapCache::FreeImpl(TlsHeapCache *_this, void *ptr) { - const size_t cls = _this->central->GetClassFromPointer(ptr); + const auto cls = _this->central->GetClassFromPointer(ptr); if (cls == 0) { return _this->central->UncacheLargeMemory(ptr); } AMS_ASSERT(cls < TlsHeapStatic::NumClassInfo); - if (static_cast(cls) >= 0) { + if (cls >= 0) { *reinterpret_cast(ptr) = _this->small_mem_lists[cls]; _this->small_mem_lists[cls] = _this->ManglePointer(ptr); diff --git a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.cpp b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.cpp index 1e2148f1b..ed9ae33e7 100644 --- a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.cpp +++ b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.cpp @@ -918,6 +918,8 @@ namespace ams::mem::impl::heap { } errno_t TlsHeapCentral::AllocatePhysical(void *start, size_t size) { + /* TODO: Implement physical tls heap central logic. */ + AMS_UNUSED(start, size); return 0; } @@ -1419,6 +1421,7 @@ namespace ams::mem::impl::heap { } /* TODO: Is this worth supporting? */ + AMS_UNUSED(out_free_size, out_max_allocatable_size); return EOPNOTSUPP; } @@ -1494,6 +1497,7 @@ namespace ams::mem::impl::heap { } void TlsHeapCentral::DumpImpl(DumpMode dump_mode, int fd, bool json) { + AMS_UNUSED(dump_mode, fd, json); AMS_ABORT("Not yet implemented"); } diff --git a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.hpp b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.hpp index 228a19585..288f934be 100644 --- a/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.hpp +++ b/libraries/libstratosphere/source/mem/impl/heap/mem_impl_heap_tls_heap_central.hpp @@ -221,6 +221,8 @@ namespace ams::mem::impl::heap { void CalculateHeapHash(HeapHash *out); errno_t AddThreadCache(TlsHeapCache *cache) { + AMS_UNUSED(cache); + std::scoped_lock lk(this->lock); /* Add thread and recalculate. */ @@ -231,6 +233,8 @@ namespace ams::mem::impl::heap { } errno_t RemoveThreadCache(TlsHeapCache *cache) { + AMS_UNUSED(cache); + std::scoped_lock lk(this->lock); /* Remove thread and recalculate. */ @@ -290,7 +294,7 @@ namespace ams::mem::impl::heap { getcpu(std::addressof(cpu_id)); } - return this->CacheSmallMemoryListImpl(cache, cls, count, p, cpu_id, 0); + return this->CacheSmallMemoryListImpl(cache, cls, count, p, cpu_id, align); } bool CheckCachedSize(s32 size) const { @@ -321,7 +325,7 @@ namespace ams::mem::impl::heap { } } - size_t GetClassFromPointer(const void *ptr) { + s32 GetClassFromPointer(const void *ptr) { std::atomic_thread_fence(std::memory_order_acquire); const size_t idx = (reinterpret_cast(ptr) - reinterpret_cast(this)) / TlsHeapStatic::PageSize; @@ -338,7 +342,7 @@ namespace ams::mem::impl::heap { return this->span_table.pageclass_cache[idx]; } else { /* TODO: Handle error? */ - return 0xFFFFFFFF; + return -1; } } diff --git a/libraries/libstratosphere/source/mem/impl/mem_impl_platform.os.horizon.cpp b/libraries/libstratosphere/source/mem/impl/mem_impl_platform.os.horizon.cpp index ceb76fd7c..4dcb31655 100644 --- a/libraries/libstratosphere/source/mem/impl/mem_impl_platform.os.horizon.cpp +++ b/libraries/libstratosphere/source/mem/impl/mem_impl_platform.os.horizon.cpp @@ -25,10 +25,16 @@ namespace ams::mem::impl { constinit bool g_virt_mem_enabled = false; void EnsureVirtualAddressMemoryDetected() { - std::scoped_lock lk(g_virt_mem_enabled_lock); if (AMS_LIKELY(g_virt_mem_enabled_detected)) { return; } + + std::scoped_lock lk(g_virt_mem_enabled_lock); + + if (AMS_UNLIKELY(g_virt_mem_enabled_detected)) { + return; + } + g_virt_mem_enabled = os::IsVirtualAddressMemoryEnabled(); } @@ -64,6 +70,7 @@ namespace ams::mem::impl { uintptr_t addr; if (IsVirtualAddressMemoryEnabled()) { /* TODO: Support virtual address memory. */ + AMS_UNUSED(ptr); AMS_ABORT("Virtual address memory not supported yet"); } else { if (auto err = ConvertResult(os::AllocateMemoryBlock(std::addressof(addr), util::AlignUp(size, os::MemoryBlockUnitSize))); err != 0) { diff --git a/libraries/libstratosphere/source/ncm/ncm_content_meta.cpp b/libraries/libstratosphere/source/ncm/ncm_content_meta.cpp index 6ac3245f0..6d6143ab0 100644 --- a/libraries/libstratosphere/source/ncm/ncm_content_meta.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_content_meta.cpp @@ -232,7 +232,8 @@ namespace ams::ncm { auto fragment_count = CountContentExceptForMeta(reader, index); /* Recalculate. */ - return CalculateSizeImpl(this->GetExtendedHeaderSize(), fragment_count + 1, 0, this->GetExtendedDataSize(), false); + *out_size = CalculateSizeImpl(this->GetExtendedHeaderSize(), fragment_count + 1, 0, this->GetExtendedDataSize(), false); + return ResultSuccess(); } void PackagedContentMetaReader::ConvertToContentMeta(void *dst, size_t size, const ContentInfo &meta) { diff --git a/libraries/libstratosphere/source/ncm/ncm_content_storage_impl.cpp b/libraries/libstratosphere/source/ncm/ncm_content_storage_impl.cpp index 326b30868..284bd7114 100644 --- a/libraries/libstratosphere/source/ncm/ncm_content_storage_impl.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_content_storage_impl.cpp @@ -526,6 +526,8 @@ namespace ams::ncm { /* Traverse the placeholder base directory finding valid placeholder files. */ R_TRY(TraverseDirectory(placeholder_dir, placeholder_accessor.GetHierarchicalDirectoryDepth(), [&](bool *should_continue, bool *should_retry_dir_read, const char *current_path, const fs::DirectoryEntry &entry) -> Result { + AMS_UNUSED(current_path); + *should_continue = true; *should_retry_dir_read = false; @@ -559,6 +561,8 @@ namespace ams::ncm { /* Traverse the content base directory finding all files. */ R_TRY(TraverseDirectory(path, depth, [&](bool *should_continue, bool *should_retry_dir_read, const char *current_path, const fs::DirectoryEntry &entry) -> Result { + AMS_UNUSED(current_path); + *should_continue = true; *should_retry_dir_read = false; @@ -898,6 +902,7 @@ namespace ams::ncm { } Result ContentStorageImpl::RegisterPath(const ContentId &content_id, const Path &path) { + AMS_UNUSED(content_id, path); return ncm::ResultInvalidOperation(); } diff --git a/libraries/libstratosphere/source/ncm/ncm_host_content_storage_impl.cpp b/libraries/libstratosphere/source/ncm/ncm_host_content_storage_impl.cpp index 4289f562a..3e92b5bde 100644 --- a/libraries/libstratosphere/source/ncm/ncm_host_content_storage_impl.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_host_content_storage_impl.cpp @@ -19,30 +19,37 @@ namespace ams::ncm { Result HostContentStorageImpl::GeneratePlaceHolderId(sf::Out out) { + AMS_UNUSED(out); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, s64 size) { + AMS_UNUSED(placeholder_id, content_id, size); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::DeletePlaceHolder(PlaceHolderId placeholder_id) { + AMS_UNUSED(placeholder_id); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::HasPlaceHolder(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::WritePlaceHolder(PlaceHolderId placeholder_id, s64 offset, const sf::InBuffer &data) { + AMS_UNUSED(placeholder_id, offset, data); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::Register(PlaceHolderId placeholder_id, ContentId content_id) { + AMS_UNUSED(placeholder_id, content_id); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::Delete(ContentId content_id) { + AMS_UNUSED(content_id); return ncm::ResultNotSupported(); } @@ -69,6 +76,7 @@ namespace ams::ncm { } Result HostContentStorageImpl::GetPlaceHolderPath(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } @@ -77,18 +85,22 @@ namespace ams::ncm { } Result HostContentStorageImpl::ListPlaceHolder(sf::Out out_count, const sf::OutArray &out_buf) { + AMS_UNUSED(out_count, out_buf); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::GetContentCount(sf::Out out_count) { + AMS_UNUSED(out_count); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::ListContentId(sf::Out out_count, const sf::OutArray &out_buf, s32 offset) { + AMS_UNUSED(out_count, out_buf, offset); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::GetSizeFromContentId(sf::Out out_size, ContentId content_id) { + AMS_UNUSED(out_size, content_id); return ncm::ResultInvalidOperation(); } @@ -98,22 +110,27 @@ namespace ams::ncm { } Result HostContentStorageImpl::RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) { + AMS_UNUSED(placeholder_id, old_content_id, new_content_id); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::SetPlaceHolderSize(PlaceHolderId placeholder_id, s64 size) { + AMS_UNUSED(placeholder_id, size); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::ReadContentIdFile(const sf::OutBuffer &buf, ContentId content_id, s64 offset) { + AMS_UNUSED(buf, content_id, offset); return ncm::ResultInvalidOperation(); } Result HostContentStorageImpl::GetRightsIdFromPlaceHolderIdDeprecated(sf::Out out_rights_id, PlaceHolderId placeholder_id) { + AMS_UNUSED(out_rights_id, placeholder_id); return ncm::ResultNotSupported(); } Result HostContentStorageImpl::GetRightsIdFromPlaceHolderId(sf::Out out_rights_id, PlaceHolderId placeholder_id) { + AMS_UNUSED(out_rights_id, placeholder_id); return ncm::ResultNotSupported(); } @@ -133,7 +150,7 @@ namespace ams::ncm { /* Get the content path. */ Path path; R_TRY(this->registered_content->GetPath(std::addressof(path), content_id)); - + /* Acquire the rights id for the content. */ RightsId rights_id; R_TRY_CATCH(GetRightsId(std::addressof(rights_id), path)) { @@ -150,6 +167,7 @@ namespace ams::ncm { } Result HostContentStorageImpl::WriteContentForDebug(ContentId content_id, s64 offset, const sf::InBuffer &data) { + AMS_UNUSED(content_id, offset, data); return ncm::ResultNotSupported(); } @@ -168,6 +186,7 @@ namespace ams::ncm { } Result HostContentStorageImpl::GetSizeFromPlaceHolderId(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } @@ -176,6 +195,7 @@ namespace ams::ncm { } Result HostContentStorageImpl::GetRightsIdFromPlaceHolderIdWithCache(sf::Out out_rights_id, PlaceHolderId placeholder_id, ContentId cache_content_id) { + AMS_UNUSED(out_rights_id, placeholder_id, cache_content_id); return ncm::ResultNotSupported(); } diff --git a/libraries/libstratosphere/source/ncm/ncm_on_memory_content_meta_database_impl.cpp b/libraries/libstratosphere/source/ncm/ncm_on_memory_content_meta_database_impl.cpp index ee0b13504..774a5d79a 100644 --- a/libraries/libstratosphere/source/ncm/ncm_on_memory_content_meta_database_impl.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_on_memory_content_meta_database_impl.cpp @@ -88,6 +88,7 @@ namespace ams::ncm { } Result OnMemoryContentMetaDatabaseImpl::LookupOrphanContent(const sf::OutArray &out_orphaned, const sf::InArray &content_ids) { + AMS_UNUSED(out_orphaned, content_ids); return ResultInvalidContentMetaDatabase(); } diff --git a/libraries/libstratosphere/source/ncm/ncm_package_install_task.cpp b/libraries/libstratosphere/source/ncm/ncm_package_install_task.cpp index eb1ebbb34..b4ac9cee6 100644 --- a/libraries/libstratosphere/source/ncm/ncm_package_install_task.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_package_install_task.cpp @@ -27,6 +27,7 @@ namespace ams::ncm { } Result PackageInstallTask::GetInstallContentMetaInfo(InstallContentMetaInfo *out_info, const ContentMetaKey &key) { + AMS_UNUSED(out_info, key); return ncm::ResultContentNotFound(); } @@ -41,7 +42,7 @@ namespace ams::ncm { s64 count; fs::DirectoryEntry entry; R_TRY(fs::ReadDirectory(std::addressof(count), std::addressof(entry), dir, 1)); - + /* No more entries remain, we are done. */ if (count == 0) { break; diff --git a/libraries/libstratosphere/source/ncm/ncm_package_install_task_base.cpp b/libraries/libstratosphere/source/ncm/ncm_package_install_task_base.cpp index 7807dee53..379ad19ad 100644 --- a/libraries/libstratosphere/source/ncm/ncm_package_install_task_base.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_package_install_task_base.cpp @@ -26,6 +26,9 @@ namespace ams::ncm { } Result PackageInstallTaskBase::OnWritePlaceHolder(const ContentMetaKey &key, InstallContentInfo *content_info) { + AMS_UNUSED(key); + + /* Get the file path. */ PackagePath path; if (content_info->GetType() == ContentType::Meta) { this->CreateContentMetaPath(std::addressof(path), content_info->GetId()); @@ -57,6 +60,8 @@ namespace ams::ncm { } Result PackageInstallTaskBase::InstallTicket(const fs::RightsId &rights_id, ContentMetaType meta_type) { + AMS_UNUSED(meta_type); + /* Read ticket from file. */ s64 ticket_size; std::unique_ptr ticket; diff --git a/libraries/libstratosphere/source/ncm/ncm_read_only_content_storage_impl.cpp b/libraries/libstratosphere/source/ncm/ncm_read_only_content_storage_impl.cpp index 93726ab02..cb9e23249 100644 --- a/libraries/libstratosphere/source/ncm/ncm_read_only_content_storage_impl.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_read_only_content_storage_impl.cpp @@ -61,30 +61,37 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::GeneratePlaceHolderId(sf::Out out) { + AMS_UNUSED(out); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, s64 size) { + AMS_UNUSED(placeholder_id, content_id, size); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::DeletePlaceHolder(PlaceHolderId placeholder_id) { + AMS_UNUSED(placeholder_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::HasPlaceHolder(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::WritePlaceHolder(PlaceHolderId placeholder_id, s64 offset, const sf::InBuffer &data) { + AMS_UNUSED(placeholder_id, offset, data); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::Register(PlaceHolderId placeholder_id, ContentId content_id) { + AMS_UNUSED(placeholder_id, content_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::Delete(ContentId content_id) { + AMS_UNUSED(content_id); return ncm::ResultNotSupported(); } @@ -134,6 +141,7 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::GetPlaceHolderPath(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } @@ -142,14 +150,17 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::ListPlaceHolder(sf::Out out_count, const sf::OutArray &out_buf) { + AMS_UNUSED(out_count, out_buf); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::GetContentCount(sf::Out out_count) { + AMS_UNUSED(out_count); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::ListContentId(sf::Out out_count, const sf::OutArray &out_buf, s32 offset) { + AMS_UNUSED(out_count, out_buf, offset); return ncm::ResultNotSupported(); } @@ -175,10 +186,12 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) { + AMS_UNUSED(placeholder_id, old_content_id, new_content_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::SetPlaceHolderSize(PlaceHolderId placeholder_id, s64 size) { + AMS_UNUSED(placeholder_id, size); return ncm::ResultNotSupported(); } @@ -199,10 +212,12 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::GetRightsIdFromPlaceHolderIdDeprecated(sf::Out out_rights_id, PlaceHolderId placeholder_id) { + AMS_UNUSED(out_rights_id, placeholder_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::GetRightsIdFromPlaceHolderId(sf::Out out_rights_id, PlaceHolderId placeholder_id) { + AMS_UNUSED(out_rights_id, placeholder_id); return ncm::ResultNotSupported(); } @@ -232,6 +247,7 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::WriteContentForDebug(ContentId content_id, s64 offset, const sf::InBuffer &data) { + AMS_UNUSED(content_id, offset, data); return ncm::ResultNotSupported(); } @@ -250,6 +266,7 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::GetSizeFromPlaceHolderId(sf::Out out, PlaceHolderId placeholder_id) { + AMS_UNUSED(out, placeholder_id); return ncm::ResultNotSupported(); } @@ -258,10 +275,12 @@ namespace ams::ncm { } Result ReadOnlyContentStorageImpl::GetRightsIdFromPlaceHolderIdWithCache(sf::Out out_rights_id, PlaceHolderId placeholder_id, ContentId cache_content_id) { + AMS_UNUSED(out_rights_id, placeholder_id, cache_content_id); return ncm::ResultNotSupported(); } Result ReadOnlyContentStorageImpl::RegisterPath(const ContentId &content_id, const Path &path) { + AMS_UNUSED(content_id, path); return ncm::ResultInvalidOperation(); } diff --git a/libraries/libstratosphere/source/ncm/ncm_remote_content_manager_impl.hpp b/libraries/libstratosphere/source/ncm/ncm_remote_content_manager_impl.hpp index 1278d07e6..ab19d8b31 100644 --- a/libraries/libstratosphere/source/ncm/ncm_remote_content_manager_impl.hpp +++ b/libraries/libstratosphere/source/ncm/ncm_remote_content_manager_impl.hpp @@ -95,6 +95,7 @@ namespace ams::ncm { Result GetMemoryReport(sf::Out out) { /* TODO: libnx bindings */ + AMS_UNUSED(out); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/ncm/ncm_remote_content_meta_database_impl.hpp b/libraries/libstratosphere/source/ncm/ncm_remote_content_meta_database_impl.hpp index dc236ef68..6cd86bf69 100644 --- a/libraries/libstratosphere/source/ncm/ncm_remote_content_meta_database_impl.hpp +++ b/libraries/libstratosphere/source/ncm/ncm_remote_content_meta_database_impl.hpp @@ -158,11 +158,13 @@ namespace ams::ncm { Result GetCount(sf::Out out_count) { /* TODO: libnx bindings */ + AMS_UNUSED(out_count); AMS_ABORT(); } Result GetOwnerApplicationId(sf::Out out_id, const ContentMetaKey &key) { /* TODO: libnx bindings */ + AMS_UNUSED(out_id, key); AMS_ABORT(); } }; diff --git a/libraries/libstratosphere/source/ncm/ncm_remote_content_storage_impl.hpp b/libraries/libstratosphere/source/ncm/ncm_remote_content_storage_impl.hpp index 88850e7e1..9ebab0374 100644 --- a/libraries/libstratosphere/source/ncm/ncm_remote_content_storage_impl.hpp +++ b/libraries/libstratosphere/source/ncm/ncm_remote_content_storage_impl.hpp @@ -45,6 +45,16 @@ namespace ams::ncm { static_assert(sizeof(ContentId) == sizeof(::NcmContentId)); return reinterpret_cast<::NcmContentId *>(std::addressof(c)); } + + ALWAYS_INLINE const ::NcmContentId *Convert(const ContentId *c) { + static_assert(sizeof(ContentId) == sizeof(::NcmContentId)); + return reinterpret_cast(c); + } + + ALWAYS_INLINE const ::NcmContentId *Convert(const ContentId &c) { + static_assert(sizeof(ContentId) == sizeof(::NcmContentId)); + return reinterpret_cast(std::addressof(c)); + } public: Result GeneratePlaceHolderId(sf::Out out) { return ncmContentStorageGeneratePlaceHolderId(std::addressof(this->srv), Convert(out.GetPointer())); @@ -191,11 +201,11 @@ namespace ams::ncm { } Result RegisterPath(const ContentId &content_id, const Path &path) { - AMS_ABORT("TODO"); + return ncmContentStorageRegisterPath(std::addressof(this->srv), Convert(content_id), path.str); } Result ClearRegisteredPath() { - AMS_ABORT("TODO"); + return ncmContentStorageClearRegisteredPath(std::addressof(this->srv)); } }; static_assert(ncm::IsIContentStorage); diff --git a/libraries/libstratosphere/source/os/impl/os_multiple_wait_impl.cpp b/libraries/libstratosphere/source/os/impl/os_multiple_wait_impl.cpp index 34bbc6dd3..34eea3a28 100644 --- a/libraries/libstratosphere/source/os/impl/os_multiple_wait_impl.cpp +++ b/libraries/libstratosphere/source/os/impl/os_multiple_wait_impl.cpp @@ -142,6 +142,7 @@ namespace ams::os::impl { for (MultiWaitHolderBase &holder_base : this->multi_wait_list) { if (auto handle = holder_base.GetHandle(); handle != os::InvalidNativeHandle) { AMS_ASSERT(count < num); + AMS_UNUSED(num); out_handles[count] = handle; out_objects[count] = &holder_base; diff --git a/libraries/libstratosphere/source/os/impl/os_multiple_wait_target_impl.os.horizon.cpp b/libraries/libstratosphere/source/os/impl/os_multiple_wait_target_impl.os.horizon.cpp index 703aaf1d5..d5893788b 100644 --- a/libraries/libstratosphere/source/os/impl/os_multiple_wait_target_impl.os.horizon.cpp +++ b/libraries/libstratosphere/source/os/impl/os_multiple_wait_target_impl.os.horizon.cpp @@ -20,6 +20,8 @@ namespace ams::os::impl { Result MultiWaitHorizonImpl::WaitSynchronizationN(s32 *out_index, s32 num, NativeHandle arr[], s32 array_size, s64 ns) { + AMS_UNUSED(array_size); + AMS_ASSERT(!(num == 0 && ns == 0)); s32 index = MultiWaitImpl::WaitInvalid; @@ -38,6 +40,8 @@ namespace ams::os::impl { } Result MultiWaitHorizonImpl::ReplyAndReceiveN(s32 *out_index, s32 num, NativeHandle arr[], s32 array_size, s64 ns, NativeHandle reply_target) { + AMS_UNUSED(array_size); + /* NOTE: Nintendo does not initialize this value, which seems like it can cause incorrect behavior. */ s32 index = MultiWaitImpl::WaitInvalid; static_assert(MultiWaitImpl::WaitInvalid != -1); diff --git a/libraries/libstratosphere/source/os/impl/os_process_handle_impl.os.horizon.hpp b/libraries/libstratosphere/source/os/impl/os_process_handle_impl.os.horizon.hpp index 6a535f255..d9bff09ca 100644 --- a/libraries/libstratosphere/source/os/impl/os_process_handle_impl.os.horizon.hpp +++ b/libraries/libstratosphere/source/os/impl/os_process_handle_impl.os.horizon.hpp @@ -29,7 +29,7 @@ namespace ams::os::impl { } static ALWAYS_INLINE Result GetProgramId(ncm::ProgramId *out, NativeHandle handle) { - return svc::GetInfo(std::addressof(out->value), svc::InfoType_ProgramId, svc::PseudoHandle::CurrentProcess, 0); + return svc::GetInfo(std::addressof(out->value), svc::InfoType_ProgramId, handle, 0); } }; diff --git a/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.cpp b/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.cpp index f53b075a5..986dbaf77 100644 --- a/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.cpp +++ b/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.cpp @@ -71,7 +71,7 @@ namespace ams::os::impl { s32 count = 0; while (true) { - R_TRY_CATCH(::threadCreate(thread->thread_impl, reinterpret_cast<::ThreadFunc>(&InvokeThread), thread, thread->stack, thread->stack_size, ConvertToHorizonPriority(thread->base_priority), ideal_core)) { + R_TRY_CATCH(::threadCreate(thread->thread_impl, reinterpret_cast<::ThreadFunc>(reinterpret_cast(&InvokeThread)), thread, thread->stack, thread->stack_size, ConvertToHorizonPriority(thread->base_priority), ideal_core)) { R_CATCH(svc::ResultOutOfResource) { if ((++count) < 10) { os::SleepThread(TimeSpan::FromMilliSeconds(10)); diff --git a/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.hpp b/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.hpp index 3b49bd7fd..8a8350aad 100644 --- a/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.hpp +++ b/libraries/libstratosphere/source/os/impl/os_thread_manager_impl.os.horizon.hpp @@ -51,7 +51,7 @@ namespace ams::os::impl { /* TODO: void GetThreadContextUnsafe(ThreadContextInfo *out_context, const ThreadType *thread); */ - void NotifyThreadNameChangedImpl(const ThreadType *thread) const { /* ... */ } + void NotifyThreadNameChangedImpl(const ThreadType *thread) const { AMS_UNUSED(thread); } void SetCurrentThread(ThreadType *thread) const { g_current_thread_pointer = thread; diff --git a/libraries/libstratosphere/source/os/os_memory_heap.cpp b/libraries/libstratosphere/source/os/os_memory_heap.cpp index a888e4ec7..f16871831 100644 --- a/libraries/libstratosphere/source/os/os_memory_heap.cpp +++ b/libraries/libstratosphere/source/os/os_memory_heap.cpp @@ -18,10 +18,12 @@ namespace ams::os { Result AllocateMemoryBlock(uintptr_t *out_address, size_t size) { + AMS_UNUSED(out_address, size); AMS_ABORT("Not implemented yet"); } void FreeMemoryBlock(uintptr_t address, size_t size) { + AMS_UNUSED(address, size); AMS_ABORT("Not implemented yet"); } diff --git a/libraries/libstratosphere/source/os/os_mutex.cpp b/libraries/libstratosphere/source/os/os_mutex.cpp index 44d5f9b99..2282e87b9 100644 --- a/libraries/libstratosphere/source/os/os_mutex.cpp +++ b/libraries/libstratosphere/source/os/os_mutex.cpp @@ -23,7 +23,7 @@ namespace ams::os { #ifdef ATMOSPHERE_BUILD_FOR_AUDITING - void PushAndCheckLockLevel(MutexType *mutex) { + void PushAndCheckLockLevel(const MutexType *mutex) { /* If auditing isn't specified, don't bother. */ if (mutex->lock_level == 0) { return; @@ -32,7 +32,7 @@ namespace ams::os { /* TODO: Implement mutex level auditing. */ } - void PopAndCheckLockLevel(MutexType *mutex) { + void PopAndCheckLockLevel(const MutexType *mutex) { /* If auditing isn't specified, don't bother. */ if (mutex->lock_level == 0) { return; @@ -43,12 +43,12 @@ namespace ams::os { #else - void PushAndCheckLockLevel(MutexType *mutex) { - /* ... */ + void PushAndCheckLockLevel(const MutexType *mutex) { + AMS_UNUSED(mutex); } - void PopAndCheckLockLevel(MutexType *mutex) { - /* ... */ + void PopAndCheckLockLevel(const MutexType *mutex) { + AMS_UNUSED(mutex); } #endif diff --git a/libraries/libstratosphere/source/os/os_thread.cpp b/libraries/libstratosphere/source/os/os_thread.cpp index 1e3aeb2d9..0536ec0dd 100644 --- a/libraries/libstratosphere/source/os/os_thread.cpp +++ b/libraries/libstratosphere/source/os/os_thread.cpp @@ -38,6 +38,8 @@ namespace ams::os { AMS_ASSERT(util::IsAligned(reinterpret_cast(stack), ThreadStackAlignment)); AMS_ASSERT(stack_size > 0); AMS_ASSERT(util::IsAligned(stack_size, ThreadStackAlignment)); + + AMS_UNUSED(thread, stack, stack_size, priority); } } diff --git a/libraries/libstratosphere/source/os/os_thread_local_storage_api.cpp b/libraries/libstratosphere/source/os/os_thread_local_storage_api.cpp index e0f370907..6e734db5b 100644 --- a/libraries/libstratosphere/source/os/os_thread_local_storage_api.cpp +++ b/libraries/libstratosphere/source/os/os_thread_local_storage_api.cpp @@ -26,7 +26,7 @@ namespace ams::os { } Result AllocateTlsSlot(TlsSlot *out, TlsDestructor destructor) { - s32 slot = ::threadTlsAlloc(reinterpret_cast(destructor)); + s32 slot = ::threadTlsAlloc(reinterpret_cast(reinterpret_cast(destructor))); R_UNLESS(slot >= 0, os::ResultOutOfResource()); *out = { static_cast(slot) }; diff --git a/libraries/libstratosphere/source/patcher/patcher_api.cpp b/libraries/libstratosphere/source/patcher/patcher_api.cpp index c014285c2..357705770 100644 --- a/libraries/libstratosphere/source/patcher/patcher_api.cpp +++ b/libraries/libstratosphere/source/patcher/patcher_api.cpp @@ -112,6 +112,7 @@ namespace ams::patcher { } inline u32 GetIpsPatchSize(bool is_ips32, u8 *buffer) { + AMS_UNUSED(is_ips32); return (buffer[0] << 8) | (buffer[1]); } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp index d4dc7461e..3b4424b6b 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp @@ -150,6 +150,7 @@ namespace ams::pgl::srv { } void Deallocate(void *p, size_t size) { + AMS_UNUSED(size); return lmem::FreeToExpHeap(GetHeapHandle(), p); } @@ -168,7 +169,7 @@ namespace ams::pgl::srv { /* Start the Process Tracking thread. */ pgl::srv::InitializeProcessControlTask(); - /* TODO: Loop process. */ + /* Loop process. */ LoopProcessServer(); } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp index a52a0cdd1..62f1568f0 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp @@ -186,6 +186,8 @@ namespace ams::pgl::srv { } Result GetContentPathInNspd(lr::Path *out, ncm::ContentType type, util::optional index) const { + AMS_UNUSED(index); + /* Get the content name. */ const char *content_name = nullptr; switch (type) { diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp index ea62b5909..4aebf7825 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp @@ -30,10 +30,12 @@ namespace ams::pgl::srv { } Result ShellInterfaceCommon::LaunchProgramFromHostImpl(os::ProcessId *out, const void *content_path, size_t content_path_size, u32 pm_flags) { + AMS_UNUSED(content_path_size); return pgl::srv::LaunchProgramFromHost(out, static_cast(content_path), pm_flags); } Result ShellInterfaceCommon::GetHostContentMetaInfoImpl(pgl::ContentMetaInfo *out, const void *content_path, size_t content_path_size) { + AMS_UNUSED(content_path_size); return pgl::srv::GetHostContentMetaInfo(out, static_cast(content_path)); } @@ -66,6 +68,7 @@ namespace ams::pgl::srv { } Result ShellInterfaceCommon::TriggerApplicationSnapShotDumperImpl(SnapShotDumpType dump_type, const void *arg, size_t arg_size) { + AMS_UNUSED(arg_size); return pgl::srv::TriggerApplicationSnapShotDumper(dump_type, static_cast(arg)); } @@ -123,6 +126,7 @@ namespace ams::pgl::srv { } Result ShellInterfaceCmif::Command21NotImplemented(ams::sf::Out out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2) { + AMS_UNUSED(out, in, buf1, buf2); return pgl::ResultNotImplemented(); } diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.cpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.cpp index 00a371260..609076a2d 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.cpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.cpp @@ -121,11 +121,13 @@ namespace ams::powctl::impl::board::nintendo::nx { Result BatteryDriver::GetDeviceErrorStatus(u32 *out, IDevice *device) { /* TODO */ + AMS_UNUSED(out, device); AMS_ABORT(); } Result BatteryDriver::SetDeviceErrorStatus(IDevice *device, u32 status) { /* TODO */ + AMS_UNUSED(device, status); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.hpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.hpp index 25d521b02..cc9bf4763 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.hpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_battery_driver.hpp @@ -106,40 +106,40 @@ namespace ams::powctl::impl::board::nintendo::nx { virtual Result SetBatteryVoltageMaximumAlertThreshold(IDevice *device, int mv) override; /* Unsupported Charger API. */ - virtual Result GetChargerChargeCurrentState(ChargeCurrentState *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerChargeCurrentState(IDevice *device, ChargeCurrentState state) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerChargeCurrentState(ChargeCurrentState *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerChargeCurrentState(IDevice *device, ChargeCurrentState state) override { AMS_UNUSED(device, state); return powctl::ResultNotSupported(); } - virtual Result GetChargerFastChargeCurrentLimit(int *out_ma, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerFastChargeCurrentLimit(IDevice *device, int ma) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerFastChargeCurrentLimit(int *out_ma, IDevice *device) override { AMS_UNUSED(out_ma, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerFastChargeCurrentLimit(IDevice *device, int ma) override { AMS_UNUSED(device, ma); return powctl::ResultNotSupported(); } - virtual Result GetChargerChargeVoltageLimit(int *out_mv, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerChargeVoltageLimit(IDevice *device, int mv) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerChargeVoltageLimit(int *out_mv, IDevice *device) override { AMS_UNUSED(out_mv, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerChargeVoltageLimit(IDevice *device, int mv) override { AMS_UNUSED(device, mv); return powctl::ResultNotSupported(); } - virtual Result SetChargerChargerConfiguration(IDevice *device, ChargerConfiguration cfg) override { return powctl::ResultNotSupported(); } + virtual Result SetChargerChargerConfiguration(IDevice *device, ChargerConfiguration cfg) override { AMS_UNUSED(device, cfg); return powctl::ResultNotSupported(); } - virtual Result IsChargerHiZEnabled(bool *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerHiZEnabled(IDevice *device, bool en) override { return powctl::ResultNotSupported(); } + virtual Result IsChargerHiZEnabled(bool *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerHiZEnabled(IDevice *device, bool en) override { AMS_UNUSED(device, en); return powctl::ResultNotSupported(); } - virtual Result GetChargerInputCurrentLimit(int *out_ma, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerInputCurrentLimit(IDevice *device, int ma) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerInputCurrentLimit(int *out_ma, IDevice *device) override { AMS_UNUSED(out_ma, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerInputCurrentLimit(IDevice *device, int ma) override { AMS_UNUSED(device, ma); return powctl::ResultNotSupported(); } - virtual Result SetChargerInputVoltageLimit(IDevice *device, int mv) override { return powctl::ResultNotSupported(); } + virtual Result SetChargerInputVoltageLimit(IDevice *device, int mv) override { AMS_UNUSED(device, mv); return powctl::ResultNotSupported(); } - virtual Result SetChargerBoostModeCurrentLimit(IDevice *device, int ma) override { return powctl::ResultNotSupported(); } + virtual Result SetChargerBoostModeCurrentLimit(IDevice *device, int ma) override { AMS_UNUSED(device, ma); return powctl::ResultNotSupported(); } - virtual Result GetChargerChargerStatus(ChargerStatus *out, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerChargerStatus(ChargerStatus *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } - virtual Result IsChargerWatchdogTimerEnabled(bool *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerWatchdogTimerEnabled(IDevice *device, bool en) override { return powctl::ResultNotSupported(); } + virtual Result IsChargerWatchdogTimerEnabled(bool *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerWatchdogTimerEnabled(IDevice *device, bool en) override { AMS_UNUSED(device, en); return powctl::ResultNotSupported(); } - virtual Result SetChargerWatchdogTimerTimeout(IDevice *device, TimeSpan timeout) override { return powctl::ResultNotSupported(); } - virtual Result ResetChargerWatchdogTimer(IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result SetChargerWatchdogTimerTimeout(IDevice *device, TimeSpan timeout) override { AMS_UNUSED(device, timeout); return powctl::ResultNotSupported(); } + virtual Result ResetChargerWatchdogTimer(IDevice *device) override { AMS_UNUSED(device); return powctl::ResultNotSupported(); } - virtual Result GetChargerBatteryCompensation(int *out_mo, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerBatteryCompensation(IDevice *device, int mo) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerBatteryCompensation(int *out_mo, IDevice *device) override { AMS_UNUSED(out_mo, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerBatteryCompensation(IDevice *device, int mo) override { AMS_UNUSED(device, mo); return powctl::ResultNotSupported(); } - virtual Result GetChargerVoltageClamp(int *out_mv, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetChargerVoltageClamp(IDevice *device, int mv) override { return powctl::ResultNotSupported(); } + virtual Result GetChargerVoltageClamp(int *out_mv, IDevice *device) override { AMS_UNUSED(out_mv, device); return powctl::ResultNotSupported(); } + virtual Result SetChargerVoltageClamp(IDevice *device, int mv) override { AMS_UNUSED(device, mv); return powctl::ResultNotSupported(); } }; } diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.cpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.cpp index 1cd3e1ce5..417c3ae58 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.cpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.cpp @@ -113,11 +113,13 @@ namespace ams::powctl::impl::board::nintendo::nx { Result ChargerDriver::GetDeviceErrorStatus(u32 *out, IDevice *device) { /* TODO */ + AMS_UNUSED(out, device); AMS_ABORT(); } Result ChargerDriver::SetDeviceErrorStatus(IDevice *device, u32 status) { /* TODO */ + AMS_UNUSED(device, status); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.hpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.hpp index 6c704d58f..a876a1a82 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.hpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_charger_driver.hpp @@ -105,52 +105,52 @@ namespace ams::powctl::impl::board::nintendo::nx { virtual Result SetChargerVoltageClamp(IDevice *device, int mv) override; /* Unsupported Battery API. */ - virtual Result GetBatterySocRep(float *out_percent, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatterySocRep(float *out_percent, IDevice *device) override { AMS_UNUSED(out_percent, device); return powctl::ResultNotSupported(); } - virtual Result GetBatterySocVf(float *out_percent, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatterySocVf(float *out_percent, IDevice *device) override { AMS_UNUSED(out_percent, device); return powctl::ResultNotSupported(); } - virtual Result GetBatteryFullCapacity(int *out_mah, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result GetBatteryRemainingCapacity(int *out_mah, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryFullCapacity(int *out_mah, IDevice *device) override { AMS_UNUSED(out_mah, device); return powctl::ResultNotSupported(); } + virtual Result GetBatteryRemainingCapacity(int *out_mah, IDevice *device) override { AMS_UNUSED(out_mah, device); return powctl::ResultNotSupported(); } - virtual Result SetBatteryPercentageMinimumAlertThreshold(IDevice *device, float percentage) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryPercentageMaximumAlertThreshold(IDevice *device, float percentage) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryPercentageFullThreshold(IDevice *device, float percentage) override { return powctl::ResultNotSupported(); } + virtual Result SetBatteryPercentageMinimumAlertThreshold(IDevice *device, float percentage) override { AMS_UNUSED(device, percentage); return powctl::ResultNotSupported(); } + virtual Result SetBatteryPercentageMaximumAlertThreshold(IDevice *device, float percentage) override { AMS_UNUSED(device, percentage); return powctl::ResultNotSupported(); } + virtual Result SetBatteryPercentageFullThreshold(IDevice *device, float percentage) override { AMS_UNUSED(device, percentage); return powctl::ResultNotSupported(); } - virtual Result GetBatteryAverageCurrent(int *out_ma, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result GetBatteryCurrent(int *out_ma, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryAverageCurrent(int *out_ma, IDevice *device) override { AMS_UNUSED(out_ma, device); return powctl::ResultNotSupported(); } + virtual Result GetBatteryCurrent(int *out_ma, IDevice *device) override { AMS_UNUSED(out_ma, device); return powctl::ResultNotSupported(); } - virtual Result GetBatteryInternalState(void *dst, size_t *out_size, IDevice *device, size_t dst_size) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryInternalState(IDevice *device, const void *src, size_t src_size) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryInternalState(void *dst, size_t *out_size, IDevice *device, size_t dst_size) override { AMS_UNUSED(dst, out_size, device, dst_size); return powctl::ResultNotSupported(); } + virtual Result SetBatteryInternalState(IDevice *device, const void *src, size_t src_size) override { AMS_UNUSED(device, src, src_size); return powctl::ResultNotSupported(); } - virtual Result GetBatteryNeedToRestoreParameters(bool *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryNeedToRestoreParameters(IDevice *device, bool en) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryNeedToRestoreParameters(bool *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetBatteryNeedToRestoreParameters(IDevice *device, bool en) override { AMS_UNUSED(device, en); return powctl::ResultNotSupported(); } - virtual Result IsBatteryI2cShutdownEnabled(bool *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryI2cShutdownEnabled(IDevice *device, bool en) override { return powctl::ResultNotSupported(); } + virtual Result IsBatteryI2cShutdownEnabled(bool *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetBatteryI2cShutdownEnabled(IDevice *device, bool en) override { AMS_UNUSED(device, en); return powctl::ResultNotSupported(); } - virtual Result IsBatteryPresent(bool *out, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result IsBatteryPresent(bool *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } - virtual Result GetBatteryCycles(int *out, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryCycles(IDevice *device, int cycles) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryCycles(int *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } + virtual Result SetBatteryCycles(IDevice *device, int cycles) override { AMS_UNUSED(device, cycles); return powctl::ResultNotSupported(); } - virtual Result GetBatteryAge(float *out_percent, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryAge(float *out_percent, IDevice *device) override { AMS_UNUSED(out_percent, device); return powctl::ResultNotSupported(); } - virtual Result GetBatteryTemperature(float *out_c, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result GetBatteryMaximumTemperature(float *out_c, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryTemperature(float *out_c, IDevice *device) override { AMS_UNUSED(out_c, device); return powctl::ResultNotSupported(); } + virtual Result GetBatteryMaximumTemperature(float *out_c, IDevice *device) override { AMS_UNUSED(out_c, device); return powctl::ResultNotSupported(); } - virtual Result SetBatteryTemperatureMinimumAlertThreshold(IDevice *device, float c) override { return powctl::ResultNotSupported(); } - virtual Result SetBatteryTemperatureMaximumAlertThreshold(IDevice *device, float c) override { return powctl::ResultNotSupported(); } + virtual Result SetBatteryTemperatureMinimumAlertThreshold(IDevice *device, float c) override { AMS_UNUSED(device, c); return powctl::ResultNotSupported(); } + virtual Result SetBatteryTemperatureMaximumAlertThreshold(IDevice *device, float c) override { AMS_UNUSED(device, c); return powctl::ResultNotSupported(); } - virtual Result GetBatteryVCell(int *out_mv, IDevice *device) override { return powctl::ResultNotSupported(); } - virtual Result GetBatteryAverageVCell(int *out_mv, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryVCell(int *out_mv, IDevice *device) override { AMS_UNUSED(out_mv, device); return powctl::ResultNotSupported(); } + virtual Result GetBatteryAverageVCell(int *out_mv, IDevice *device) override { AMS_UNUSED(out_mv, device); return powctl::ResultNotSupported(); } - virtual Result GetBatteryAverageVCellTime(TimeSpan *out, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryAverageVCellTime(TimeSpan *out, IDevice *device) override { AMS_UNUSED(out, device); return powctl::ResultNotSupported(); } - virtual Result SetBatteryVoltageMinimumAlertThreshold(IDevice *device, int mv) override { return powctl::ResultNotSupported(); } + virtual Result SetBatteryVoltageMinimumAlertThreshold(IDevice *device, int mv) override { AMS_UNUSED(device, mv); return powctl::ResultNotSupported(); } - virtual Result GetBatteryOpenCircuitVoltage(int *out_mv, IDevice *device) override { return powctl::ResultNotSupported(); } + virtual Result GetBatteryOpenCircuitVoltage(int *out_mv, IDevice *device) override { AMS_UNUSED(out_mv, device); return powctl::ResultNotSupported(); } - virtual Result SetBatteryVoltageMaximumAlertThreshold(IDevice *device, int mv) override { return powctl::ResultNotSupported(); } + virtual Result SetBatteryVoltageMaximumAlertThreshold(IDevice *device, int mv) override { AMS_UNUSED(device, mv); return powctl::ResultNotSupported(); } }; } diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_interrupt_event_handler.cpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_interrupt_event_handler.cpp index b7373ca20..b92e26c3b 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_interrupt_event_handler.cpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_interrupt_event_handler.cpp @@ -20,11 +20,13 @@ namespace ams::powctl::impl::board::nintendo::nx { void ChargerInterruptEventHandler::SignalEvent(IDevice *device) { /* TODO */ + AMS_UNUSED(device); AMS_ABORT(); } void BatteryInterruptEventHandler::SignalEvent(IDevice *device) { /* TODO */ + AMS_UNUSED(device); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/psc/psc_remote_pm_module.hpp b/libraries/libstratosphere/source/psc/psc_remote_pm_module.hpp index 48225740b..d202429a2 100644 --- a/libraries/libstratosphere/source/psc/psc_remote_pm_module.hpp +++ b/libraries/libstratosphere/source/psc/psc_remote_pm_module.hpp @@ -31,6 +31,7 @@ namespace ams::psc { Result Initialize(ams::sf::OutCopyHandle out, psc::PmModuleId module_id, const ams::sf::InBuffer &child_list) { /* NOTE: This functionality is already implemented by the libnx command we use to instantiate the PscPmModule. */ + AMS_UNUSED(out, module_id, child_list); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/pwm/server/pwm_server_manager_impl.cpp b/libraries/libstratosphere/source/pwm/server/pwm_server_manager_impl.cpp index a5920f4e4..8b24d1964 100644 --- a/libraries/libstratosphere/source/pwm/server/pwm_server_manager_impl.cpp +++ b/libraries/libstratosphere/source/pwm/server/pwm_server_manager_impl.cpp @@ -29,6 +29,7 @@ namespace ams::pwm::server { Result ManagerImpl::OpenSessionForDev(ams::sf::Out> out, int channel) { /* TODO */ + AMS_UNUSED(out, channel); AMS_ABORT(); } diff --git a/libraries/libstratosphere/source/scs/scs_command_processor.cpp b/libraries/libstratosphere/source/scs/scs_command_processor.cpp index 5f2b1523a..1e51b05d7 100644 --- a/libraries/libstratosphere/source/scs/scs_command_processor.cpp +++ b/libraries/libstratosphere/source/scs/scs_command_processor.cpp @@ -133,6 +133,8 @@ namespace ams::scs { } void CommandProcessor::OnProcessJitDebug(u64 id, s32 socket, os::ProcessId process_id) { + AMS_UNUSED(process_id); + SendJitDebug(socket, id); } @@ -142,6 +144,8 @@ namespace ams::scs { } bool CommandProcessor::ProcessCommand(const CommandHeader &header, const u8 *body, s32 socket) { + AMS_UNUSED(body); + switch (header.command) { /* TODO: Support commands. */ default: diff --git a/libraries/libstratosphere/source/scs/scs_tenv.cpp b/libraries/libstratosphere/source/scs/scs_tenv.cpp index 8e3f26fca..a175fba2c 100644 --- a/libraries/libstratosphere/source/scs/scs_tenv.cpp +++ b/libraries/libstratosphere/source/scs/scs_tenv.cpp @@ -35,6 +35,8 @@ namespace ams::scs { } void Deallocate(void *p, size_t size) { + AMS_UNUSED(size); + std::scoped_lock lk(g_mutex); lmem::FreeToExpHeap(g_tenv_heap_handle, p); } diff --git a/libraries/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp b/libraries/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp index 49ef0a751..1be7e2962 100644 --- a/libraries/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp +++ b/libraries/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp @@ -160,6 +160,8 @@ namespace ams::sf::cmif { } void DomainServiceObjectProcessor::SetOutObjects(const cmif::ServiceDispatchContext &ctx, const HipcRequest &response, ServiceObjectHolder *out_objects, DomainObjectId *selected_ids) { + AMS_UNUSED(ctx, response); + const size_t num_out_objects = this->GetOutObjectCount(); /* Copy input object IDs from command impl (normally these are Invalid, in mitm they should be set). */ diff --git a/libraries/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp b/libraries/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp index 6eff58c48..b79a20f5a 100644 --- a/libraries/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp +++ b/libraries/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp @@ -277,6 +277,7 @@ namespace ams::sf::hipc { Result ServerSessionManager::DispatchManagerRequest(ServerSession *session, const cmif::PointerAndSize &in_message, const cmif::PointerAndSize &out_message) { /* This will get overridden by ... WithDomain class. */ + AMS_UNUSED(session, in_message, out_message); return sf::ResultNotSupported(); } diff --git a/libraries/libstratosphere/source/sf/sf_default_allocation_policy.cpp b/libraries/libstratosphere/source/sf/sf_default_allocation_policy.cpp index 4c7e322b1..fc3718a7e 100644 --- a/libraries/libstratosphere/source/sf/sf_default_allocation_policy.cpp +++ b/libraries/libstratosphere/source/sf/sf_default_allocation_policy.cpp @@ -70,10 +70,12 @@ namespace ams::sf { constinit DefaultAllocatorImpl g_default_allocator_impl = {}; inline void *DefaultAllocate(size_t size, size_t align) { + AMS_UNUSED(align); return ::operator new(size, std::nothrow); } inline void DefaultDeallocate(void *ptr, size_t size, size_t align) { + AMS_UNUSED(size, align); return ::operator delete(ptr, std::nothrow); } diff --git a/libraries/libstratosphere/source/spl/spl_api.cpp b/libraries/libstratosphere/source/spl/spl_api.cpp index 8528eeed9..6bfff1bdb 100644 --- a/libraries/libstratosphere/source/spl/spl_api.cpp +++ b/libraries/libstratosphere/source/spl/spl_api.cpp @@ -164,17 +164,23 @@ namespace ams::spl { Result GenerateAesKek(AccessKey *access_key, const void *key_source, size_t key_source_size, s32 generation, u32 option) { AMS_ASSERT(key_source_size == sizeof(KeySource)); + AMS_UNUSED(key_source_size); + return splCryptoGenerateAesKek(key_source, generation, option, static_cast(access_key)); } Result LoadAesKey(s32 slot, const AccessKey &access_key, const void *key_source, size_t key_source_size) { AMS_ASSERT(key_source_size == sizeof(KeySource)); + AMS_UNUSED(key_source_size); + return splCryptoLoadAesKey(std::addressof(access_key), key_source, static_cast(slot)); } Result GenerateAesKey(void *dst, size_t dst_size, const AccessKey &access_key, const void *key_source, size_t key_source_size) { AMS_ASSERT(dst_size >= crypto::AesEncryptor128::KeySize); AMS_ASSERT(key_source_size == sizeof(KeySource)); + AMS_UNUSED(dst_size, key_source_size); + return WaitAvailableKeySlotAndExecute([&]() -> Result { return splCryptoGenerateAesKey(std::addressof(access_key), key_source, dst); }); @@ -183,12 +189,15 @@ namespace ams::spl { Result GenerateSpecificAesKey(void *dst, size_t dst_size, const void *key_source, size_t key_source_size, s32 generation, u32 option) { AMS_ASSERT(dst_size >= crypto::AesEncryptor128::KeySize); AMS_ASSERT(key_source_size == sizeof(KeySource)); + AMS_UNUSED(dst_size, key_source_size); + return splFsGenerateSpecificAesKey(key_source, static_cast(generation), option, dst); } Result ComputeCtr(void *dst, size_t dst_size, s32 slot, const void *src, size_t src_size, const void *iv, size_t iv_size) { AMS_ASSERT(iv_size >= 0x10); AMS_ASSERT(dst_size >= src_size); + AMS_UNUSED(dst_size, iv_size); return splCryptoCryptAesCtr(src, dst, src_size, static_cast(slot), iv); } @@ -196,6 +205,8 @@ namespace ams::spl { Result DecryptAesKey(void *dst, size_t dst_size, const void *key_source, size_t key_source_size, s32 generation, u32 option) { AMS_ASSERT(dst_size >= crypto::AesEncryptor128::KeySize); AMS_ASSERT(key_source_size == sizeof(KeySource)); + AMS_UNUSED(dst_size, key_source_size); + return WaitAvailableKeySlotAndExecute([&]() -> Result { return splCryptoDecryptAesKey(key_source, static_cast(generation), option, dst); }); @@ -262,6 +273,7 @@ namespace ams::spl { Result GetPackage2Hash(void *dst, size_t dst_size) { AMS_ASSERT(dst_size >= crypto::Sha256Generator::HashSize); + AMS_UNUSED(dst_size); return splFsGetPackage2Hash(dst); } diff --git a/libraries/libvapours/include/vapours/util/util_optional.hpp b/libraries/libvapours/include/vapours/util/util_optional.hpp index c7d0a2fdb..f5f0e9e32 100644 --- a/libraries/libvapours/include/vapours/util/util_optional.hpp +++ b/libraries/libvapours/include/vapours/util/util_optional.hpp @@ -97,8 +97,8 @@ namespace ams::util { template constexpr OptionalPayloadBase(std::initializer_list il, Args &&... args) : m_payload(il, std::forward(args)...), m_engaged(true) { /* ... */ } - constexpr OptionalPayloadBase(bool engaged, const OptionalPayloadBase &rhs) { if (rhs.m_engaged) { this->Construct(rhs.Get()); } } - constexpr OptionalPayloadBase(bool engaged, OptionalPayloadBase &&rhs) { if (rhs.m_engaged) { this->Construct(std::move(rhs.Get())); } } + constexpr OptionalPayloadBase(bool engaged, const OptionalPayloadBase &rhs) { AMS_UNUSED(engaged); if (rhs.m_engaged) { this->Construct(rhs.Get()); } } + constexpr OptionalPayloadBase(bool engaged, OptionalPayloadBase &&rhs) { AMS_UNUSED(engaged); if (rhs.m_engaged) { this->Construct(std::move(rhs.Get())); } } constexpr OptionalPayloadBase(const OptionalPayloadBase &) = default; constexpr OptionalPayloadBase(OptionalPayloadBase &&) = default; diff --git a/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp b/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp index d276bc462..1e93da23b 100644 --- a/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp +++ b/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp @@ -36,6 +36,7 @@ namespace ams::crypto::impl { void AesImpl::Initialize(const void *key, size_t key_size, bool is_encrypt) { static_assert(IsSupportedKeySize(KeySize)); AMS_ASSERT(key_size == KeySize); + AMS_UNUSED(key_size); if constexpr (KeySize == 16) { /* Aes 128. */ @@ -60,6 +61,7 @@ namespace ams::crypto::impl { static_assert(IsSupportedKeySize(KeySize)); AMS_ASSERT(src_size >= BlockSize); AMS_ASSERT(dst_size >= BlockSize); + AMS_UNUSED(src_size, dst_size); if constexpr (KeySize == 16) { /* Aes 128. */ @@ -84,6 +86,7 @@ namespace ams::crypto::impl { static_assert(IsSupportedKeySize(KeySize)); AMS_ASSERT(src_size >= BlockSize); AMS_ASSERT(dst_size >= BlockSize); + AMS_UNUSED(src_size, dst_size); if constexpr (KeySize == 16) { /* Aes 128. */ diff --git a/libraries/libvapours/source/crypto/impl/crypto_sha1_impl.arch.arm64.cpp b/libraries/libvapours/source/crypto/impl/crypto_sha1_impl.arch.arm64.cpp index 8e70c600e..5f6b16517 100644 --- a/libraries/libvapours/source/crypto/impl/crypto_sha1_impl.arch.arm64.cpp +++ b/libraries/libvapours/source/crypto/impl/crypto_sha1_impl.arch.arm64.cpp @@ -32,6 +32,7 @@ namespace ams::crypto::impl { void Sha1Impl::GetHash(void *dst, size_t size) { static_assert(sizeof(this->state) == sizeof(::Sha1Context)); AMS_ASSERT(size >= HashSize); + AMS_UNUSED(size); ::sha1ContextGetHash(reinterpret_cast<::Sha1Context *>(std::addressof(this->state)), dst); } diff --git a/libraries/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp b/libraries/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp index 37132c446..b0c4e6cb9 100644 --- a/libraries/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp +++ b/libraries/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp @@ -32,6 +32,8 @@ namespace ams::crypto::impl { void Sha256Impl::GetHash(void *dst, size_t size) { static_assert(sizeof(this->state) == sizeof(::Sha256Context)); AMS_ASSERT(size >= HashSize); + AMS_UNUSED(size); + ::sha256ContextGetHash(reinterpret_cast<::Sha256Context *>(std::addressof(this->state)), dst); } diff --git a/libraries/libvapours/source/crypto/impl/crypto_update_impl.hpp b/libraries/libvapours/source/crypto/impl/crypto_update_impl.hpp index defb5eb9b..f6c7689e6 100644 --- a/libraries/libvapours/source/crypto/impl/crypto_update_impl.hpp +++ b/libraries/libvapours/source/crypto/impl/crypto_update_impl.hpp @@ -50,6 +50,8 @@ namespace ams::crypto::impl { template size_t UpdateImpl(Self *self, void *dst, size_t dst_size, const void *src, size_t src_size) { + AMS_UNUSED(dst_size); + const size_t BlockSize = self->GetBlockSize(); const u8 *src_u8 = static_cast(src); diff --git a/libraries/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp b/libraries/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp index 40ec6de1f..ce0a5317b 100644 --- a/libraries/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp +++ b/libraries/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp @@ -831,7 +831,7 @@ namespace ams::sdmmc::impl { void SdHostStandardController::UnregisterDeviceVirtualAddress(uintptr_t buffer, size_t buffer_size, ams::dd::DeviceVirtualAddress buffer_device_virtual_address) { /* Find and clear the buffer info. */ for (auto &info : this->buffer_infos) { - if (info.buffer_address == 0) { + if (info.buffer_address == buffer) { AMS_ABORT_UNLESS(info.buffer_size == buffer_size); AMS_ABORT_UNLESS(info.buffer_device_virtual_address == buffer_device_virtual_address);