From 00ddbee786f6a2a15c1e19e5ac4b393f6c6f9094 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Sep 2016 21:16:04 -0400 Subject: [PATCH] SymbolDB: Change Symbol's 'analyzed' member into a boolean It's only ever used as one --- Source/Core/Common/SymbolDB.h | 2 +- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/SymbolDB.h b/Source/Core/Common/SymbolDB.h index 1b75a58b5f..db4f735683 100644 --- a/Source/Core/Common/SymbolDB.h +++ b/Source/Core/Common/SymbolDB.h @@ -39,7 +39,7 @@ struct Symbol int numCalls = 0; Type type = Type::Function; int index = 0; // only used for coloring the disasm view - int analyzed = 0; + bool analyzed = false; }; enum diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 43a5f041fe..69c95acd0b 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -75,7 +75,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol& func, int max_size) { if (!func.name.size()) func.name = StringFromFormat("zz_%07x_", startAddr & 0x0FFFFFF); - if (func.analyzed >= 1) + if (func.analyzed) return true; // No error, just already did it. func.calls.clear(); @@ -96,7 +96,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol& func, int max_size) if (max_size && func.size > max_size) { func.address = startAddr; - func.analyzed = 1; + func.analyzed = true; func.hash = SignatureDB::ComputeCodeChecksum(startAddr, addr); if (numInternalBranches == 0) func.flags |= FFLAG_STRAIGHT; @@ -117,7 +117,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol& func, int max_size) // We're done! Looks like we have a neat valid function. Perfect. // Let's calc the checksum and get outta here func.address = startAddr; - func.analyzed = 1; + func.analyzed = true; func.hash = SignatureDB::ComputeCodeChecksum(startAddr, addr); if (numInternalBranches == 0) func.flags |= FFLAG_STRAIGHT;