From 6256d0bf8d855ea7b16b60eedbbb4b43dd4ad6bc Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 15 Sep 2018 18:33:33 +0100 Subject: [PATCH] Correct compilation warnings. Signed-off-by: Adrian Conlon --- inc/EightBitCompilerDefinitions.h | 2 +- src/Bus.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/EightBitCompilerDefinitions.h b/inc/EightBitCompilerDefinitions.h index 7b79991..10f6bc4 100644 --- a/inc/EightBitCompilerDefinitions.h +++ b/inc/EightBitCompilerDefinitions.h @@ -72,7 +72,7 @@ inline void EightBit::assume(int expression) { # define PARITY(x) EightBit::oddParity(x) -# define UNREACHABLE ASSUME(0) +# define UNREACHABLE { ASSUME(0); throw new std::exception("unreachable"); } #elif defined(__GNUG__) diff --git a/src/Bus.cpp b/src/Bus.cpp index c315976..04106aa 100644 --- a/src/Bus.cpp +++ b/src/Bus.cpp @@ -32,7 +32,7 @@ void EightBit::Bus::loadHexFile(const std::string path) { const auto address = chunk.first; const auto content = chunk.second; for (size_t i = 0; i != content.size(); ++i) - write(address + i, content[i]); + write((uint16_t)(address + i), content[i]); const auto mapped = mapping(address); mapped.memory.load(content, address - mapped.begin); }