qdev: Fix 32-bit compilation in print_size
authorRichard Henderson <rth@twiddle.net>
Tue, 30 Jul 2013 18:20:42 +0000 (08:20 -1000)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 31 Jul 2013 12:54:21 +0000 (07:54 -0500)
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>
hw/core/qdev-properties.c

index 8d43a8d272456c4296bf64e9988bd44b31f2409d..d6d10c980e74ae38997f8f634d2ca635ad335426 100644 (file)
@@ -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]);