render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

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

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