From 8f1cce69466f94ab2e3243414e84ef4193771072 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 4 May 2025 13:27:20 -0700 Subject: [PATCH] libnx: fix compilation with gcc15 --- nx/source/crypto/sha256.c | 2 +- nx/source/runtime/util/inet_addr.c | 9 ++------- nx/source/services/btdrv.c | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/nx/source/crypto/sha256.c b/nx/source/crypto/sha256.c index 74bbadb5..77a1ad44 100644 --- a/nx/source/crypto/sha256.c +++ b/nx/source/crypto/sha256.c @@ -163,7 +163,7 @@ static void _sha256ProcessBlocks(Sha256Context *ctx, const u8 *src_u8, size_t nu [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), [src_u8]"+r"(src_u8) - : [round_constants]"r"(s_roundConstants) + : "m"(*(const u8 (*)[num_blocks*SHA256_BLOCK_SIZE])src_u8), [round_constants]"r"(s_roundConstants) : ); diff --git a/nx/source/runtime/util/inet_addr.c b/nx/source/runtime/util/inet_addr.c index 76bff7a7..5368bf95 100644 --- a/nx/source/runtime/util/inet_addr.c +++ b/nx/source/runtime/util/inet_addr.c @@ -160,10 +160,7 @@ static int inet_pton4(const char *src, void *dst) { * Paul Vixie, 1996. */ static const char * -inet_ntop6(src, dst, size) - const u_char *src; - char *dst; - size_t size; +inet_ntop6(const u_char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough @@ -276,9 +273,7 @@ inet_ntop6(src, dst, size) * Paul Vixie, 1996. */ static int -inet_pton6(src, dst) - const char *src; - u_char *dst; +inet_pton6(const char *src, u_char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; diff --git a/nx/source/services/btdrv.c b/nx/source/services/btdrv.c index 568f1e82..f7ef1364 100644 --- a/nx/source/services/btdrv.c +++ b/nx/source/services/btdrv.c @@ -273,7 +273,7 @@ Result btdrvStartInquiry(u32 services, s64 duration) { u32 services; s64 duration; } in = { services, duration }; - + return serviceDispatchIn(&g_btdrvSrv, 8, in); } @@ -1493,7 +1493,7 @@ bool btdrvCircularBufferFree(BtdrvCircularBuffer *c) { if (read_offset == write_offset) return false; u8 *data_ptr = &c->data[read_offset]; - if (read_offset >= sizeof(c->data)) false; + if (read_offset >= sizeof(c->data)) return false; u64 tmpsize = read_offset + 0x18; if (tmpsize < sizeof(c->data)) tmpsize += *((u64*)&data_ptr[0x10]);