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

@@ -293,7 +293,7 @@ void ParseColorControl(u32 value, bool begin_table) {
TableSetColumnIndex(0);
Text("ROP3");
TableSetColumnIndex(1);
Text("%X", reg.rop3.Value());
Text("%X", static_cast<u32>(reg.rop3.Value()));
if (begin_table) {
EndTable();
@@ -790,7 +790,7 @@ void ParseZInfo(u32 value, bool begin_table) {
TableSetColumnIndex(0);
Text("TILE_MODE_INDEX");
TableSetColumnIndex(1);
Text("%X", reg.tile_mode_index.Value());
Text("%X", static_cast<u32>(reg.tile_mode_index.Value()));
TableNextRow();
TableSetColumnIndex(0);

View File

@@ -26,7 +26,7 @@ bool MemoryMapViewer::Iterator::DrawLine() {
TableNextColumn();
Text("%" PRIXPTR, m.base);
TableNextColumn();
Text("%llX", m.size);
Text("%" PRIX64, m.size);
TableNextColumn();
Text("%s", magic_enum::enum_name(m.type).data());
TableNextColumn();
@@ -51,7 +51,7 @@ bool MemoryMapViewer::Iterator::DrawLine() {
TableNextColumn();
Text("%" PRIXPTR, m.base);
TableNextColumn();
Text("%llX", m.size);
Text("%" PRIX64, m.size);
TableNextColumn();
auto type = static_cast<::Libraries::Kernel::MemoryTypes>(m.memory_type);
Text("%s", magic_enum::enum_name(type).data());

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))

View File

@@ -7,6 +7,7 @@
#include <span>
#include <string>
#include <vector>
#include "common/assert.h"
#include "common/types.h"
namespace Core::Loader {
@@ -66,6 +67,8 @@ public:
return "Tls";
case SymbolType::NoType:
return "NoType";
default:
UNREACHABLE();
}
}

View File

@@ -43,7 +43,12 @@ Tcb* GetTcbBase();
void EnsureThreadInitialized();
template <size_t size>
__attribute__((optnone)) void ClearStack() {
#ifdef __clang__
__attribute__((optnone))
#else
__attribute__((optimize("O0")))
#endif
void ClearStack() {
volatile void* buf = alloca(size);
memset(const_cast<void*>(buf), 0, size);
buf = nullptr;

View File

@@ -471,7 +471,7 @@ void RemoveTexture(ImTextureID texture) {
IM_ASSERT(texture != nullptr);
VkData* bd = GetBackendData();
const InitInfo& v = bd->init_info;
v.device.freeDescriptorSets(bd->descriptor_pool, {texture->descriptor_set});
CheckVkErr(v.device.freeDescriptorSets(bd->descriptor_pool, {texture->descriptor_set}));
delete texture;
}

View File

@@ -37,6 +37,8 @@ constexpr std::string_view NameOf(Condition condition) {
return "Execz";
case Condition::Execnz:
return "Execnz";
default:
UNREACHABLE();
}
}