From 13631fb7bce7c2f9011c6c6a6366b0a3178a7147 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Dec 2023 14:14:53 -0500 Subject: [PATCH] Resolve various 32->16 conversion warnings. --- InstructionSets/x86/Implementation/FlowControl.hpp | 12 ++++++------ InstructionSets/x86/Implementation/LoadStore.hpp | 2 +- InstructionSets/x86/Implementation/Logical.hpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/InstructionSets/x86/Implementation/FlowControl.hpp b/InstructionSets/x86/Implementation/FlowControl.hpp index 793f1c911..a8be5cb53 100644 --- a/InstructionSets/x86/Implementation/FlowControl.hpp +++ b/InstructionSets/x86/Implementation/FlowControl.hpp @@ -126,13 +126,13 @@ void call_far( return; case Source::Indirect: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; case Source::IndirectNoBase: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; case Source::DirectAddress: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; } @@ -161,13 +161,13 @@ void jump_far( case Source::Immediate: context.flow_controller.template jump(instruction.segment(), instruction.offset()); return; case Source::Indirect: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; case Source::IndirectNoBase: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; case Source::DirectAddress: - source_address = address(instruction, pointer, context); + source_address = uint16_t(address(instruction, pointer, context)); break; } diff --git a/InstructionSets/x86/Implementation/LoadStore.hpp b/InstructionSets/x86/Implementation/LoadStore.hpp index fc05fbb81..6c916b759 100644 --- a/InstructionSets/x86/Implementation/LoadStore.hpp +++ b/InstructionSets/x86/Implementation/LoadStore.hpp @@ -35,7 +35,7 @@ void ld( ContextT &context ) { const auto pointer = instruction.source(); - auto source_address = address(instruction, pointer, context); + uint16_t source_address = uint16_t(address(instruction, pointer, context)); const Source source_segment = instruction.data_segment(); context.memory.preauthorise_read(source_segment, source_address, 4); diff --git a/InstructionSets/x86/Implementation/Logical.hpp b/InstructionSets/x86/Implementation/Logical.hpp index 74c7816ba..3095ad61f 100644 --- a/InstructionSets/x86/Implementation/Logical.hpp +++ b/InstructionSets/x86/Implementation/Logical.hpp @@ -136,7 +136,7 @@ void setmo( write_t destination, ContextT &context ) { - const auto result = destination = ~0; + const auto result = destination = IntT(~0); context.flags.template set_from(0); context.flags.template set_from(result); }