summaryrefslogtreecommitdiff
path: root/src/compression/huffmem.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-15 07:17:51 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-15 07:17:51 (GMT)
commitcf5a1611319de27b365175a7202c2bbd4730846c (patch)
tree07b749f81948a9dc3c0bd09d2317ec37d49838b4 /src/compression/huffmem.c
parent9d7e53f000baae40b1d942a4c63b66283907ff9b (diff)
Fix some MSVC and Inter C Compiler warnings.
Diffstat (limited to 'src/compression/huffmem.c')
-rw-r--r--src/compression/huffmem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compression/huffmem.c b/src/compression/huffmem.c
index eec8646..2232b7e 100644
--- a/src/compression/huffmem.c
+++ b/src/compression/huffmem.c
@@ -72,7 +72,7 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals,
huffdict,&nhuffdict,
huffdictunpack,&nhuffdictunpack);
*huffdatalen=nhuff;
-
+
/* Algorithm 0 stores the huffman dictionary directly (+ a code for
the algorithm) + lengths of the huffman buffer (4) and the huffman dictionary (3). */
huffman_lengths[0]=nhuff+nhuffdict+1*2+3*4+3+3;
@@ -92,7 +92,7 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals,
/* ... and rle + huffman coding ... (algorithm 2) Pack any repetetitive patterns. */
Ptngc_comp_conv_to_rle(huffdictunpack,nhuffdictunpack,
huffdictrle,&nhuffrle,1);
-
+
/* Determine probabilities. */
Ptngc_comp_make_dict_hist(huffdictrle,nhuffrle,dict,&ndict2,hist);
/* Pack huffman dictionary */
@@ -102,10 +102,10 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals,
huffdict2,&nhuffdict2,
huffdictunpack2,&nhuffdictunpack2);
huffman_lengths[2]=nhuff+nhuff2+nhuffdict2+1*2+3*4+3+3+3+3+3+3;
-
+
/* Choose the best algorithm and output the data. */
if ((*chosen_algo==0) || ((*chosen_algo==-1) &&
- (((huffman_lengths[0]<huffman_lengths[1]) &&
+ (((huffman_lengths[0]<huffman_lengths[1]) &&
(huffman_lengths[0]<huffman_lengths[2])))))
{
*chosen_algo=0;
@@ -242,7 +242,6 @@ void Ptngc_comp_huff_compress(unsigned int *vals, int nvals,
void Ptngc_comp_huff_decompress(unsigned char *huffman, int huffman_len,
unsigned int *vals)
{
- (void)huffman_len;
int isvals16=(int)huffman[0];
unsigned int *vals16=NULL;
int algo=(int)huffman[1];
@@ -261,6 +260,7 @@ void Ptngc_comp_huff_decompress(unsigned char *huffman, int huffman_len,
int ndict=(int)((unsigned int)huffman[17+nhuff]|
(((unsigned int)huffman[18+nhuff])<<8)|
(((unsigned int)huffman[19+nhuff])<<16));
+ (void)huffman_len;
if (!isvals16)
vals16=warnmalloc(nvals16*sizeof *vals16);
else
contact: Jan Huwald // Impressum