]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
block/dmg: Declare a type definition for DMG uncompress function
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 20 Mar 2023 15:26:10 +0000 (16:26 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 24 Apr 2023 17:53:44 +0000 (13:53 -0400)
Introduce the BdrvDmgUncompressFunc type defintion. To emphasis
dmg_uncompress_bz2 and dmg_uncompress_lzfse are pointer to functions,
declare them using this new typedef.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230320152610.32052-1-philmd@linaro.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/dmg.c
block/dmg.h

index e10b9a2ba5afa83bceba8d61df9c1043b61d3ad6..2769900359f8dc33eb4ac45d4effea3492a67fc3 100644 (file)
 #include "qemu/memalign.h"
 #include "dmg.h"
 
-int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
-                          char *next_out, unsigned int avail_out);
-
-int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
-                            char *next_out, unsigned int avail_out);
+BdrvDmgUncompressFunc *dmg_uncompress_bz2;
+BdrvDmgUncompressFunc *dmg_uncompress_lzfse;
 
 enum {
     /* Limit chunk sizes to prevent unreasonable amounts of memory being used
index e488601b626d4244a06f6edc1c8a529470453074..dcd6165e6397f95ed661aacd5b9fe2ed7e8e472e 100644 (file)
@@ -51,10 +51,10 @@ typedef struct BDRVDMGState {
     z_stream zstream;
 } BDRVDMGState;
 
-extern int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
-                                 char *next_out, unsigned int avail_out);
+typedef int BdrvDmgUncompressFunc(char *next_in, unsigned int avail_in,
+                                  char *next_out, unsigned int avail_out);
 
-extern int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
-                                   char *next_out, unsigned int avail_out);
+extern BdrvDmgUncompressFunc *dmg_uncompress_bz2;
+extern BdrvDmgUncompressFunc *dmg_uncompress_lzfse;
 
 #endif