From 6f2d8978728c48ca46f5c01835438508aace5c64 Mon Sep 17 00:00:00 2001 From: j_mayer Date: Mon, 12 Nov 2007 00:04:48 +0000 Subject: Fix usage of the -1 constant in the PowerPC target code: fix invalid size casts and/or sign-extensions. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3626 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/translate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'target-ppc/translate.c') diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 73b2e2212c..be4ac53909 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -404,15 +404,15 @@ static always_inline target_ulong MASK (uint32_t start, uint32_t end) #if defined(TARGET_PPC64) if (likely(start == 0)) { - ret = (uint64_t)(-1ULL) << (63 - end); + ret = UINT64_MAX << (63 - end); } else if (likely(end == 63)) { - ret = (uint64_t)(-1ULL) >> start; + ret = UINT64_MAX >> start; } #else if (likely(start == 0)) { - ret = (uint32_t)(-1ULL) << (31 - end); + ret = UINT32_MAX << (31 - end); } else if (likely(end == 31)) { - ret = (uint32_t)(-1ULL) >> start; + ret = UINT32_MAX >> start; } #endif else { @@ -3517,7 +3517,7 @@ GEN_HANDLER(mfmsr, 0x1F, 0x13, 0x02, 0x001FF801, PPC_MISC) } #if 1 -#define SPR_NOACCESS ((void *)(-1)) +#define SPR_NOACCESS ((void *)(-1UL)) #else static void spr_noaccess (void *opaque, int sprn) { -- cgit v1.2.3