From 7de23ec2aa45dfb85cf2fbf36440eaac781f8d13 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 21 Apr 2025 23:03:57 -0400 Subject: [PATCH] Be specific about types. --- Machines/PCCompatible/PCCompatible.cpp | 2 +- Machines/PCCompatible/SegmentedMemory.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 5de8359b0..b1308143a 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -369,7 +369,7 @@ public: template IntT in(const uint16_t port) { if constexpr (std::is_same_v) { - return in(port) | (in(port + 1) << 8); + return uint16_t(in(port) | (in(port + 1) << 8)); } else { static_assert(std::is_same_v); diff --git a/Machines/PCCompatible/SegmentedMemory.hpp b/Machines/PCCompatible/SegmentedMemory.hpp index afaae8c12..a1da4d82d 100644 --- a/Machines/PCCompatible/SegmentedMemory.hpp +++ b/Machines/PCCompatible/SegmentedMemory.hpp @@ -40,7 +40,7 @@ template struct ProgramFetcher { LinearMemory &linear_memory ) const { const auto &descriptor = segments.descriptors[InstructionSet::x86::Source::CS]; - const auto base = descriptor.base() & (linear_memory.MaxAddress - 1); + const auto base = uint32_t(descriptor.base() & (linear_memory.MaxAddress - 1)); return std::make_pair( linear_memory.at(base), std::min(0x1'0000, 1 + descriptor.bounds().end - base)