aboutsummaryrefslogtreecommitdiff
path: root/exec-all.h
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2011-10-23 08:19:10 +0200
committerBlue Swirl <blauwirbel@gmail.com>2011-10-30 09:05:00 +0000
commitc2f36c6ce777c461faffa904aabaeb56e6458b9e (patch)
treefa4cc84eb7ceca41bde00ee145176199aaf3b52f /exec-all.h
parentd787fcf45f193d3f439ee431f82b7a075c9f5784 (diff)
exec-all: Fix void pointer arithmetic
Adding an offset to a void pointer works with gcc but is not allowed by the current C standards. With -pedantic, gcc complains: exec-all.h:344: error: pointer of type ‘void *’ used in arithmetic Fix this, and also replace (unsigned long) by (uintptr_t) in the same statement. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec-all.h')
-rw-r--r--exec-all.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/exec-all.h b/exec-all.h
index 72ef246793..85a37bf1ed 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -340,8 +340,7 @@ static inline tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong add
cpu_abort(env1, "Trying to execute code outside RAM or ROM at 0x" TARGET_FMT_lx "\n", addr);
#endif
}
- p = (void *)(unsigned long)addr
- + env1->tlb_table[mmu_idx][page_index].addend;
+ p = (void *)((uintptr_t)addr + env1->tlb_table[mmu_idx][page_index].addend);
return qemu_ram_addr_from_host_nofail(p);
}
#endif