summaryrefslogtreecommitdiff
path: root/src/core/memory
diff options
context:
space:
mode:
authorGravatar Lioncash2020-04-15 15:59:23 -0400
committerGravatar Lioncash2020-04-15 21:33:46 -0400
commit1c340c6efad903580904297730d708ce8b947eb6 (patch)
treea79ad11775373ecf31912a7a50fcfbcc08d6e8b3 /src/core/memory
parentMerge pull request #3612 from ReinUsesLisp/red (diff)
downloadyuzu-1c340c6efad903580904297730d708ce8b947eb6.tar.gz
yuzu-1c340c6efad903580904297730d708ce8b947eb6.tar.xz
yuzu-1c340c6efad903580904297730d708ce8b947eb6.zip
CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
Diffstat (limited to 'src/core/memory')
-rw-r--r--src/core/memory/dmnt_cheat_vm.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/memory/dmnt_cheat_vm.cpp b/src/core/memory/dmnt_cheat_vm.cpp
index 4f4fa5099..5bb26a36f 100644
--- a/src/core/memory/dmnt_cheat_vm.cpp
+++ b/src/core/memory/dmnt_cheat_vm.cpp
@@ -55,7 +55,7 @@ void DmntCheatVm::LogOpcode(const CheatVmOpcode& opcode) {
55 fmt::format("Cond Type: {:X}", static_cast<u32>(begin_cond->cond_type))); 55 fmt::format("Cond Type: {:X}", static_cast<u32>(begin_cond->cond_type)));
56 callbacks->CommandLog(fmt::format("Rel Addr: {:X}", begin_cond->rel_address)); 56 callbacks->CommandLog(fmt::format("Rel Addr: {:X}", begin_cond->rel_address));
57 callbacks->CommandLog(fmt::format("Value: {:X}", begin_cond->value.bit64)); 57 callbacks->CommandLog(fmt::format("Value: {:X}", begin_cond->value.bit64));
58 } else if (auto end_cond = std::get_if<EndConditionalOpcode>(&opcode.opcode)) { 58 } else if (std::holds_alternative<EndConditionalOpcode>(opcode.opcode)) {
59 callbacks->CommandLog("Opcode: End Conditional"); 59 callbacks->CommandLog("Opcode: End Conditional");
60 } else if (auto ctrl_loop = std::get_if<ControlLoopOpcode>(&opcode.opcode)) { 60 } else if (auto ctrl_loop = std::get_if<ControlLoopOpcode>(&opcode.opcode)) {
61 if (ctrl_loop->start_loop) { 61 if (ctrl_loop->start_loop) {
@@ -399,6 +399,7 @@ bool DmntCheatVm::DecodeNextOpcode(CheatVmOpcode& out) {
399 // 8kkkkkkk 399 // 8kkkkkkk
400 // Just parse the mask. 400 // Just parse the mask.
401 begin_keypress_cond.key_mask = first_dword & 0x0FFFFFFF; 401 begin_keypress_cond.key_mask = first_dword & 0x0FFFFFFF;
402 opcode.opcode = begin_keypress_cond;
402 } break; 403 } break;
403 case CheatVmOpcodeType::PerformArithmeticRegister: { 404 case CheatVmOpcodeType::PerformArithmeticRegister: {
404 PerformArithmeticRegisterOpcode perform_math_reg{}; 405 PerformArithmeticRegisterOpcode perform_math_reg{};
@@ -779,7 +780,7 @@ void DmntCheatVm::Execute(const CheatProcessMetadata& metadata) {
779 if (!cond_met) { 780 if (!cond_met) {
780 SkipConditionalBlock(); 781 SkipConditionalBlock();
781 } 782 }
782 } else if (auto end_cond = std::get_if<EndConditionalOpcode>(&cur_opcode.opcode)) { 783 } else if (std::holds_alternative<EndConditionalOpcode>(cur_opcode.opcode)) {
783 // Decrement the condition depth. 784 // Decrement the condition depth.
784 // We will assume, graciously, that mismatched conditional block ends are a nop. 785 // We will assume, graciously, that mismatched conditional block ends are a nop.
785 if (condition_depth > 0) { 786 if (condition_depth > 0) {