qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RESEND][PATCH] fix various compiler warnings
Date: Wed, 16 Jul 2008 14:18:46 +0200	[thread overview]
Message-ID: <fb249edb0807160518h559cdfd0mb53a32b1e0dc39c6@mail.gmail.com> (raw)
In-Reply-To: <4879F6FC.3030209@web.de>

2008/7/13 Jan Kiszka <jan.kiszka@web.de>:
> 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

      reply	other threads:[~2008-07-16 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  6:48 [Qemu-devel] [PATCH] fix various compiler warnings Jan Kiszka
2008-07-13 12:37 ` [Qemu-devel] [RESEND][PATCH] " Jan Kiszka
2008-07-16 12:18   ` andrzej zaborowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb249edb0807160518h559cdfd0mb53a32b1e0dc39c6@mail.gmail.com \
    --to=balrogg@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).