peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0427-hw-qxl.c-Fix-compilation-failures-on-32-bit-hosts.patch

56753f
From 1ca7f74b31de28e9170e404ce2b932e311e4d2d0 Mon Sep 17 00:00:00 2001
56753f
From: Peter Maydell <peter.maydell@linaro.org>
56753f
Date: Fri, 16 Mar 2012 13:50:04 +0000
56753f
Subject: [PATCH 427/434] hw/qxl.c: Fix compilation failures on 32 bit hosts
56753f
56753f
Fix compilation failures on 32 bit hosts (cast from pointer to
56753f
integer of different size; %ld expects 'long int' not uint64_t).
56753f
56753f
Reported-by: Steve Langasek <steve.langasek@canonical.com>
56753f
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
56753f
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753f
---
56753f
 hw/qxl.c |   16 ++++++++--------
56753f
 1 file changed, 8 insertions(+), 8 deletions(-)
56753f
56753f
diff --git a/hw/qxl.c b/hw/qxl.c
56753f
index 813873a..bcdf274 100644
56753f
--- a/hw/qxl.c
56753f
+++ b/hw/qxl.c
56753f
@@ -154,7 +154,7 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
56753f
     } else {
56753f
         assert(cookie != NULL);
56753f
         spice_qxl_update_area_async(&qxl->ssd.qxl, surface_id, area,
56753f
-                                    clear_dirty_region, (uint64_t)cookie);
56753f
+                                    clear_dirty_region, (uintptr_t)cookie);
56753f
     }
56753f
 }
56753f
 
56753f
@@ -178,7 +178,7 @@ static void qxl_spice_destroy_surface_wait(PCIQXLDevice *qxl, uint32_t id,
56753f
         cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO,
56753f
                                 QXL_IO_DESTROY_SURFACE_ASYNC);
56753f
         cookie->u.surface_id = id;
56753f
-        spice_qxl_destroy_surface_async(&qxl->ssd.qxl, id, (uint64_t)cookie);
56753f
+        spice_qxl_destroy_surface_async(&qxl->ssd.qxl, id, (uintptr_t)cookie);
56753f
     } else {
56753f
         qxl->ssd.worker->destroy_surface_wait(qxl->ssd.worker, id);
56753f
     }
56753f
@@ -189,8 +189,8 @@ static void qxl_spice_flush_surfaces_async(PCIQXLDevice *qxl)
56753f
     trace_qxl_spice_flush_surfaces_async(qxl->id, qxl->guest_surfaces.count,
56753f
                                          qxl->num_free_res);
56753f
     spice_qxl_flush_surfaces_async(&qxl->ssd.qxl,
56753f
-        (uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
56753f
-                                 QXL_IO_FLUSH_SURFACES_ASYNC));
56753f
+        (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
56753f
+                                  QXL_IO_FLUSH_SURFACES_ASYNC));
56753f
 }
56753f
 
56753f
 void qxl_spice_loadvm_commands(PCIQXLDevice *qxl, struct QXLCommandExt *ext,
56753f
@@ -226,8 +226,8 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
56753f
     trace_qxl_spice_destroy_surfaces(qxl->id, async);
56753f
     if (async) {
56753f
         spice_qxl_destroy_surfaces_async(&qxl->ssd.qxl,
56753f
-                (uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
56753f
-                                         QXL_IO_DESTROY_ALL_SURFACES_ASYNC));
56753f
+                (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
56753f
+                                          QXL_IO_DESTROY_ALL_SURFACES_ASYNC));
56753f
     } else {
56753f
         qxl->ssd.worker->destroy_surfaces(qxl->ssd.worker);
56753f
         qxl_spice_destroy_surfaces_complete(qxl);
56753f
@@ -767,7 +767,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie)
56753f
     }
56753f
     if (cookie && current_async != cookie->io) {
56753f
         fprintf(stderr,
56753f
-                "qxl: %s: error: current_async = %d != %ld = cookie->io\n",
56753f
+                "qxl: %s: error: current_async = %d != %" PRId64 " = cookie->io\n",
56753f
                 __func__, current_async, cookie->io);
56753f
     }
56753f
     switch (current_async) {
56753f
@@ -840,7 +840,7 @@ static void interface_update_area_complete(QXLInstance *sin,
56753f
 static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
56753f
 {
56753f
     PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
56753f
-    QXLCookie *cookie = (QXLCookie *)cookie_token;
56753f
+    QXLCookie *cookie = (QXLCookie *)(uintptr_t)cookie_token;
56753f
 
56753f
     switch (cookie->type) {
56753f
     case QXL_COOKIE_TYPE_IO:
56753f
-- 
56753f
1.7.10
56753f