Skip to contentSkip to conversation

block-cloop.c: fix signedness gcc4 warning

PATCH New Pavel Janík 1 participant 1 message Jan 4, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block-cloop.c: fix signedness gcc4 warning

Hi,

gcc4 is more picky about signedness. Please apply.

block-cloop.c +4 -4
@@ -32,8 +32,8 @@
     uint64_t* offsets;
     uint32_t sectors_per_block;
     uint32_t current_block;
-    char* compressed_block;
-    char* uncompressed_block;
+    unsigned char* compressed_block;
+    unsigned char* uncompressed_block;
     z_stream zstream;
 } BDRVCloopState;
 
@@ -89,9 +89,9 @@
     }
 
     /* initialize zlib engine */
-    if(!(s->compressed_block=(char*)malloc(max_compressed_block_size+1)))
+    if(!(s->compressed_block=(unsigned char*)malloc(max_compressed_block_size+1)))
 	goto cloop_close;
-    if(!(s->uncompressed_block=(char*)malloc(s->block_size)))
+    if(!(s->uncompressed_block=(unsigned char*)malloc(s->block_size)))
 	goto cloop_close;
     if(inflateInit(&s->zstream) != Z_OK)
 	goto cloop_close;
Signature · 4 lines
Pavel Janík

Write and test a big program in small pieces.
                  -- The Elements of Programming Style (Kernighan & Plaugher)