From 2f9b9d5e7f937a6be96b45dbd7e19c964807a06a Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 26 Apr 2025 14:53:08 -0700 Subject: [PATCH] ams: basic support for compiling with gcc 15 --- .../stratosphere/ncm/ncm_content_meta_extended_data.hpp | 2 +- libstratosphere/source/fs/fs_scoped_setter.hpp | 8 ++++---- libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp | 2 +- libvapours/include/vapours/types.hpp | 1 - .../source/crypto/crypto_memory_compare.arch.arm.cpp | 2 +- .../source/crypto/crypto_memory_compare.arch.arm64.cpp | 2 +- .../source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp b/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp index dc693875..f8888e49 100644 --- a/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp +++ b/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp @@ -282,7 +282,7 @@ namespace ams::ncm { } const FragmentSet *GetFragmentSet(s32 delta_index, s32 fragment_set_index) const { - return reinterpret_cast(this->GetFragmentSetIndex(delta_index, fragment_set_index)); + return reinterpret_cast(this->GetFragmentSetAddress(delta_index, fragment_set_index)); } const FragmentIndicator *GetFragmentIndicator(s32 delta_index, s32 fragment_set_index, s32 index) const { diff --git a/libstratosphere/source/fs/fs_scoped_setter.hpp b/libstratosphere/source/fs/fs_scoped_setter.hpp index fc867aeb..d488fdc9 100644 --- a/libstratosphere/source/fs/fs_scoped_setter.hpp +++ b/libstratosphere/source/fs/fs_scoped_setter.hpp @@ -33,14 +33,14 @@ namespace ams::fs { } ALWAYS_INLINE ScopedSetter(ScopedSetter &&rhs) { - m_ptr = rhs.ptr; - m_value = rhs.value; + m_ptr = rhs.m_ptr; + m_value = rhs.m_value; rhs.Reset(); } ALWAYS_INLINE ScopedSetter &operator=(ScopedSetter &&rhs) { - m_ptr = rhs.ptr; - m_value = rhs.value; + m_ptr = rhs.m_ptr; + m_value = rhs.m_value; rhs.Reset(); return *this; } diff --git a/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp b/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp index b4d959b2..a67ae480 100644 --- a/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp +++ b/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp @@ -21,7 +21,7 @@ namespace ams::sf::hipc { #if AMS_SF_MITM_SUPPORTED Result ServerManagerBase::InstallMitmServerImpl(os::NativeHandle *out_port_handle, sm::ServiceName service_name, ServerManagerBase::MitmQueryFunction query_func) { /* Install the Mitm. */ - os::NativeHandle query_handle; + os::NativeHandle query_handle = os::InvalidNativeHandle; R_TRY(sm::mitm::InstallMitm(out_port_handle, std::addressof(query_handle), service_name)); /* Register the query handle. */ diff --git a/libvapours/include/vapours/types.hpp b/libvapours/include/vapours/types.hpp index e7b75a8f..d22f944a 100644 --- a/libvapours/include/vapours/types.hpp +++ b/libvapours/include/vapours/types.hpp @@ -16,7 +16,6 @@ #pragma once #include #include -#include /* NOTE: This file serves as a substitute for libnx . */ diff --git a/libvapours/source/crypto/crypto_memory_compare.arch.arm.cpp b/libvapours/source/crypto/crypto_memory_compare.arch.arm.cpp index 671e49a8..1a2d5484 100644 --- a/libvapours/source/crypto/crypto_memory_compare.arch.arm.cpp +++ b/libvapours/source/crypto/crypto_memory_compare.arch.arm.cpp @@ -48,7 +48,7 @@ namespace ams::crypto { " moveq %[result], #1\n" " movne %[result], #0\n" : [result]"=r"(result), [lhs]"+r"(lhs), [rhs]"+r"(rhs), [xor_acc]"=&r"(xor_acc), [index]"=&r"(index), [ltmp]"=&r"(ltmp), [rtmp]"=&r"(rtmp) - : [size]"r"(size) + : "m"(*(const u8 (*)[size])lhs), "m"(*(const u8 (*)[size])rhs), [size]"r"(size) : "cc" ); diff --git a/libvapours/source/crypto/crypto_memory_compare.arch.arm64.cpp b/libvapours/source/crypto/crypto_memory_compare.arch.arm64.cpp index 2532415d..7fdd814d 100644 --- a/libvapours/source/crypto/crypto_memory_compare.arch.arm64.cpp +++ b/libvapours/source/crypto/crypto_memory_compare.arch.arm64.cpp @@ -47,7 +47,7 @@ namespace ams::crypto { " cmp %w[xor_acc], #0\n" " cset %w[result], eq\n" : [result]"=r"(result), [lhs]"+r"(lhs), [rhs]"+r"(rhs), [xor_acc]"=&r"(xor_acc), [index]"=&r"(index), [ltmp]"=&r"(ltmp), [rtmp]"=&r"(rtmp) - : "m"(*(const u8 (*)[size])lhs), "m"(*(const u8 (*)[size])lhs), [size]"r"(size) + : "m"(*(const u8 (*)[size])lhs), "m"(*(const u8 (*)[size])rhs), [size]"r"(size) : "cc" ); diff --git a/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp b/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp index a332d765..74ff84b4 100644 --- a/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp +++ b/libvapours/source/crypto/impl/crypto_sha256_impl.arch.arm64.cpp @@ -281,7 +281,7 @@ namespace ams::crypto::impl { [cur_hash0]"+w"(cur_hash0), [cur_hash1]"+w"(cur_hash1), [prev_hash0]"+w"(prev_hash0), [prev_hash1]"+w"(prev_hash1), [tmp_hash]"=w"(tmp_hash), [data]"+r"(data) - : [round_constants]"r"(RoundConstants) + : "m"(*(const u8 (*)[block_count*BlockSize])data), [round_constants]"r"(RoundConstants) : ); } while (--block_count != 0);