[Spice-devel] [PATCH spice-server 1/2] test-display-base: Use SPICE_CONTAINEROF to avoid alignment warning

Frediano Ziglio fziglio at redhat.com
Wed May 8 13:06:58 UTC 2019


This change prevent a warning issued by GCC 9 and potentially
other compilers.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/tests/test-display-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/tests/test-display-base.c b/server/tests/test-display-base.c
index 31d856ae..49e99343 100644
--- a/server/tests/test-display-base.c
+++ b/server/tests/test-display-base.c
@@ -670,7 +670,7 @@ static void release_resource(SPICE_GNUC_UNUSED QXLInstance *qin,
     spice_assert(release_info.group_id == MEM_SLOT_GROUP_ID);
     switch (ext->cmd.type) {
         case QXL_CMD_DRAW:
-            test_spice_destroy_update((void*)ext);
+            test_spice_destroy_update(SPICE_CONTAINEROF(ext, SimpleSpiceUpdate, ext));
             break;
         case QXL_CMD_SURFACE:
             g_free(ext);
-- 
2.20.1



More information about the Spice-devel mailing list