build: Fix a couple more warnings. (#3598)

This commit is contained in:
squidbus
2025-09-13 15:33:42 -07:00
committed by GitHub
parent c51abe4e8b
commit 21a1888857
10 changed files with 27 additions and 16 deletions

View File

@@ -118,4 +118,4 @@ _sceFiberSwitchEntry:
# Fiber returned, not good
movl $1, %edi
call _sceFiberForceQuit
ret
ret

View File

@@ -59,7 +59,7 @@ struct Mcontext {
u64 mc_spare[6];
};
struct Stack {
struct ExStack {
void* ss_sp;
std::size_t ss_size;
int ss_flags;
@@ -75,7 +75,7 @@ struct Ucontext {
int field1_0x10[12];
struct Mcontext uc_mcontext;
struct Ucontext* uc_link;
struct Stack uc_stack;
struct ExStack uc_stack;
int uc_flags;
int __spare[4];
int field7_0x4f4[3];

View File

@@ -60,6 +60,7 @@
#include <cstdint>
#include <cstring>
#include <string>
#include <vector>
#include "common/va_ctx.h"
@@ -745,17 +746,17 @@ static int fprintf_ctx(Common::VaCtx* ctx, char* buf) {
}
static int vsnprintf_ctx(char* s, size_t n, const char* format, Common::VaList* arg) {
char buffer[n];
int result = _vsnprintf(_out_buffer, buffer, format, arg);
std::strcpy(s, buffer);
std::vector<char> buffer(n);
int result = _vsnprintf(_out_buffer, buffer.data(), format, arg);
std::strcpy(s, buffer.data());
return result;
}
static int snprintf_ctx(char* s, size_t n, Common::VaCtx* ctx) {
const char* format = vaArgPtr<const char>(&ctx->va_list);
char buffer[n];
int result = _vsnprintf(_out_buffer, buffer, format, &ctx->va_list);
std::strcpy(s, buffer);
std::vector<char> buffer(n);
int result = _vsnprintf(_out_buffer, buffer.data(), format, &ctx->va_list);
std::strcpy(s, buffer.data());
return result;
}

View File

@@ -904,7 +904,7 @@ const char* freebsd_inet_ntop6(const unsigned char* src, char* dst, u64 size) {
tp += strlen(tp);
break;
}
tp += sprintf(tp, "%x", words[i]);
tp += snprintf(tp, sizeof(tmp) - (tp - tmp), "%x", words[i]);
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))