[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RESEND][PATCH] fix various compiler warnings
From: |
andrzej zaborowski |
Subject: |
Re: [Qemu-devel] [RESEND][PATCH] fix various compiler warnings |
Date: |
Wed, 16 Jul 2008 14:18:46 +0200 |
2008/7/13 Jan Kiszka <address@hidden>:
> Here are those bits from the original patch which are still unfixed.
> Please apply what fits, fix differently where required or desired, or
> let me know how you would like to see it being addressed.
I applied this with small changes, please check because I already got
these things wrong on occasions.
> Index: b/linux-user/arm/nwfpe/fpa11_cpdt.c
> ===================================================================
> --- a/linux-user/arm/nwfpe/fpa11_cpdt.c
> +++ b/linux-user/arm/nwfpe/fpa11_cpdt.c
> @@ -227,7 +227,7 @@ unsigned int PerformLDF(const unsigned i
>
> //printk("PerformLDF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
>
> - pBase = (unsigned int*)readRegister(getRn(opcode));
> + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode));
> if (REG_PC == getRn(opcode))
> {
> pBase += 2;
> @@ -250,7 +250,7 @@ unsigned int PerformLDF(const unsigned i
> default: nRc = 0;
> }
>
> - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
> + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal);
> return nRc;
> }
>
> @@ -262,7 +262,7 @@ unsigned int PerformSTF(const unsigned i
> //printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
> SetRoundingMode(ROUND_TO_NEAREST);
>
> - pBase = (unsigned int*)readRegister(getRn(opcode));
> + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode));
> if (REG_PC == getRn(opcode))
> {
> pBase += 2;
> @@ -285,7 +285,7 @@ unsigned int PerformSTF(const unsigned i
> default: nRc = 0;
> }
>
> - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
> + if (write_back) writeRegister(getRn(opcode),(unsigned long)pFinal);
> return nRc;
> }
>
> @@ -294,7 +294,7 @@ unsigned int PerformLFM(const unsigned i
> unsigned int i, Fd, *pBase, *pAddress, *pFinal,
> write_back = WRITE_BACK(opcode);
>
> - pBase = (unsigned int*)readRegister(getRn(opcode));
> + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode));
> if (REG_PC == getRn(opcode))
> {
> pBase += 2;
> @@ -317,7 +317,7 @@ unsigned int PerformLFM(const unsigned i
> if (Fd == 8) Fd = 0;
> }
>
> - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
> + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal);
> return 1;
> }
>
> @@ -326,7 +326,7 @@ unsigned int PerformSFM(const unsigned i
> unsigned int i, Fd, *pBase, *pAddress, *pFinal,
> write_back = WRITE_BACK(opcode);
>
> - pBase = (unsigned int*)readRegister(getRn(opcode));
> + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode));
> if (REG_PC == getRn(opcode))
> {
> pBase += 2;
> @@ -349,7 +349,7 @@ unsigned int PerformSFM(const unsigned i
> if (Fd == 8) Fd = 0;
> }
>
> - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
> + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal);
> return 1;
> }
I skipped all these casts because these do seem to be papering over
the real issue, perhaps pFinal and pBase shouldn't be pointers at all,
but if the are, they should be uint32_t * as far as I can tell.
Regards