mirror of
https://github.com/sheumann/hush.git
synced 2024-11-05 06:07:00 +00:00
Don't document compiler warnings. _FIX_ compiler warnings.
This commit is contained in:
parent
88da3ef506
commit
a8b98d63e7
@ -134,8 +134,6 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
|
|||||||
|
|
||||||
static int get_next_block(bunzip_data *bd)
|
static int get_next_block(bunzip_data *bd)
|
||||||
{
|
{
|
||||||
/* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
|
|
||||||
* They will be initialized on the fist pass of the loop. */
|
|
||||||
struct group_data *hufGroup;
|
struct group_data *hufGroup;
|
||||||
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
|
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
|
||||||
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
|
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
|
||||||
@ -286,16 +284,15 @@ static int get_next_block(bunzip_data *bd)
|
|||||||
mtfSymbol[i]=(unsigned char)i;
|
mtfSymbol[i]=(unsigned char)i;
|
||||||
}
|
}
|
||||||
/* Loop through compressed symbols. */
|
/* Loop through compressed symbols. */
|
||||||
runPos=dbufCount=symCount=selector=0;
|
runPos=dbufCount=selector=0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
/* Determine which Huffman coding group to use. */
|
/* fetch next Huffman coding group from list. */
|
||||||
if(!(symCount--)) {
|
symCount=GROUP_SIZE-1;
|
||||||
symCount=GROUP_SIZE-1;
|
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
|
||||||
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
|
hufGroup=bd->groups+selectors[selector++];
|
||||||
hufGroup=bd->groups+selectors[selector++];
|
base=hufGroup->base-1;
|
||||||
base=hufGroup->base-1;
|
limit=hufGroup->limit-1;
|
||||||
limit=hufGroup->limit-1;
|
continue_this_group:
|
||||||
}
|
|
||||||
/* Read next Huffman-coded symbol. */
|
/* Read next Huffman-coded symbol. */
|
||||||
/* Note: It is far cheaper to read maxLen bits and back up than it is
|
/* Note: It is far cheaper to read maxLen bits and back up than it is
|
||||||
to read minLen bits and then an additional bit at a time, testing
|
to read minLen bits and then an additional bit at a time, testing
|
||||||
@ -346,7 +343,7 @@ got_huff_bits:
|
|||||||
context). Thus space is saved. */
|
context). Thus space is saved. */
|
||||||
t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
|
t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
|
||||||
runPos <<= 1;
|
runPos <<= 1;
|
||||||
continue;
|
goto end_of_huffman_loop;
|
||||||
}
|
}
|
||||||
/* When we hit the first non-run symbol after a run, we now know
|
/* When we hit the first non-run symbol after a run, we now know
|
||||||
how many times to repeat the last literal, so append that many
|
how many times to repeat the last literal, so append that many
|
||||||
@ -384,6 +381,10 @@ got_huff_bits:
|
|||||||
/* We have our literal byte. Save it into dbuf. */
|
/* We have our literal byte. Save it into dbuf. */
|
||||||
byteCount[uc]++;
|
byteCount[uc]++;
|
||||||
dbuf[dbufCount++] = (unsigned int)uc;
|
dbuf[dbufCount++] = (unsigned int)uc;
|
||||||
|
/* Skip group initialization if we're not done with this group. Done this
|
||||||
|
* way to avoid compiler warning. */
|
||||||
|
end_of_huffman_loop:
|
||||||
|
if(symCount--) goto continue_this_group;
|
||||||
}
|
}
|
||||||
/* At this point, we've read all the Huffman-coded symbols (and repeated
|
/* At this point, we've read all the Huffman-coded symbols (and repeated
|
||||||
runs) for this block from the input stream, and decoded them into the
|
runs) for this block from the input stream, and decoded them into the
|
||||||
|
Loading…
Reference in New Issue
Block a user