From 7b9cea0596269db57a0a7335ed9d62eeb7d7ef4c Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Tue, 15 Jul 2014 16:05:28 +0900 Subject: [PATCH] emulator: fix some compilation warnings on Windows Fix compilation warnings -Wpointer-to-int-cast, -Wint-to-pointor-cast. Change-Id: I85d9063e7d89d88a27da7e90d76c1b8bd6a11fc8 Signed-off-by: SeokYeon Hwang --- exec.c | 2 +- target-i386/hax-darwin.c | 6 +++--- target-i386/hax-windows.c | 8 ++++---- tizen/emulator_configure.sh | 2 -- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/exec.c b/exec.c index 346a196596..b6035d5399 100644 --- a/exec.c +++ b/exec.c @@ -1297,7 +1297,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, */ if (hax_enabled()) { int ret; - ret = hax_populate_ram((uint64_t)new_block->host, size); + ret = hax_populate_ram((uint64_t)(intptr_t)new_block->host, size); if (ret < 0) { fprintf(stderr, "Hax failed to populate ram\n"); exit(-1); diff --git a/target-i386/hax-darwin.c b/target-i386/hax-darwin.c index be889cd674..5339ce0b04 100644 --- a/target-i386/hax-darwin.c +++ b/target-i386/hax-darwin.c @@ -84,7 +84,7 @@ int hax_set_phys_mem(MemoryRegionSection *section) info.pa_start = start_addr; info.size = size; - info.va = (uint64_t)(memory_region_get_ram_ptr(mr) + section->offset_within_region); + info.va = (int64_t)(intptr_t)(memory_region_get_ram_ptr(mr) + section->offset_within_region); info.flags = memory_region_is_rom(mr) ? 1 : 0; ret = ioctl(hax_global.vm->fd, HAX_VM_IOCTL_SET_RAM, pinfo); @@ -248,8 +248,8 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) return ret; } - vcpu->tunnel = (struct hax_tunnel *)(info.va); - vcpu->iobuf = (unsigned char *)(info.io_va); + vcpu->tunnel = (struct hax_tunnel *)(intptr_t)(info.va); + vcpu->iobuf = (unsigned char *)(intptr_t)(info.io_va); return 0; } diff --git a/target-i386/hax-windows.c b/target-i386/hax-windows.c index 10d49bcff7..d6f402a8ac 100644 --- a/target-i386/hax-windows.c +++ b/target-i386/hax-windows.c @@ -121,8 +121,8 @@ int hax_set_phys_mem(MemoryRegionSection *section) info.pa_start = start_addr; info.size = size; - info.va = (uint64_t)(memory_region_get_ram_ptr(mr) + - section->offset_within_region); + info.va = (uint64_t)(intptr_t)(memory_region_get_ram_ptr(mr) + + section->offset_within_region); info.flags = memory_region_is_rom(mr) ? 1 : 0; hDeviceVM = hax_global.vm->fd; @@ -357,8 +357,8 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) ret = -EINVAL; return ret; } - vcpu->tunnel = (struct hax_tunnel *)(info.va); - vcpu->iobuf = (unsigned char *)(info.io_va); + vcpu->tunnel = (struct hax_tunnel *)(intptr_t)(info.va); + vcpu->iobuf = (unsigned char *)(intptr_t)(info.io_va); return 0; } diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index b942a1a8cd..471697421d 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -216,8 +216,6 @@ exec ./configure \ --enable-werror \ --extra-cflags=-Wno-error=format \ --extra-cflags=-Wno-error=format-extra-args \ - --extra-cflags=-Wno-error=pointer-to-int-cast \ - --extra-cflags=-Wno-error=int-to-pointer-cast \ --extra-ldflags=-Wl,--large-address-aware \ --cc=gcc \ --disable-coroutine-pool \ -- 2.34.1