From 7b13448f05882b98c836c32329b1aca347abeb52 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 18 Apr 2010 14:26:51 +0000 Subject: PPC: avoid function pointer type mismatch, spotted by clang Fixes clang errors: CC ppc-softmmu/translate.o /src/qemu/target-ppc/translate.c:3748:13: error: comparison of distinct pointer types ('void (*)(void *, int, int)' and 'void *') if (likely(read_cb != SPR_NOACCESS)) { /src/qemu/target-ppc/translate.c:3748:28: note: instantiated from: if (likely(read_cb != SPR_NOACCESS)) { /src/qemu/target-ppc/translate.c:3903:13: error: comparison of distinct pointer types ('void (*)(void *, int, int)' and 'void *') if (likely(write_cb != SPR_NOACCESS)) { /src/qemu/target-ppc/translate.c:3903:29: note: instantiated from: if (likely(write_cb != SPR_NOACCESS)) { Signed-off-by: Blue Swirl --- target-ppc/translate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'target-ppc/translate.c') diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 0af7e4f151..3869c2401b 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3719,16 +3719,14 @@ static void gen_mfmsr(DisasContext *ctx) #endif } -#if 1 -#define SPR_NOACCESS ((void *)(-1UL)) -#else -static void spr_noaccess (void *opaque, int sprn) +static void spr_noaccess(void *opaque, int gprn, int sprn) { +#if 0 sprn = ((sprn >> 5) & 0x1F) | ((sprn & 0x1F) << 5); printf("ERROR: try to access SPR %d !\n", sprn); +#endif } #define SPR_NOACCESS (&spr_noaccess) -#endif /* mfspr */ static inline void gen_op_mfspr(DisasContext *ctx) -- cgit v1.2.3