summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jeddeloh <andrew@gridware.io>2023-02-16 23:14:19 +0000
committerDerf Null <derf@finalrewind.org>2023-03-12 10:43:36 +0100
commitf965e4758770b94f6d334be303a2d58e73f3ace6 (patch)
treeb1f75be80599d27e39e5893a980144e45a42853c
parenta64294c3e7c136ae493799d8e9055f22841965db (diff)
inflate: make inputs const
Make the inputs const since we never write to the data it points to.
-rw-r--r--src/inflate.c8
-rw-r--r--src/inflate.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/inflate.c b/src/inflate.c
index 0ad1db1..d22d508 100644
--- a/src/inflate.c
+++ b/src/inflate.c
@@ -11,8 +11,8 @@
/*
* The compressed (inflated) input data.
*/
-unsigned char *deflate_input_now;
-unsigned char *deflate_input_end;
+const unsigned char *deflate_input_now;
+const unsigned char *deflate_input_end;
/*
* The decompressed (deflated) output stream.
@@ -465,7 +465,7 @@ static int8_t deflate_dynamic_huffman()
#endif
}
-int16_t inflate(unsigned char *input_buf, uint16_t input_len,
+int16_t inflate(const unsigned char *input_buf, uint16_t input_len,
unsigned char *output_buf, uint16_t output_len)
{
deflate_input_now = input_buf;
@@ -506,7 +506,7 @@ int16_t inflate(unsigned char *input_buf, uint16_t input_len,
}
}
-int16_t inflate_zlib(unsigned char *input_buf, uint16_t input_len,
+int16_t inflate_zlib(const unsigned char *input_buf, uint16_t input_len,
unsigned char *output_buf, uint16_t output_len)
{
if (input_len < 4) {
diff --git a/src/inflate.h b/src/inflate.h
index af2b4f7..86d8b4a 100644
--- a/src/inflate.h
+++ b/src/inflate.h
@@ -18,7 +18,7 @@
#define DEFLATE_ERR_NLEN (-8)
#define DEFLATE_ERR_HUFFMAN (-9)
-int16_t inflate(unsigned char *input_buf, uint16_t input_len,
+int16_t inflate(const unsigned char *input_buf, uint16_t input_len,
unsigned char *output_buf, uint16_t output_len);
-int16_t inflate_zlib(unsigned char *input_buf, uint16_t input_len,
+int16_t inflate_zlib(const unsigned char *input_buf, uint16_t input_len,
unsigned char *output_buf, uint16_t output_len);