summaryrefslogtreecommitdiffstats
path: root/target-ppc/translate.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-12 00:04:48 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-12 00:04:48 +0000
commit6f2d8978728c48ca46f5c01835438508aace5c64 (patch)
tree73172710b5af52a2d988a58fb24945a24d42da84 /target-ppc/translate.c
parent8582a53a34b2d3fe811d29703eed7519efdf8f2e (diff)
downloadhqemu-6f2d8978728c48ca46f5c01835438508aace5c64.zip
hqemu-6f2d8978728c48ca46f5c01835438508aace5c64.tar.gz
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
Diffstat (limited to 'target-ppc/translate.c')
-rw-r--r--target-ppc/translate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 73b2e22..be4ac53 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)
{
OpenPOWER on IntegriCloud