From 5d883f22c8da9ceabf7f89404d136c8193083a6a Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 6 May 2023 17:49:36 -0700 Subject: [PATCH] ams: fix compilation with gcc 13 --- libmesosphere/include/mesosphere/kern_k_auto_object.hpp | 2 +- libmesosphere/include/mesosphere/kern_k_typed_address.hpp | 4 ---- libmesosphere/include/mesosphere/kern_slab_helpers.hpp | 3 ++- libmesosphere/source/svc/kern_svc_physical_memory.cpp | 2 +- .../sf/hipc/sf_hipc_server_domain_session_manager.cpp | 4 ++-- libvapours/include/vapours/util/util_intrusive_list.hpp | 8 -------- .../vapours/util/util_intrusive_red_black_tree.hpp | 8 -------- 7 files changed, 6 insertions(+), 25 deletions(-) diff --git a/libmesosphere/include/mesosphere/kern_k_auto_object.hpp b/libmesosphere/include/mesosphere/kern_k_auto_object.hpp index 9e42f572..1b7b433b 100644 --- a/libmesosphere/include/mesosphere/kern_k_auto_object.hpp +++ b/libmesosphere/include/mesosphere/kern_k_auto_object.hpp @@ -257,7 +257,7 @@ namespace ams::kern { class KScopedAutoObject { NON_COPYABLE(KScopedAutoObject); private: - template + template requires std::derived_from friend class KScopedAutoObject; private: T *m_obj; diff --git a/libmesosphere/include/mesosphere/kern_k_typed_address.hpp b/libmesosphere/include/mesosphere/kern_k_typed_address.hpp index 1456977d..5f8ba89d 100644 --- a/libmesosphere/include/mesosphere/kern_k_typed_address.hpp +++ b/libmesosphere/include/mesosphere/kern_k_typed_address.hpp @@ -120,10 +120,6 @@ namespace ams::kern { return m_address == rhs; } - constexpr ALWAYS_INLINE bool operator!=(uintptr_t rhs) const { - return m_address != rhs; - } - /* Allow getting the address explicitly, for use in accessors. */ constexpr ALWAYS_INLINE uintptr_t GetValue() const { return m_address; diff --git a/libmesosphere/include/mesosphere/kern_slab_helpers.hpp b/libmesosphere/include/mesosphere/kern_slab_helpers.hpp index 28b39e84..6cf90555 100644 --- a/libmesosphere/include/mesosphere/kern_slab_helpers.hpp +++ b/libmesosphere/include/mesosphere/kern_slab_helpers.hpp @@ -164,8 +164,9 @@ namespace ams::kern { }; - template requires std::derived_from + template class KAutoObjectWithSlabHeapAndContainer : public KAutoObjectWithSlabHeapBase { + static_assert(std::derived_from); private: static constinit inline KAutoObjectWithListContainer s_container; public: diff --git a/libmesosphere/source/svc/kern_svc_physical_memory.cpp b/libmesosphere/source/svc/kern_svc_physical_memory.cpp index 1319bf1e..fc541490 100644 --- a/libmesosphere/source/svc/kern_svc_physical_memory.cpp +++ b/libmesosphere/source/svc/kern_svc_physical_memory.cpp @@ -27,7 +27,7 @@ namespace ams::kern::svc { R_UNLESS(size < ams::kern::MainMemorySizeMax, svc::ResultInvalidSize()); /* Set the heap size. */ - KProcessAddress address; + KProcessAddress address = Null; R_TRY(GetCurrentProcess().GetPageTable().SetHeapSize(std::addressof(address), size)); /* Set the output. */ diff --git a/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp b/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp index 6f16fa0e..c1e6bdb6 100644 --- a/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp +++ b/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp @@ -48,7 +48,7 @@ namespace ams::sf::hipc { AMS_ABORT_UNLESS(ServerManagerBase::CanAnyManageMitmServers()); /* Clone the forward service. */ - std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService()); + std::shared_ptr<::Service> new_forward_service = ServerSession::CreateForwardService(); R_ABORT_UNLESS(serviceClone(util::GetReference(m_session->m_forward_service).get(), new_forward_service.get())); R_ABORT_UNLESS(tagged_manager->RegisterMitmSession(server_handle, std::move(clone), std::move(new_forward_service))); } @@ -168,7 +168,7 @@ namespace ams::sf::hipc { R_ABORT_UNLESS(hipc::CreateSession(std::addressof(server_handle), std::addressof(client_handle))); /* Register. */ - std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService()); + std::shared_ptr<::Service> new_forward_service = ServerSession::CreateForwardService(); serviceCreate(new_forward_service.get(), new_forward_target); R_ABORT_UNLESS(m_manager->RegisterMitmSession(server_handle, std::move(object), std::move(new_forward_service))); diff --git a/libvapours/include/vapours/util/util_intrusive_list.hpp b/libvapours/include/vapours/util/util_intrusive_list.hpp index 783117be..0eceec9e 100644 --- a/libvapours/include/vapours/util/util_intrusive_list.hpp +++ b/libvapours/include/vapours/util/util_intrusive_list.hpp @@ -144,10 +144,6 @@ namespace ams::util { return m_node == rhs.m_node; } - constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const { - return !(*this == rhs); - } - constexpr ALWAYS_INLINE pointer operator->() const { return m_node; } @@ -355,10 +351,6 @@ namespace ams::util { return m_iterator == rhs.m_iterator; } - constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const { - return !(*this == rhs); - } - constexpr ALWAYS_INLINE pointer operator->() const { return std::addressof(Traits::GetParent(*m_iterator)); } diff --git a/libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp b/libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp index a25f0b78..0476fc9c 100644 --- a/libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp +++ b/libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp @@ -94,10 +94,6 @@ namespace ams::util { return m_node == rhs.m_node; } - constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const { - return !(*this == rhs); - } - constexpr ALWAYS_INLINE pointer operator->() const { return m_node; } @@ -304,10 +300,6 @@ namespace ams::util { return m_impl == rhs.m_impl; } - constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const { - return !(*this == rhs); - } - constexpr ALWAYS_INLINE pointer operator->() const { return Traits::GetParent(std::addressof(*m_impl)); }