diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-09-27 12:19:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-27 12:19:18 +0200 |
| commit | f701724ee7f884fb1e09b38631eb2ea3cf55cca2 (patch) | |
| tree | b143e225acc1b5594a4190a01c86cbfba4b8f47c /Source/Core | |
| parent | 9525a9e048801c6dd8e8e0a10dd919c7a9114bc5 (diff) | |
| parent | 082275d785e725504e82cc6cb1e1d2cd2af868bc (diff) | |
Merge pull request #4251 from lioncash/define
PPCAnalyst: Convert #define into a constant
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/PPCAnalyst.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 69c95acd0b..9f38df5ade 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -30,9 +30,11 @@ namespace PPCAnalyst { -static const int CODEBUFFER_SIZE = 32000; +constexpr int CODEBUFFER_SIZE = 32000; // 0 does not perform block merging -static const u32 FUNCTION_FOLLOWING_THRESHOLD = 16; +constexpr u32 FUNCTION_FOLLOWING_THRESHOLD = 16; + +constexpr u32 INVALID_BRANCH_TARGET = 0xFFFFFFFF; CodeBuffer::CodeBuffer(int size) { @@ -45,8 +47,6 @@ CodeBuffer::~CodeBuffer() delete[] codebuffer; } -#define INVALID_TARGET ((u32)-1) - static u32 EvaluateBranchTarget(UGeckoInstruction instr, u32 pc) { switch (instr.OPCD) @@ -60,7 +60,7 @@ static u32 EvaluateBranchTarget(UGeckoInstruction instr, u32 pc) return target; } default: - return INVALID_TARGET; + return INVALID_BRANCH_TARGET; } } @@ -168,7 +168,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol& func, int max_size) else { u32 target = EvaluateBranchTarget(instr, addr); - if (target != INVALID_TARGET && instr.LK) + if (target != INVALID_BRANCH_TARGET && instr.LK) { // we found a branch-n-link! func.calls.emplace_back(target, addr); |
