[Spice-devel] [PATCH spice-common] canvas: Use SPICE_UNALIGNED_CAST to avoid -Wcast-align warnings

Victor Toso victortoso at redhat.com
Wed Jan 31 15:02:20 UTC 2018


Hi,

On Fri, Jan 19, 2018 at 02:31:35PM +0000, Frediano Ziglio wrote:
> This solves https://bugs.freedesktop.org/show_bug.cgi?id=104521.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  common/canvas_base.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/canvas_base.c b/common/canvas_base.c
> index 42f0eea..5a5b8b4 100644
> --- a/common/canvas_base.c
> +++ b/common/canvas_base.c
> @@ -571,7 +571,7 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
>  
>      do {
>          // Read next compressed block
> -        enc_size = ntohl(*((uint32_t *)data));
> +        enc_size = ntohl(*SPICE_UNALIGNED_CAST(uint32_t *, data));

Acked-by: Victor Toso <victortoso at redhat.com>,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180131/499ffef1/attachment.sig>


More information about the Spice-devel mailing list