aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2004-11-16 12:07:04 +0000
committerRob Landley <rob@landley.net>2004-11-16 12:07:04 +0000
commita8b98d63e76177dfc6aa1d5647783da200034b3d (patch)
tree0a046f31d9cfbb131fa697633d8a0b6eb1087551
parent88da3ef506237b5d808571d15aca6052bf778cce (diff)
downloadbusybox-w32-a8b98d63e76177dfc6aa1d5647783da200034b3d.tar.gz
busybox-w32-a8b98d63e76177dfc6aa1d5647783da200034b3d.tar.bz2
busybox-w32-a8b98d63e76177dfc6aa1d5647783da200034b3d.zip
Don't document compiler warnings. _FIX_ compiler warnings.
-rw-r--r--archival/libunarchive/decompress_bunzip2.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index 259a47776..07e3cf018 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -134,8 +134,6 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
134 134
135static int get_next_block(bunzip_data *bd) 135static int get_next_block(bunzip_data *bd)
136{ 136{
137 /* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
138 * They will be initialized on the fist pass of the loop. */
139 struct group_data *hufGroup; 137 struct group_data *hufGroup;
140 int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector, 138 int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
141 i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256]; 139 i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
@@ -286,16 +284,15 @@ static int get_next_block(bunzip_data *bd)
286 mtfSymbol[i]=(unsigned char)i; 284 mtfSymbol[i]=(unsigned char)i;
287 } 285 }
288 /* Loop through compressed symbols. */ 286 /* Loop through compressed symbols. */
289 runPos=dbufCount=symCount=selector=0; 287 runPos=dbufCount=selector=0;
290 for(;;) { 288 for(;;) {
291 /* Determine which Huffman coding group to use. */ 289 /* fetch next Huffman coding group from list. */
292 if(!(symCount--)) { 290 symCount=GROUP_SIZE-1;
293 symCount=GROUP_SIZE-1; 291 if(selector>=nSelectors) return RETVAL_DATA_ERROR;
294 if(selector>=nSelectors) return RETVAL_DATA_ERROR; 292 hufGroup=bd->groups+selectors[selector++];
295 hufGroup=bd->groups+selectors[selector++]; 293 base=hufGroup->base-1;
296 base=hufGroup->base-1; 294 limit=hufGroup->limit-1;
297 limit=hufGroup->limit-1; 295continue_this_group:
298 }
299 /* Read next Huffman-coded symbol. */ 296 /* Read next Huffman-coded symbol. */
300 /* Note: It is far cheaper to read maxLen bits and back up than it is 297 /* Note: It is far cheaper to read maxLen bits and back up than it is
301 to read minLen bits and then an additional bit at a time, testing 298 to read minLen bits and then an additional bit at a time, testing
@@ -346,7 +343,7 @@ got_huff_bits:
346 context). Thus space is saved. */ 343 context). Thus space is saved. */
347 t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */ 344 t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
348 runPos <<= 1; 345 runPos <<= 1;
349 continue; 346 goto end_of_huffman_loop;
350 } 347 }
351 /* When we hit the first non-run symbol after a run, we now know 348 /* When we hit the first non-run symbol after a run, we now know
352 how many times to repeat the last literal, so append that many 349 how many times to repeat the last literal, so append that many
@@ -384,6 +381,10 @@ got_huff_bits:
384 /* We have our literal byte. Save it into dbuf. */ 381 /* We have our literal byte. Save it into dbuf. */
385 byteCount[uc]++; 382 byteCount[uc]++;
386 dbuf[dbufCount++] = (unsigned int)uc; 383 dbuf[dbufCount++] = (unsigned int)uc;
384 /* Skip group initialization if we're not done with this group. Done this
385 * way to avoid compiler warning. */
386end_of_huffman_loop:
387 if(symCount--) goto continue_this_group;
387 } 388 }
388 /* At this point, we've read all the Huffman-coded symbols (and repeated 389 /* At this point, we've read all the Huffman-coded symbols (and repeated
389 runs) for this block from the input stream, and decoded them into the 390 runs) for this block from the input stream, and decoded them into the