diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-12-04 16:05:42 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-12-08 13:35:27 (GMT) |
commit | b6c0fbcbb224c894eb90cc920c6ecb8e8d48e66a (patch) | |
tree | 945db6cb55f72e09c56e2846eaa355f8c6bc472d /src/compression/huffman.c | |
parent | db972bad9178b95ee16110de186074476579bf89 (diff) |
Made function arguments const where relevant.
Change-Id: I5b196b57976c8c718b079336a805188ccb03ef4b
Diffstat (limited to 'src/compression/huffman.c')
-rw-r--r-- | src/compression/huffman.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compression/huffman.c b/src/compression/huffman.c index 2abcbcf..f2a2933 100644 --- a/src/compression/huffman.c +++ b/src/compression/huffman.c @@ -70,7 +70,7 @@ static void assign_codes(union htree_nodeleaf *htree, struct codelength *codelength, unsigned int code, int length, - int top) + const int top) { #if 0 printf("Assign codes called with code %d length %d\n",code,length); @@ -131,7 +131,7 @@ static void flush_8bits(unsigned int *combine, unsigned char **output, int *bitp } } -static void writebits(unsigned int value,int length, unsigned char **output, int *bitptr) +static void writebits(unsigned int value, int length, unsigned char **output, int *bitptr) { unsigned int mask; unsigned int combine=(unsigned int)**output; @@ -216,8 +216,8 @@ static int comp_codes_value(const void *codeptr1, const void *codeptr2, const vo /* The huffman_dict array should be 131077 (0x20005) long. The huffman_dict_unpacked array should be 131077 long (note five longer than 0x20000) */ -void Ptngc_comp_conv_to_huffman(unsigned int *vals, int nvals, - unsigned int *dict, int ndict, +void Ptngc_comp_conv_to_huffman(unsigned int *vals, const int nvals, + unsigned int *dict, const int ndict, unsigned int *prob, unsigned char *huffman, int *huffman_len, @@ -463,12 +463,12 @@ void Ptngc_comp_conv_to_huffman(unsigned int *vals, int nvals, } void Ptngc_comp_conv_from_huffman(unsigned char *huffman, - unsigned int *vals, int nvals, - int ndict, + unsigned int *vals, const int nvals, + const int ndict, unsigned char *huffman_dict, - int huffman_dictlen, + const int huffman_dictlen, unsigned int *huffman_dict_unpacked, - int huffman_dict_unpackedlen) + const int huffman_dict_unpackedlen) { struct codelength *codelength=warnmalloc(ndict*sizeof *codelength); int i,j; |