From 97a121b8d43e605584e696a1ba8a4d3a715ff78d Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 17 Mar 2018 23:34:27 +0000 Subject: [PATCH] Unneeded UNREACHABLEs can cause gcc to produce problematic code. TBC Signed-off-by: Adrian Conlon --- Intel8080/inc/Intel8080.h | 4 ---- Intel8080/src/Intel8080.cpp | 3 --- Z80/inc/Z80.h | 6 ------ Z80/src/Z80.cpp | 4 ---- 4 files changed, 17 deletions(-) diff --git a/Intel8080/inc/Intel8080.h b/Intel8080/inc/Intel8080.h index fda563b..a3e2475 100644 --- a/Intel8080/inc/Intel8080.h +++ b/Intel8080/inc/Intel8080.h @@ -68,7 +68,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } void R(int r, uint8_t& a, uint8_t value) { @@ -100,7 +99,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } register16_t& RP(int rp) { @@ -116,7 +114,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } register16_t& RP2(int rp) { @@ -132,7 +129,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } static void adjustAuxiliaryCarryAdd(uint8_t& f, uint8_t before, uint8_t value, int calculation) { diff --git a/Intel8080/src/Intel8080.cpp b/Intel8080/src/Intel8080.cpp index 6a6e290..d08fb87 100644 --- a/Intel8080/src/Intel8080.cpp +++ b/Intel8080/src/Intel8080.cpp @@ -68,7 +68,6 @@ bool EightBit::Intel8080::jumpConditionalFlag(uint8_t& f, int flag) { default: UNREACHABLE; } - UNREACHABLE; } bool EightBit::Intel8080::returnConditionalFlag(uint8_t& f, int flag) { @@ -92,7 +91,6 @@ bool EightBit::Intel8080::returnConditionalFlag(uint8_t& f, int flag) { default: UNREACHABLE; } - UNREACHABLE; } bool EightBit::Intel8080::callConditionalFlag(uint8_t& f, int flag) { @@ -116,7 +114,6 @@ bool EightBit::Intel8080::callConditionalFlag(uint8_t& f, int flag) { default: UNREACHABLE; } - UNREACHABLE; } void EightBit::Intel8080::add(uint8_t& f, register16_t& operand, register16_t value) { diff --git a/Z80/inc/Z80.h b/Z80/inc/Z80.h index 62d3e7a..7bf1843 100644 --- a/Z80/inc/Z80.h +++ b/Z80/inc/Z80.h @@ -148,7 +148,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } void R(int r, uint8_t& a, uint8_t value) { @@ -182,7 +181,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } uint8_t R2(int r, uint8_t a) { @@ -208,7 +206,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } void R2(int r, uint8_t& a, uint8_t value) { @@ -242,7 +239,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } register16_t& RP(int rp) { @@ -260,7 +256,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } register16_t& HL2() { @@ -287,7 +282,6 @@ namespace EightBit { default: UNREACHABLE; } - UNREACHABLE; } static void adjustHalfCarryAdd(uint8_t& f, uint8_t before, uint8_t value, int calculation) { diff --git a/Z80/src/Z80.cpp b/Z80/src/Z80.cpp index ba8aab5..22c8cf0 100644 --- a/Z80/src/Z80.cpp +++ b/Z80/src/Z80.cpp @@ -88,7 +88,6 @@ bool EightBit::Z80::jrConditionalFlag(uint8_t f, const int flag) { default: UNREACHABLE; } - UNREACHABLE; } bool EightBit::Z80::jumpConditionalFlag(uint8_t f, const int flag) { @@ -114,7 +113,6 @@ bool EightBit::Z80::jumpConditionalFlag(uint8_t f, const int flag) { default: UNREACHABLE; } - UNREACHABLE; } void EightBit::Z80::retn() { @@ -149,7 +147,6 @@ bool EightBit::Z80::returnConditionalFlag(uint8_t f, const int flag) { default: UNREACHABLE; } - UNREACHABLE; } bool EightBit::Z80::callConditionalFlag(uint8_t f, const int flag) { @@ -175,7 +172,6 @@ bool EightBit::Z80::callConditionalFlag(uint8_t f, const int flag) { default: UNREACHABLE; } - UNREACHABLE; } void EightBit::Z80::sbc(uint8_t& f, register16_t& operand, const register16_t value) {