From f4ee044347c0b4e9e399aac78d5599858298bfbe Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 11 Oct 2018 22:17:16 -0400 Subject: [PATCH] Fix control reaches end of non-void function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change makes it so that there is a return value when a kind doens't match. Allows -Werror=return-type to pass. ``` Core/debugger.c: In function ‘read_lvalue’: Core/debugger.c:239:1: error: control reaches end of non-void function [-Werror=return-type] } ``` --- Core/debugger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/debugger.c b/Core/debugger.c index 2cc49ab..c125d60 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -226,15 +226,15 @@ static value_t read_lvalue(GB_gameboy_t *gb, lvalue_t lvalue) return VALUE_16(GB_read_memory(gb, lvalue.memory_address.value) | (GB_read_memory(gb, lvalue.memory_address.value + 1) * 0x100)); - - case LVALUE_REG16: - return VALUE_16(*lvalue.register_address); - case LVALUE_REG_L: return VALUE_16(*lvalue.register_address & 0x00FF); case LVALUE_REG_H: return VALUE_16(*lvalue.register_address >> 8); + + case LVALUE_REG16: + default: + return VALUE_16(*lvalue.register_address); } }