Received: from eggs.gnu.org ([2001:4830:134:3::10]:41497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z6k-0004jh-CR for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:24:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Z6A-0000m7-CY for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:23:10 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:50671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z69-0000iw-N0 for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:22:34 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 13:22:33 -0400 From: Michael Roth Date: Tue, 8 Jul 2014 12:18:16 -0500 Message-Id: <1404839947-1086-106-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 105/156] 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: qemu-stable@nongnu.org From: 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 (cherry picked from commit eb71803b041f55779ea10d860c0f66df285c68de) Signed-off-by: Michael Roth --- 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.1