From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV2NR-0002eC-LH for qemu-devel@nongnu.org; Tue, 01 Apr 2014 13:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV2NL-0003Pq-Dk for qemu-devel@nongnu.org; Tue, 01 Apr 2014 13:21:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV2NL-0003Om-4Q for qemu-devel@nongnu.org; Tue, 01 Apr 2014 13:21:27 -0400 From: Stefan Hajnoczi Date: Tue, 1 Apr 2014 19:19:16 +0200 Message-Id: <1396372769-11688-39-git-send-email-stefanha@redhat.com> In-Reply-To: <1396372769-11688-1-git-send-email-stefanha@redhat.com> References: <1396372769-11688-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL for-2.0 38/51] dmg: use appropriate types when reading chunks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Stefan Hajnoczi Use the right types instead of signed int: size_t new_size; This is a byte count for g_realloc() that is calculated from uint32_t and size_t values. uint32_t chunk_count; Use the same type as s->n_chunks, which is used together with chunk_count. This patch is a cleanup and does not fix bugs. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Signed-off-by: Stefan Hajnoczi --- block/dmg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/dmg.c b/block/dmg.c index 1cc5426..f98c94d 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -161,7 +161,8 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags, } if (type == 0x6d697368 && count >= 244) { - int new_size, chunk_count; + size_t new_size; + uint32_t chunk_count; offset += 4; offset += 200; -- 1.9.0