From 45be1c19df5642fcba5c4c32d86994fe2067116b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 22 Mar 2018 21:59:39 -0400 Subject: [PATCH] Resolves undefined behaviour of a signed shift left. --- Processors/Z80/Implementation/Z80Storage.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Processors/Z80/Implementation/Z80Storage.hpp b/Processors/Z80/Implementation/Z80Storage.hpp index 0ef7244dd..24387224f 100644 --- a/Processors/Z80/Implementation/Z80Storage.hpp +++ b/Processors/Z80/Implementation/Z80Storage.hpp @@ -134,9 +134,9 @@ class ProcessorStorage { uint8_t carry_result_; // the carry flag is set if bit 0 of carry_result_ is set uint8_t halt_mask_ = 0xff; - int flag_adjustment_history_ = 0; // a shifting record of whether each opcode set any flags; it turns out - // that knowledge of what the last opcode did is necessary to get bits 5 & 3 - // correct for SCF and CCF. + unsigned int flag_adjustment_history_ = 0; // a shifting record of whether each opcode set any flags; it turns out + // that knowledge of what the last opcode did is necessary to get bits 5 & 3 + // correct for SCF and CCF. HalfCycles number_of_cycles_;