Misc: Fix up a few recent clang warnings

This commit is contained in:
Stenzek 2023-04-05 21:05:12 +10:00 committed by refractionpcsx2
parent 0bd57986a9
commit 369b9a4808
3 changed files with 13 additions and 13 deletions

View File

@ -1198,11 +1198,6 @@ void GSState::GIFRegHandlerALPHA(const GIFReg* RESTRICT r)
void GSState::GIFRegHandlerDIMX(const GIFReg* RESTRICT r)
{
bool update = false;
if (r->DIMX != m_env.DIMX)
update = true;
m_env.DIMX = r->DIMX;
if (m_prev_env.DIMX != m_env.DIMX)
@ -1443,8 +1438,6 @@ void GSState::Flush(GSFlushReason reason)
if (m_dirty_gs_regs)
{
const int ctx = m_prev_env.PRIM.CTXT;
m_draw_env = &m_prev_env;
PRIM = &m_prev_env.PRIM;
UpdateContext();
@ -1616,9 +1609,8 @@ void GSState::FlushPrim()
// If the PSM format of Z is invalid, but it is masked (no write) and ZTST is set to ALWAYS pass (no test, just allow)
// we can ignore the Z format, since it won't be used in the draw (Star Ocean 3 transitions)
const bool ignoreZ = m_context->ZBUF.ZMSK && m_context->TEST.ZTST == 1;
#ifdef PCSX2_DEVBUILD
const bool ignoreZ = m_context->ZBUF.ZMSK && m_context->TEST.ZTST == 1;
if (GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt >= 3 || (GSLocalMemory::m_psm[m_context->ZBUF.PSM].fmt >= 3 && !ignoreZ))
{
Console.Warning("GS: Possible invalid draw, Frame PSM %x ZPSM %x", m_context->FRAME.PSM, m_context->ZBUF.PSM);

View File

@ -196,11 +196,13 @@ namespace usb_pad
}
if (!m_constant_effect_running)
{
if (SDL_HapticRunEffect(m_haptic, m_constant_effect_id, SDL_HAPTIC_INFINITY) == 0)
m_constant_effect_running = true;
else
Console.Error("SDL_HapticRunEffect() for constant failed: %s", SDL_GetError());
}
}
template <typename T>
static u16 ClampU16(T val)
@ -224,11 +226,13 @@ namespace usb_pad
Console.Warning("SDL_HapticUpdateEffect() for spring failed: %s", SDL_GetError());
if (!m_spring_effect_running)
{
if (SDL_HapticRunEffect(m_haptic, m_spring_effect_id, SDL_HAPTIC_INFINITY) == 0)
m_spring_effect_running = true;
else
Console.Error("SDL_HapticRunEffect() for spring failed: %s", SDL_GetError());
}
}
void SDLFFDevice::SetDamperForce(const parsed_ff_data& ff)
{
@ -246,11 +250,13 @@ namespace usb_pad
Console.Warning("SDL_HapticUpdateEffect() for damper failed: %s", SDL_GetError());
if (!m_damper_effect_running)
{
if (SDL_HapticRunEffect(m_haptic, m_damper_effect_id, SDL_HAPTIC_INFINITY) == 0)
m_damper_effect_running = true;
else
Console.Error("SDL_HapticRunEffect() for damper failed: %s", SDL_GetError());
}
}
void SDLFFDevice::SetFrictionForce(const parsed_ff_data& ff)
{
@ -265,11 +271,13 @@ namespace usb_pad
m_friction_effect.condition.center[0] = ClampU16(ff.u.condition.center);
if (SDL_HapticUpdateEffect(m_haptic, m_friction_effect_id, &m_friction_effect) != 0)
{
if (!m_friction_effect_running && SDL_HapticRunEffect(m_haptic, m_friction_effect_id, SDL_HAPTIC_INFINITY) == 0)
m_friction_effect_running = true;
else
Console.Error("SDL_HapticUpdateEffect() for friction failed: %s", SDL_GetError());
}
}
void SDLFFDevice::SetAutoCenter(int value)
{

View File

@ -647,7 +647,7 @@ void vtlb_MapHandler(vtlbHandler handler, u32 start, u32 size)
verify(0 == (size & VTLB_PAGE_MASK) && size > 0);
u32 end = start + (size - VTLB_PAGE_SIZE);
pxAssume((end >> VTLB_PAGE_BITS) < std::size(vtlbdata.pmap));
pxAssume((end >> VTLB_PAGE_BITS) < (sizeof(vtlbdata.pmap) / sizeof(vtlbdata.pmap[0])));
while (start <= end)
{