From bf4889f23838b737995f853c15c7d076acd5847b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 13 Jun 2019 10:43:00 -0400 Subject: [PATCH] Reduces warnings to 6. --- .../Implementation/68000Implementation.hpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 9171d4ea3..1d4e180b8 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -1523,8 +1523,8 @@ template void Proces */ #define set_neg_zero_overflow(v, m) \ zero_result_ = decltype(zero_result_)(v); \ - negative_flag_ = zero_result_ & decltype(zero_result_)(m); \ - overflow_flag_ = (value ^ zero_result_) & decltype(zero_result_)(m); + negative_flag_ = zero_result_ & decltype(negative_flag_)(m); \ + overflow_flag_ = (decltype(zero_result_)(value) ^ zero_result_) & decltype(overflow_flag_)(m); #define decode_shift_count() \ int shift_count = (decoded_instruction_.full & 32) ? data_[(decoded_instruction_.full >> 9) & 7].full&63 : ( ((decoded_instruction_.full >> 9)&7) ? ((decoded_instruction_.full >> 9)&7) : 8) ; \ @@ -1542,7 +1542,7 @@ template void Proces carry_flag_ = 0; \ } else { \ destination = decltype(destination)(value << shift_count); \ - extend_flag_ = carry_flag_ = decltype(carry_flag_)(value & ((1 << (size - 1)) >> (shift_count - 1))); \ + extend_flag_ = carry_flag_ = decltype(carry_flag_)(value) & decltype(carry_flag_)( (1 << (size - 1)) >> (shift_count - 1) ); \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \ @@ -1567,11 +1567,11 @@ template void Proces if(!shift_count) { \ carry_flag_ = 0; \ } else { \ - destination = decltype(destination)(\ + destination = decltype(destination)(\ (value >> shift_count) | \ ((value & (1 << (size - 1)) ? 0xffffffff : 0x000000000) << (size - shift_count)) \ ); \ - extend_flag_ = carry_flag_ = decltype(carry_flag_)(value & (1 << (shift_count - 1))); \ + extend_flag_ = carry_flag_ = decltype(carry_flag_)(value) & decltype(carry_flag_)(1 << (shift_count - 1)); \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \ @@ -1590,8 +1590,8 @@ template void Proces #undef set_neg_zero_overflow #define set_neg_zero_overflow(v, m) \ - zero_result_ = (v); \ - negative_flag_ = zero_result_ & (m); \ + zero_result_ = decltype(zero_result_)(v); \ + negative_flag_ = zero_result_ & decltype(zero_result_)(m); \ overflow_flag_ = 0; #undef set_flags @@ -1619,7 +1619,7 @@ template void Proces carry_flag_ = 0; \ } else { \ destination = value >> shift_count; \ - extend_flag_ = carry_flag_ = value & (1 << (shift_count - 1)); \ + extend_flag_ = carry_flag_ = value & decltype(carry_flag_)(1 << (shift_count - 1)); \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \ @@ -1672,11 +1672,11 @@ template void Proces carry_flag_ = 0; \ } else { \ shift_count &= (size - 1); \ - destination = decltype(destination)(\ + destination = decltype(destination)(\ (value >> shift_count) | \ (value << (size - shift_count)) \ );\ - carry_flag_ = destination & (1 << (size - 1)); \ + carry_flag_ = destination & decltype(carry_flag_)(1 << (size - 1)); \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \