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 <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-04-18 14:26:51 +00:00
parent 8c0d577eb5
commit 7b13448f05
1 changed files with 3 additions and 5 deletions

View File

@ -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)