thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Blob Blame History Raw
From 4796cbee4433654a54303102b9cc88f9c352b1b5 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Wed, 22 Jan 2014 12:13:54 +0100
Subject: [PATCH 3/4] qdev: Fix 32-bit compilation in print_size

RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <1390392835-21809-2-git-send-email-armbru@redhat.com>
Patchwork-id: 56889
O-Subject: [PATCH 7.0 qemu-kvm 1/2] qdev: Fix 32-bit compilation in print_size
Bugzilla: 1034876
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>

From: Richard Henderson <rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-id: 1375208443-17288-2-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e76c756fd3d3b652c6a65ebe16f2bfb25b8d025e)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/core/qdev-properties.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/core/qdev-properties.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 8d43a8d..d6d10c9 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1177,7 +1177,7 @@ static int print_size(DeviceState *dev, Property *prop, char *dest, size_t len)
     int i = 0;
     uint64_t div;
 
-    for (div = (long int)1 << 40; !(*ptr / div) ; div >>= 10) {
+    for (div = 1ULL << 40; !(*ptr / div) ; div >>= 10) {
         i++;
     }
     return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffixes[i]);
-- 
1.7.1