forked from dolphin-emu/dolphin
Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
This commit is contained in:
@@ -196,7 +196,7 @@ void AnalyzeFunction2(Symbol *func)
|
||||
u32 flags = func->flags;
|
||||
|
||||
bool nonleafcall = false;
|
||||
for (auto c : func->calls)
|
||||
for (const SCall& c : func->calls)
|
||||
{
|
||||
Symbol *called_func = g_symbolDB.GetSymbolFromAddr(c.function);
|
||||
if (called_func && (called_func->flags & FFLAG_LEAF) == 0)
|
||||
@@ -603,10 +603,10 @@ void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
|
||||
{
|
||||
vector<u32> funcAddrs;
|
||||
|
||||
for (PPCSymbolDB::XFuncMap::iterator iter = func_db->GetIterator(); iter != func_db->End(); ++iter)
|
||||
funcAddrs.push_back(iter->second.address + iter->second.size);
|
||||
for (const auto& func : func_db->Symbols())
|
||||
funcAddrs.push_back(func.second.address + func.second.size);
|
||||
|
||||
for (auto location : funcAddrs)
|
||||
for (u32& location : funcAddrs)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -637,15 +637,15 @@ void FindFunctions(u32 startAddr, u32 endAddr, PPCSymbolDB *func_db)
|
||||
int numLeafs = 0, numNice = 0, numUnNice = 0;
|
||||
int numTimer = 0, numRFI = 0, numStraightLeaf = 0;
|
||||
int leafSize = 0, niceSize = 0, unniceSize = 0;
|
||||
for (PPCSymbolDB::XFuncMap::iterator iter = func_db->GetIterator(); iter != func_db->End(); ++iter)
|
||||
for (auto& func : func_db->AccessSymbols())
|
||||
{
|
||||
if (iter->second.address == 4)
|
||||
if (func.second.address == 4)
|
||||
{
|
||||
WARN_LOG(OSHLE, "Weird function");
|
||||
continue;
|
||||
}
|
||||
AnalyzeFunction2(&(iter->second));
|
||||
Symbol &f = iter->second;
|
||||
AnalyzeFunction2(&(func.second));
|
||||
Symbol &f = func.second;
|
||||
if (f.name.substr(0, 3) == "zzz")
|
||||
{
|
||||
if (f.flags & FFLAG_LEAF)
|
||||
|
||||
Reference in New Issue
Block a user