Received: from eggs.gnu.org ([2001:4830:134:3::10]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4OWu-0007dH-8q for qemu-devel@nongnu.org; Wed, 31 Jul 2013 01:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4OWp-0006CU-EX for qemu-devel@nongnu.org; Wed, 31 Jul 2013 01:00:56 -0400 From: Stefan Weil Date: Wed, 31 Jul 2013 07:00:47 +0200 Message-Id: <1375246847-30624-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for 1.6] hw/core: Fix wrong left shift (build regression) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial Cc: Stefan Weil , Anthony Liguori , qemu-devel Shifting a long int (32 bit) by 40 bit positions won't work. Compiler message: hw/core/qdev-properties.c: In function =E2=80=98print_size=E2=80=99: hw/core/qdev-properties.c:1180:5: warning: left shift count >=3D width of= type Signed-off-by: Stefan Weil --- hw/core/qdev-properties.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 8d43a8d..e82ab87 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1177,7 +1177,7 @@ static int print_size(DeviceState *dev, Property *p= rop, char *dest, size_t len) int i =3D 0; uint64_t div; =20 - for (div =3D (long int)1 << 40; !(*ptr / div) ; div >>=3D 10) { + for (div =3D 1ULL << 40; !(*ptr / div); div >>=3D 10) { i++; } return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffixes[i]= ); --=20 1.7.10.4