mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 03:46:42 +01:00
BreakPoints: Invert if statements where reasonable
Puts the early-exit condition first, unindenting code that doesn't need to be.
This commit is contained in:
parent
3137d4f75f
commit
b4cd11c7c9
@ -62,28 +62,30 @@ void BreakPoints::AddFromStrings(const TBreakPointsStr& bp_strings)
|
|||||||
|
|
||||||
void BreakPoints::Add(const TBreakPoint& bp)
|
void BreakPoints::Add(const TBreakPoint& bp)
|
||||||
{
|
{
|
||||||
if (!IsAddressBreakPoint(bp.address))
|
if (IsAddressBreakPoint(bp.address))
|
||||||
{
|
return;
|
||||||
m_breakpoints.push_back(bp);
|
|
||||||
if (g_jit)
|
m_breakpoints.push_back(bp);
|
||||||
g_jit->GetBlockCache()->InvalidateICache(bp.address, 4, true);
|
|
||||||
}
|
if (g_jit)
|
||||||
|
g_jit->GetBlockCache()->InvalidateICache(bp.address, 4, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakPoints::Add(u32 address, bool temp)
|
void BreakPoints::Add(u32 address, bool temp)
|
||||||
{
|
{
|
||||||
if (!IsAddressBreakPoint(address)) // only add new addresses
|
// Only add new addresses
|
||||||
{
|
if (IsAddressBreakPoint(address))
|
||||||
TBreakPoint bp; // breakpoint settings
|
return;
|
||||||
bp.is_enabled = true;
|
|
||||||
bp.is_temporary = temp;
|
|
||||||
bp.address = address;
|
|
||||||
|
|
||||||
m_breakpoints.push_back(bp);
|
TBreakPoint bp; // breakpoint settings
|
||||||
|
bp.is_enabled = true;
|
||||||
|
bp.is_temporary = temp;
|
||||||
|
bp.address = address;
|
||||||
|
|
||||||
if (g_jit)
|
m_breakpoints.push_back(bp);
|
||||||
g_jit->GetBlockCache()->InvalidateICache(address, 4, true);
|
|
||||||
}
|
if (g_jit)
|
||||||
|
g_jit->GetBlockCache()->InvalidateICache(address, 4, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakPoints::Remove(u32 address)
|
void BreakPoints::Remove(u32 address)
|
||||||
@ -170,18 +172,18 @@ void MemChecks::AddFromStrings(const TMemChecksStr& mc_strings)
|
|||||||
|
|
||||||
void MemChecks::Add(const TMemCheck& memory_check)
|
void MemChecks::Add(const TMemCheck& memory_check)
|
||||||
{
|
{
|
||||||
if (GetMemCheck(memory_check.start_address) == nullptr)
|
if (GetMemCheck(memory_check.start_address) != nullptr)
|
||||||
{
|
return;
|
||||||
bool had_any = HasAny();
|
|
||||||
Core::RunAsCPUThread([&] {
|
bool had_any = HasAny();
|
||||||
m_mem_checks.push_back(memory_check);
|
Core::RunAsCPUThread([&] {
|
||||||
// If this is the first one, clear the JIT cache so it can switch to
|
m_mem_checks.push_back(memory_check);
|
||||||
// watchpoint-compatible code.
|
// If this is the first one, clear the JIT cache so it can switch to
|
||||||
if (!had_any && g_jit)
|
// watchpoint-compatible code.
|
||||||
g_jit->ClearCache();
|
if (!had_any && g_jit)
|
||||||
PowerPC::DBATUpdated();
|
g_jit->ClearCache();
|
||||||
});
|
PowerPC::DBATUpdated();
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemChecks::Remove(u32 address)
|
void MemChecks::Remove(u32 address)
|
||||||
@ -284,22 +286,23 @@ void Watches::AddFromStrings(const TWatchesStr& watch_strings)
|
|||||||
|
|
||||||
void Watches::Add(const TWatch& watch)
|
void Watches::Add(const TWatch& watch)
|
||||||
{
|
{
|
||||||
if (!IsAddressWatch(watch.address))
|
if (IsAddressWatch(watch.address))
|
||||||
{
|
return;
|
||||||
m_watches.push_back(watch);
|
|
||||||
}
|
m_watches.push_back(watch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watches::Add(u32 address)
|
void Watches::Add(u32 address)
|
||||||
{
|
{
|
||||||
if (!IsAddressWatch(address)) // only add new addresses
|
// Only add new addresses
|
||||||
{
|
if (IsAddressWatch(address))
|
||||||
TWatch watch; // watch settings
|
return;
|
||||||
watch.is_enabled = true;
|
|
||||||
watch.address = address;
|
|
||||||
|
|
||||||
m_watches.push_back(watch);
|
TWatch watch; // watch settings
|
||||||
}
|
watch.is_enabled = true;
|
||||||
|
watch.address = address;
|
||||||
|
|
||||||
|
m_watches.push_back(watch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watches::Update(int count, u32 address)
|
void Watches::Update(int count, u32 address)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user