From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJ5y5-00054z-GP for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:18:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJ5y4-00054H-1F for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:18:49 -0400 Received: from [199.232.76.173] (port=38619 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJ5y3-00054B-Mq for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:18:47 -0400 Received: from an-out-0708.google.com ([209.85.132.251]:48112) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJ5y4-0007kT-B7 for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:18:48 -0400 Received: by an-out-0708.google.com with SMTP id d18so95241and.130 for ; Wed, 16 Jul 2008 05:18:47 -0700 (PDT) Message-ID: Date: Wed, 16 Jul 2008 14:18:46 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [RESEND][PATCH] fix various compiler warnings In-Reply-To: <4879F6FC.3030209@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <485F474D.6050001@web.de> <4879F6FC.3030209@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 2008/7/13 Jan Kiszka : > 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