From e1793b6305badbcf62a9ef15cad4c520ff8e4947 Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Wed, 22 Jan 2020 12:42:22 +0100 Subject: [PATCH] Fix compilation warnings from previous commits. --- cpu/ppc/ppcemu.h | 4 ++-- cpu/ppc/ppcfpopcodes.cpp | 7 ++----- main.cpp | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cpu/ppc/ppcemu.h b/cpu/ppc/ppcemu.h index b79531b..7133dc8 100644 --- a/cpu/ppc/ppcemu.h +++ b/cpu/ppc/ppcemu.h @@ -28,8 +28,8 @@ enum endian_switch {big_end = 0, little_end = 1}; typedef void (*PPCOpcode)(void); -typedef union FPR_storage { - double dbl64_r = 0.0; // double floating-point representation +union FPR_storage { + double dbl64_r; // double floating-point representation uint64_t int64_r; // double integer representation }; diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index c33dc7c..50725a1 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -242,8 +242,6 @@ bool ppc_confirm_inf_nan(uint64_t input_a, uint64_t input_b, bool is_single, uin return true; } break; - default: - return false; } } else { @@ -282,10 +280,9 @@ bool ppc_confirm_inf_nan(uint64_t input_a, uint64_t input_b, bool is_single, uin return true; } break; - default: - return false; } } + return false; } void ppc_fpresult_update(uint64_t set_result, bool confirm_arc) { @@ -1196,4 +1193,4 @@ void ppc_fcmpu() { if ((db_test_a == snan) || (db_test_b == snan)) { ppc_state.ppc_fpscr |= 0x1000000; } -} \ No newline at end of file +} diff --git a/main.cpp b/main.cpp index 57a9149..70750ed 100644 --- a/main.cpp +++ b/main.cpp @@ -100,7 +100,6 @@ uint8_t write_char; //Initialize the PPC's registers. void reg_init(){ for (uint32_t i = 0; i < 32; i++){ - ppc_state.ppc_fpr[i].dbl64_r = 0.0; ppc_state.ppc_fpr[i].int64_r = 0; } ppc_state.ppc_pc = 0; @@ -174,7 +173,7 @@ void reg_init(){ //Debugging Functions uint32_t reg_print(){ for (uint32_t i = 0; i < 32; i++){ - printf("FPR %d : %" PRIx64 "", i, ppc_state.ppc_fpr[i]); + printf("FPR %d : %" PRIx64 "", i, ppc_state.ppc_fpr[i].int64_r); } ppc_state.ppc_pc = 0; for (uint32_t i = 0; i < 32; i++){