Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-yates committed Dec 12, 2024
1 parent fe2261e commit a333e33
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/fuzzer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace

restore_emulator();

const auto memory = emu.emu().allocate_memory(page_align_up(std::max(data.size(), 1ULL)),
const auto memory = emu.emu().allocate_memory(page_align_up(std::max(data.size(), size_t(1))),
memory_permission::read_write);
emu.emu().write_memory(memory, data.data(), data.size());

Expand Down
2 changes: 1 addition & 1 deletion src/fuzzing-engine/fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace fuzzer
const auto executions = context.executions.exchange(0);
const auto highest_scorer = context.generator.get_highest_scorer();
const auto avg_score = context.generator.get_average_score();
printf("Executions/s: %lld - Score: %llX - Avg: %.3f\n", executions, highest_scorer.score, avg_score);
printf("Executions/s: %zd - Score: %zX - Avg: %.3f\n", executions, highest_scorer.score, avg_score);
}
}
}
10 changes: 6 additions & 4 deletions src/unicorn-emulator/unicorn_x64_emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,17 @@ namespace unicorn
mmio_write_callback write_cb) override
{
mmio_callbacks cb{
.read = [c = std::move(read_cb)](uc_engine*, const uint64_t addr, const uint32_t s)
.read = mmio_callbacks::read_wrapper(
[c = std::move(read_cb)](uc_engine*, const uint64_t addr, const uint32_t s)
{
return c(addr, s);
},
.write = [c = std::move(write_cb)](uc_engine*, const uint64_t addr, const uint32_t s,
}),
.write = mmio_callbacks::write_wrapper(
[c = std::move(write_cb)](uc_engine*, const uint64_t addr, const uint32_t s,
const uint64_t value)
{
c(addr, s, value);
}
})
};

uce(uc_mmio_map(*this, address, size, cb.read.get_c_function(), cb.read.get_user_data(),
Expand Down
4 changes: 2 additions & 2 deletions src/windows-emulator/syscall_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ void syscall_dispatcher::dispatch(windows_emulator& win_emu)
}
catch (std::exception& e)
{
printf("Syscall threw an exception: %X (0x%llX) - %s\n", syscall_id, address, e.what());
printf("Syscall threw an exception: %X (0x%zX) - %s\n", syscall_id, address, e.what());
emu.reg<uint64_t>(x64_register::rax, STATUS_UNSUCCESSFUL);
emu.stop();
}
catch (...)
{
printf("Syscall threw an unknown exception: %X (0x%llX)\n", syscall_id, address);
printf("Syscall threw an unknown exception: %X (0x%zX)\n", syscall_id, address);
emu.reg<uint64_t>(x64_register::rax, STATUS_UNSUCCESSFUL);
emu.stop();
}
Expand Down

0 comments on commit a333e33

Please sign in to comment.