Prepare 32 bit support

This commit is contained in:
Maurice Heumann
2025-04-14 12:13:38 +02:00
parent 35945caeec
commit a6dd9251b8
29 changed files with 111 additions and 80 deletions

View File

@@ -16,7 +16,7 @@ target_link_libraries(windows-emulator-test PRIVATE
windows-emulator
)
if(WIN32)
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
add_dependencies(windows-emulator-test test-sample)
endif()

View File

@@ -34,7 +34,7 @@ namespace test
constexpr auto offset = 1;
const auto instructionsToExecute = executedInstructions - offset;
new_emu.start(instructionsToExecute);
new_emu.start(static_cast<size_t>(instructionsToExecute));
ASSERT_EQ(new_emu.get_executed_instructions(), instructionsToExecute);
ASSERT_NOT_TERMINATED(new_emu);

View File

@@ -155,7 +155,7 @@ namespace test
return s1.get_diff(s2).has_value();
};
if (!has_diff_after_count(limit))
if (!has_diff_after_count(static_cast<size_t>(limit)))
{
puts("Emulation has no diff");
}
@@ -170,7 +170,7 @@ namespace test
const auto diff = (upper_bound - lower_bound);
const auto pivot = lower_bound + (diff / 2);
const auto has_diff = has_diff_after_count(pivot);
const auto has_diff = has_diff_after_count(static_cast<size_t>(pivot));
auto* bound = has_diff ? &upper_bound : &lower_bound;
*bound = pivot;
@@ -178,7 +178,7 @@ namespace test
printf("Bounds: %" PRIx64 " - %" PRIx64 "\n", lower_bound, upper_bound);
}
(void)get_state_for_count(lower_bound);
(void)get_state_for_count(static_cast<size_t>(lower_bound));
const auto rip = emu.emu().read_instruction_pointer();