From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57297 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOEp9-0005Au-Jb for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOEp8-0005hJ-JL for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:55 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:33921) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOEp8-0005h5-Cf for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:54 -0400 Received: by pwj8 with SMTP id 8so3084526pwj.4 for ; Mon, 14 Jun 2010 11:55:53 -0700 (PDT) MIME-Version: 1.0 From: Blue Swirl Date: Mon, 14 Jun 2010 18:55:33 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH] block: fix a warning and possible truncation List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel Fix a warning from OpenBSD gcc (3.3.5 (propolice)): /src/qemu/block.c: In function `bdrv_info_stats_bs': /src/qemu/block.c:1548: warning: long long int format, long unsigned int arg (arg 6) There may be also truncation effects. Signed-off-by: Blue Swirl --- Alternatively 'ULL' prefix could be appended to BDRV_SECTOR_SIZE definition but that may have other side effects. block.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index cacf11b..a7ab0b4 100644 --- a/block.c +++ b/block.c @@ -1545,7 +1545,8 @@ static QObject* bdrv_info_stats_bs(BlockDriverState *bs) "} }", bs->rd_bytes, bs->wr_bytes, bs->rd_ops, bs->wr_ops, - bs->wr_highest_sector * (long)BDRV_SECTOR_SIZE); + bs->wr_highest_sector * + (uint64_t)BDRV_SECTOR_SIZE); dict = qobject_to_qdict(res); if (*bs->device_name) { -- 1.7.1