qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [6737] Sparse fixes: truncation by cast


From: Luca Tettamanti
Subject: Re: [Qemu-devel] [6737] Sparse fixes: truncation by cast
Date: Sat, 7 Mar 2009 17:51:45 +0100

On Sat, Mar 7, 2009 at 4:46 PM, Blue Swirl <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]