From: Stefan Hajnoczi Date: Wed, 26 Mar 2014 12:05:57 +0000 (+0100) Subject: dmg: use appropriate types when reading chunks X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eb71803b041f55779ea10d860c0f66df285c68de;p=qemu.git dmg: use appropriate types when reading chunks 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 --- diff --git a/block/dmg.c b/block/dmg.c index 1cc5426d8c..f98c94dc47 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;