qdev: Fix 32-bit compilation in print_size

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>
This commit is contained in:
Richard Henderson 2013-07-30 08:20:42 -10:00 committed by Anthony Liguori
parent 75e2a4baf1
commit e76c756fd3

View 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]);