[Spice-devel] [PATCH spice-common] canvas: Use SPICE_UNALIGNED_CAST to avoid -Wcast-align warnings
Frediano Ziglio
fziglio at redhat.com
Fri Jan 19 14:31:35 UTC 2018
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));
data += 4;
dec_size = LZ4_decompress_safe_continue(stream, (const char *) data,
(char *) dest, enc_size, available);
--
2.14.3
More information about the Spice-devel
mailing list