From 9ebc9b37e48f4c5ff234c2394a756633e263e0fa Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Thu, 27 May 2021 15:08:17 +0300 Subject: [PATCH] Warning fixes --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 8550e4e..a5ed3fa 100644 --- a/main.c +++ b/main.c @@ -264,7 +264,7 @@ int main(int argc, char **argv) { } // Yes, we're frugal - if (posix_memalign(&ram, 64 * 1024, RAMSIZE)) + if (posix_memalign((void **) &ram, 64 * 1024, RAMSIZE)) abort(); memset(ram, 0, RAMSIZE); @@ -274,7 +274,7 @@ int main(int argc, char **argv) { printf("Loading binary %u bytes\n", binlen); // TODO - if (posix_memalign(&progmem, 64 * 1024, binlen)) + if (posix_memalign((void **) &progmem, 64 * 1024, binlen)) abort(); if (fread(progmem, binlen, 1, binary) != 1) @@ -303,7 +303,7 @@ int main(int argc, char **argv) { .slot = 0, .guest_phys_addr = 0, .memory_size = RAMSIZE, - .userspace_addr = ram, + .userspace_addr = (uint64_t) ram, .flags = 0 }; ioctl(vmfd, KVM_SET_USER_MEMORY_REGION, ®ion); @@ -311,7 +311,7 @@ int main(int argc, char **argv) { region.slot = 1; region.guest_phys_addr = PROGSTART; region.memory_size = binlen; - region.userspace_addr = progmem; + region.userspace_addr = (uint64_t) progmem; region.flags = KVM_MEM_READONLY; ioctl(vmfd, KVM_SET_USER_MEMORY_REGION, ®ion); @@ -329,7 +329,7 @@ int main(int argc, char **argv) { abort(); const struct kvm_guest_debug dbg = { - .control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP; + .control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP }; if (ioctl(vcpu, KVM_SET_GUEST_DEBUG, &dbg) == -1) abort(); -- 2.30.2