mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Run code through clang-modernize -loop-convert to create range-based for loops, and manually fix some stuff up.
This commit is contained in:
@ -12,16 +12,16 @@
|
||||
|
||||
bool BreakPoints::IsAddressBreakPoint(u32 _iAddress)
|
||||
{
|
||||
for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i)
|
||||
if (i->iAddress == _iAddress)
|
||||
for (auto& bp : m_BreakPoints)
|
||||
if (bp.iAddress == _iAddress)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BreakPoints::IsTempBreakPoint(u32 _iAddress)
|
||||
{
|
||||
for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i)
|
||||
if (i->iAddress == _iAddress && i->bTemporary)
|
||||
for (auto& bp : m_BreakPoints)
|
||||
if (bp.iAddress == _iAddress && bp.bTemporary)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -29,29 +29,28 @@ bool BreakPoints::IsTempBreakPoint(u32 _iAddress)
|
||||
BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const
|
||||
{
|
||||
TBreakPointsStr bps;
|
||||
for (TBreakPoints::const_iterator i = m_BreakPoints.begin();
|
||||
i != m_BreakPoints.end(); ++i)
|
||||
for (const auto& bp : m_BreakPoints)
|
||||
{
|
||||
if (!i->bTemporary)
|
||||
if (!bp.bTemporary)
|
||||
{
|
||||
std::stringstream bp;
|
||||
bp << std::hex << i->iAddress << " " << (i->bOn ? "n" : "");
|
||||
bps.push_back(bp.str());
|
||||
std::stringstream ss;
|
||||
ss << std::hex << bp.iAddress << " " << (bp.bOn ? "n" : "");
|
||||
bps.push_back(ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
return bps;
|
||||
}
|
||||
|
||||
void BreakPoints::AddFromStrings(const TBreakPointsStr& bps)
|
||||
void BreakPoints::AddFromStrings(const TBreakPointsStr& bpstrs)
|
||||
{
|
||||
for (TBreakPointsStr::const_iterator i = bps.begin(); i != bps.end(); ++i)
|
||||
for (const auto& bpstr : bpstrs)
|
||||
{
|
||||
TBreakPoint bp;
|
||||
std::stringstream bpstr;
|
||||
bpstr << std::hex << *i;
|
||||
bpstr >> bp.iAddress;
|
||||
bp.bOn = i->find("n") != i->npos;
|
||||
std::stringstream ss;
|
||||
ss << std::hex << bpstr;
|
||||
ss >> bp.iAddress;
|
||||
bp.bOn = bpstr.find("n") != bpstr.npos;
|
||||
bp.bTemporary = false;
|
||||
Add(bp);
|
||||
}
|
||||
@ -115,35 +114,34 @@ void BreakPoints::Clear()
|
||||
MemChecks::TMemChecksStr MemChecks::GetStrings() const
|
||||
{
|
||||
TMemChecksStr mcs;
|
||||
for (TMemChecks::const_iterator i = m_MemChecks.begin();
|
||||
i != m_MemChecks.end(); ++i)
|
||||
for (const auto& bp : m_MemChecks)
|
||||
{
|
||||
std::stringstream mc;
|
||||
mc << std::hex << i->StartAddress;
|
||||
mc << " " << (i->bRange ? i->EndAddress : i->StartAddress) << " " <<
|
||||
(i->bRange ? "n" : "") << (i->OnRead ? "r" : "") <<
|
||||
(i->OnWrite ? "w" : "") << (i->Log ? "l" : "") << (i->Break ? "p" : "");
|
||||
mc << std::hex << bp.StartAddress;
|
||||
mc << " " << (bp.bRange ? bp.EndAddress : bp.StartAddress) << " " <<
|
||||
(bp.bRange ? "n" : "") << (bp.OnRead ? "r" : "") <<
|
||||
(bp.OnWrite ? "w" : "") << (bp.Log ? "l" : "") << (bp.Break ? "p" : "");
|
||||
mcs.push_back(mc.str());
|
||||
}
|
||||
|
||||
return mcs;
|
||||
}
|
||||
|
||||
void MemChecks::AddFromStrings(const TMemChecksStr& mcs)
|
||||
void MemChecks::AddFromStrings(const TMemChecksStr& mcstrs)
|
||||
{
|
||||
for (TMemChecksStr::const_iterator i = mcs.begin(); i != mcs.end(); ++i)
|
||||
for (const auto& mcstr : mcstrs)
|
||||
{
|
||||
TMemCheck mc;
|
||||
std::stringstream mcstr;
|
||||
mcstr << std::hex << *i;
|
||||
mcstr >> mc.StartAddress;
|
||||
mc.bRange = i->find("n") != i->npos;
|
||||
mc.OnRead = i->find("r") != i->npos;
|
||||
mc.OnWrite = i->find("w") != i->npos;
|
||||
mc.Log = i->find("l") != i->npos;
|
||||
mc.Break = i->find("p") != i->npos;
|
||||
std::stringstream ss;
|
||||
ss << std::hex << mcstr;
|
||||
ss >> mc.StartAddress;
|
||||
mc.bRange = mcstr.find("n") != mcstr.npos;
|
||||
mc.OnRead = mcstr.find("r") != mcstr.npos;
|
||||
mc.OnWrite = mcstr.find("w") != mcstr.npos;
|
||||
mc.Log = mcstr.find("l") != mcstr.npos;
|
||||
mc.Break = mcstr.find("p") != mcstr.npos;
|
||||
if (mc.bRange)
|
||||
mcstr >> mc.EndAddress;
|
||||
ss >> mc.EndAddress;
|
||||
else
|
||||
mc.EndAddress = mc.StartAddress;
|
||||
Add(mc);
|
||||
@ -170,15 +168,15 @@ void MemChecks::Remove(u32 _Address)
|
||||
|
||||
TMemCheck *MemChecks::GetMemCheck(u32 address)
|
||||
{
|
||||
for (TMemChecks::iterator i = m_MemChecks.begin(); i != m_MemChecks.end(); ++i)
|
||||
for (auto& bp : m_MemChecks)
|
||||
{
|
||||
if (i->bRange)
|
||||
if (bp.bRange)
|
||||
{
|
||||
if (address >= i->StartAddress && address <= i->EndAddress)
|
||||
return &(*i);
|
||||
if (address >= bp.StartAddress && address <= bp.EndAddress)
|
||||
return &(bp);
|
||||
}
|
||||
else if (i->StartAddress == address)
|
||||
return &(*i);
|
||||
else if (bp.StartAddress == address)
|
||||
return &(bp);
|
||||
}
|
||||
|
||||
// none found
|
||||
|
Reference in New Issue
Block a user