qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luca Tettamanti <kronos.it@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [6737] Sparse fixes: truncation by cast
Date: Sat, 7 Mar 2009 17:51:45 +0100	[thread overview]
Message-ID: <68676e00903070851kf4b9bf5g30570c3830c7d9f0@mail.gmail.com> (raw)
In-Reply-To: <E1LfyjI-0007YY-45@cvs.savannah.gnu.org>

On Sat, Mar 7, 2009 at 4:46 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> Revision: 6737
>          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6737
> Author:   blueswir1
> Date:     2009-03-07 15:46:23 +0000 (Sat, 07 Mar 2009)
> Log Message:
> -----------
> Sparse fixes: truncation by cast
>
> Fix Sparse warnings about constant truncation caused by cast
>
> Modified: trunk/bswap.h
> ===================================================================
> --- trunk/bswap.h       2009-03-07 15:32:56 UTC (rev 6736)
> +++ trunk/bswap.h       2009-03-07 15:46:23 UTC (rev 6737)
> @@ -151,7 +151,7 @@
>  {
>     uint8_t *p1 = (uint8_t *)p;
>
> -    p1[0] = v;
> +    p1[0] = v & 0xff;
>     p1[1] = v >> 8;

Hum, by the same principle the last line should be:
p1[1] = (v >> 8) & 0xff;
no?

Luca

  reply	other threads:[~2009-03-07 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-07 15:46 [Qemu-devel] [6737] Sparse fixes: truncation by cast Blue Swirl
2009-03-07 16:51 ` Luca Tettamanti [this message]
2009-03-08  7:26   ` Blue Swirl

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=68676e00903070851kf4b9bf5g30570c3830c7d9f0@mail.gmail.com \
    --to=kronos.it@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).