Commit 28a5c9c8b26d7737b9908f912754711399954837

Authored by bellard
1 parent acff9df6

use uint8_t instead of char


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1734 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 8 additions and 8 deletions
block-cloop.c
@@ -32,8 +32,8 @@ typedef struct BDRVCloopState { @@ -32,8 +32,8 @@ typedef struct BDRVCloopState {
32 uint64_t* offsets; 32 uint64_t* offsets;
33 uint32_t sectors_per_block; 33 uint32_t sectors_per_block;
34 uint32_t current_block; 34 uint32_t current_block;
35 - char* compressed_block;  
36 - char* uncompressed_block; 35 + uint8_t *compressed_block;
  36 + uint8_t *uncompressed_block;
37 z_stream zstream; 37 z_stream zstream;
38 } BDRVCloopState; 38 } BDRVCloopState;
39 39
@@ -89,9 +89,9 @@ cloop_close: @@ -89,9 +89,9 @@ cloop_close:
89 } 89 }
90 90
91 /* initialize zlib engine */ 91 /* initialize zlib engine */
92 - if(!(s->compressed_block=(char*)malloc(max_compressed_block_size+1))) 92 + if(!(s->compressed_block = malloc(max_compressed_block_size+1)))
93 goto cloop_close; 93 goto cloop_close;
94 - if(!(s->uncompressed_block=(char*)malloc(s->block_size))) 94 + if(!(s->uncompressed_block = malloc(s->block_size)))
95 goto cloop_close; 95 goto cloop_close;
96 if(inflateInit(&s->zstream) != Z_OK) 96 if(inflateInit(&s->zstream) != Z_OK)
97 goto cloop_close; 97 goto cloop_close;
block-dmg.c
@@ -44,8 +44,8 @@ typedef struct BDRVDMGState { @@ -44,8 +44,8 @@ typedef struct BDRVDMGState {
44 uint64_t* sectors; 44 uint64_t* sectors;
45 uint64_t* sectorcounts; 45 uint64_t* sectorcounts;
46 uint32_t current_chunk; 46 uint32_t current_chunk;
47 - char* compressed_chunk;  
48 - char* uncompressed_chunk; 47 + uint8_t *compressed_chunk;
  48 + uint8_t *uncompressed_chunk;
49 z_stream zstream; 49 z_stream zstream;
50 } BDRVDMGState; 50 } BDRVDMGState;
51 51
@@ -159,9 +159,9 @@ dmg_close: @@ -159,9 +159,9 @@ dmg_close:
159 } 159 }
160 160
161 /* initialize zlib engine */ 161 /* initialize zlib engine */
162 - if(!(s->compressed_chunk=(char*)malloc(max_compressed_size+1))) 162 + if(!(s->compressed_chunk = malloc(max_compressed_size+1)))
163 goto dmg_close; 163 goto dmg_close;
164 - if(!(s->uncompressed_chunk=(char*)malloc(512*max_sectors_per_chunk))) 164 + if(!(s->uncompressed_chunk = malloc(512*max_sectors_per_chunk)))
165 goto dmg_close; 165 goto dmg_close;
166 if(inflateInit(&s->zstream) != Z_OK) 166 if(inflateInit(&s->zstream) != Z_OK)
167 goto dmg_close; 167 goto dmg_close;