summaryrefslogtreecommitdiff
path: root/src/compression/mtf.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-12-04 16:05:42 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-12-08 13:35:27 (GMT)
commitb6c0fbcbb224c894eb90cc920c6ecb8e8d48e66a (patch)
tree945db6cb55f72e09c56e2846eaa355f8c6bc472d /src/compression/mtf.c
parentdb972bad9178b95ee16110de186074476579bf89 (diff)
Made function arguments const where relevant.
Change-Id: I5b196b57976c8c718b079336a805188ccb03ef4b
Diffstat (limited to 'src/compression/mtf.c')
-rw-r--r--src/compression/mtf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/compression/mtf.c b/src/compression/mtf.c
index bfb0e19..5219413 100644
--- a/src/compression/mtf.c
+++ b/src/compression/mtf.c
@@ -17,7 +17,7 @@
/* "Partial" MTF. Byte based. */
/* Move to front coding.
Acceptable inputs are max 8 bits (0-0xFF) */
-static void comp_conv_to_mtf_byte(unsigned char *vals, int nvals,
+static void comp_conv_to_mtf_byte(unsigned char *vals, const int nvals,
unsigned char *valsmtf)
{
int i;
@@ -59,7 +59,7 @@ static void comp_conv_to_mtf_byte(unsigned char *vals, int nvals,
}
}
-void Ptngc_comp_conv_to_mtf_partial(unsigned int *vals, int nvals,
+void Ptngc_comp_conv_to_mtf_partial(unsigned int *vals, const int nvals,
unsigned int *valsmtf)
{
unsigned char *tmp=warnmalloc(nvals*2);
@@ -78,7 +78,7 @@ void Ptngc_comp_conv_to_mtf_partial(unsigned int *vals, int nvals,
free(tmp);
}
-void Ptngc_comp_conv_to_mtf_partial3(unsigned int *vals, int nvals,
+void Ptngc_comp_conv_to_mtf_partial3(unsigned int *vals, const int nvals,
unsigned char *valsmtf)
{
unsigned char *tmp=warnmalloc(nvals);
@@ -93,7 +93,7 @@ void Ptngc_comp_conv_to_mtf_partial3(unsigned int *vals, int nvals,
}
/* Move to front decoding */
-static void comp_conv_from_mtf_byte(unsigned char *valsmtf, int nvals,
+static void comp_conv_from_mtf_byte(unsigned char *valsmtf, const int nvals,
unsigned char *vals)
{
int i;
@@ -135,7 +135,7 @@ static void comp_conv_from_mtf_byte(unsigned char *valsmtf, int nvals,
}
}
-void Ptngc_comp_conv_from_mtf_partial(unsigned int *valsmtf, int nvals,
+void Ptngc_comp_conv_from_mtf_partial(unsigned int *valsmtf, const int nvals,
unsigned int *vals)
{
unsigned char *tmp=warnmalloc(nvals*2);
@@ -154,7 +154,7 @@ void Ptngc_comp_conv_from_mtf_partial(unsigned int *valsmtf, int nvals,
free(tmp);
}
-void Ptngc_comp_conv_from_mtf_partial3(unsigned char *valsmtf, int nvals,
+void Ptngc_comp_conv_from_mtf_partial3(unsigned char *valsmtf, const int nvals,
unsigned int *vals)
{
unsigned char *tmp=warnmalloc(nvals);
@@ -173,8 +173,8 @@ void Ptngc_comp_conv_from_mtf_partial3(unsigned char *valsmtf, int nvals,
/* Move to front coding.
Acceptable inputs are max 24 bits (0-0xFFFFFF) */
-void Ptngc_comp_conv_to_mtf(unsigned int *vals, int nvals,
- unsigned int *dict, int ndict,
+void Ptngc_comp_conv_to_mtf(unsigned int *vals, const int nvals,
+ unsigned int *dict, const int ndict,
unsigned int *valsmtf)
{
int i;
@@ -215,8 +215,8 @@ void Ptngc_comp_conv_to_mtf(unsigned int *vals, int nvals,
}
/* Move to front decoding */
-void Ptngc_comp_conv_from_mtf(unsigned int *valsmtf, int nvals,
- unsigned int *dict, int ndict,
+void Ptngc_comp_conv_from_mtf(unsigned int *valsmtf, const int nvals,
+ unsigned int *dict, const int ndict,
unsigned int *vals)
{
int i;
contact: Jan Huwald // Impressum