diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 8d43a8d272..d6d10c980e 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]);