Fix a bunch of compiler warnings

This commit is contained in:
Connor McLaughlin
2021-06-03 23:03:06 +10:00
parent 270bf59817
commit 350049826f
23 changed files with 41 additions and 39 deletions

View File

@ -23,7 +23,6 @@ constexpr HostReg RARG2 = 1;
constexpr HostReg RARG3 = 2;
constexpr HostReg RARG4 = 3;
constexpr HostReg RSCRATCH = 12;
constexpr u32 FUNCTION_CALL_STACK_ALIGNMENT = 16;
constexpr u32 FUNCTION_CALL_SHADOW_SPACE = 32;
constexpr u32 FUNCTION_CALLEE_SAVED_SPACE_RESERVE = 80; // 8 registers
constexpr u32 FUNCTION_CALLER_SAVED_SPACE_RESERVE = 144; // 18 registers -> 224 bytes
@ -174,12 +173,14 @@ void CodeGenerator::EmitBeginBlock()
// Save the link register, since we'll be calling functions.
const bool link_reg_allocated = m_register_cache.AllocateHostReg(14);
DebugAssert(link_reg_allocated);
UNREFERENCED_VARIABLE(link_reg_allocated);
m_register_cache.AssumeCalleeSavedRegistersAreSaved();
// Store the CPU struct pointer. TODO: make this better.
const bool cpu_reg_allocated = m_register_cache.AllocateHostReg(RCPUPTR);
// m_emit->Mov(GetCPUPtrReg(), reinterpret_cast<uintptr_t>(&g_state));
DebugAssert(cpu_reg_allocated);
UNREFERENCED_VARIABLE(cpu_reg_allocated);
}
void CodeGenerator::EmitEndBlock()

View File

@ -21,7 +21,6 @@ constexpr HostReg RARG2 = 1;
constexpr HostReg RARG3 = 2;
constexpr HostReg RARG4 = 3;
constexpr HostReg RSCRATCH = 8;
constexpr u64 FUNCTION_CALL_STACK_ALIGNMENT = 16;
constexpr u64 FUNCTION_CALL_SHADOW_SPACE = 32;
constexpr u64 FUNCTION_CALLEE_SAVED_SPACE_RESERVE = 80; // 8 registers
constexpr u64 FUNCTION_CALLER_SAVED_SPACE_RESERVE = 144; // 18 registers -> 224 bytes

View File

@ -213,6 +213,7 @@ void CodeGenerator::EmitBeginBlock()
// Store the CPU struct pointer.
const bool cpu_reg_allocated = m_register_cache.AllocateHostReg(RCPUPTR);
DebugAssert(cpu_reg_allocated);
UNREFERENCED_VARIABLE(cpu_reg_allocated);
// m_emit->mov(GetCPUPtrReg(), reinterpret_cast<size_t>(&g_state));
// If there's loadstore instructions, preload the fastmem base.
@ -220,6 +221,7 @@ void CodeGenerator::EmitBeginBlock()
{
const bool fastmem_reg_allocated = m_register_cache.AllocateHostReg(RMEMBASEPTR);
Assert(fastmem_reg_allocated);
UNREFERENCED_VARIABLE(fastmem_reg_allocated);
m_emit->mov(GetFastmemBasePtrReg(), m_emit->qword[GetCPUPtrReg() + offsetof(CPU::State, fastmem_base)]);
}
}

View File

@ -334,7 +334,7 @@ void GPU_HW_OpenGL::SetCapabilities(HostDisplay* host_display)
GLint max_texel_buffer_size;
glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, reinterpret_cast<GLint*>(&max_texel_buffer_size));
Log_InfoPrintf("Max texel buffer size: %u", max_texel_buffer_size);
if (max_texel_buffer_size < VRAM_WIDTH * VRAM_HEIGHT)
if (max_texel_buffer_size < static_cast<int>(VRAM_WIDTH * VRAM_HEIGHT))
{
Log_WarningPrintf("Maximum texture buffer size is less than VRAM size, not using texel buffers.");
m_use_texture_buffer_for_vram_writes = false;

View File

@ -293,8 +293,8 @@ u32 NeGcon::StaticGetVibrationMotorCount()
Controller::SettingList NeGcon::StaticGetSettings()
{
static constexpr std::array<SettingInfo, 1> settings = {
{SettingInfo::Type::Float, "SteeringDeadzone", TRANSLATABLE("NeGcon", "Steering Axis Deadzone"),
TRANSLATABLE("NeGcon", "Sets deadzone size for steering axis."), "0.00f", "0.00f", "0.99f", "0.01f"}};
{{SettingInfo::Type::Float, "SteeringDeadzone", TRANSLATABLE("NeGcon", "Steering Axis Deadzone"),
TRANSLATABLE("NeGcon", "Sets deadzone size for steering axis."), "0.00f", "0.00f", "0.99f", "0.01f"}}};
return SettingList(settings.begin(), settings.end());
}

View File

@ -82,8 +82,8 @@ bool Pad::DoStateController(StateWrapper& sw, u32 i)
// dev-friendly untranslated console log.
Log_DevPrintf("Controller type mismatch in slot %u: state=%s(%u) ui=%s(%u) load_from_state=%s", i + 1u,
Settings::GetControllerTypeName(state_controller_type), state_controller_type,
Settings::GetControllerTypeName(controller_type), controller_type,
Settings::GetControllerTypeName(state_controller_type), static_cast<unsigned>(state_controller_type),
Settings::GetControllerTypeName(controller_type), static_cast<unsigned>(controller_type),
g_settings.load_devices_from_save_states ? "yes" : "no");
if (g_settings.load_devices_from_save_states)

View File

@ -212,10 +212,7 @@ double ALWAYS_INLINE_RELEASE f16Overflow(double in)
// pgxp_mem.c
static void PGXP_InitMem();
static const u32 UserMemOffset = 0;
static const u32 ScratchOffset = 2048 * 1024 / 4;
static const u32 RegisterOffset = 2 * 2048 * 1024 / 4;
static const u32 InvalidAddress = 3 * 2048 * 1024 / 4;
void PGXP_InitMem()
{

View File

@ -1906,9 +1906,6 @@ void UpdateMemoryCardTypes()
void UpdatePerGameMemoryCards()
{
// Disable memory cards when running PSFs.
const bool is_running_psf = !s_running_game_path.empty() && IsPsfFileName(s_running_game_path.c_str());
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
{
const MemoryCardType type = g_settings.memory_card_types[i];