diff options
author | Lyude Paul <lyude@redhat.com> | 2017-10-13 15:44:30 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-10-20 13:15:32 -0400 |
commit | cbca18c5516084ee540255df52e116209f1c1cbe (patch) | |
tree | dfa34064432a40887591a514ddbffe846e73c4a5 /hw/xfree86/x86emu | |
parent | 01470ce0a9628abc8af4fe7b960f0d1eced8cd46 (diff) |
x86emu: Fix type conversion warnings on x86_64 with DEBUG
Warnings come from the fact that PRIx32 is not used for printing 32 bit
values instead of "%lx", and "%lx" evaluates to a 64 bit long on 64 bit
systems while PRIx32 always evaluates to the right type for the
respective arch.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86/x86emu')
-rw-r--r-- | hw/xfree86/x86emu/sys.c | 12 | ||||
-rw-r--r-- | hw/xfree86/x86emu/x86emu/types.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c index 5eba35856..ccce540e7 100644 --- a/hw/xfree86/x86emu/sys.c +++ b/hw/xfree86/x86emu/sys.c @@ -191,7 +191,7 @@ rdb(u32 addr) u8 val; if (addr > M.mem_size - 1) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -217,7 +217,7 @@ rdw(u32 addr) u16 val = 0; if (addr > M.mem_size - 2) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -249,7 +249,7 @@ rdl(u32 addr) u32 val = 0; if (addr > M.mem_size - 4) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -282,7 +282,7 @@ wrb(u32 addr, u8 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 1 <- %#x\n", addr, val);) if (addr > M.mem_size - 1) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } @@ -303,7 +303,7 @@ wrw(u32 addr, u16 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 2 <- %#x\n", addr, val);) if (addr > M.mem_size - 2) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } @@ -331,7 +331,7 @@ wrl(u32 addr, u32 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 4 <- %#x\n", addr, val);) if (addr > M.mem_size - 4) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h index 5a6ef01f8..0559bc089 100644 --- a/hw/xfree86/x86emu/x86emu/types.h +++ b/hw/xfree86/x86emu/x86emu/types.h @@ -61,6 +61,7 @@ /*---------------------- Macros and type definitions ----------------------*/ #include <stdint.h> +#include <inttypes.h> typedef uint8_t u8; typedef uint16_t u16; |