Unverified Commit f965e475 authored by Andrew Jeddeloh's avatar Andrew Jeddeloh Committed by Derf Null
Browse files

inflate: make inputs const

Make the inputs const since we never write to the data it points to.
parent a64294c3
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -11,8 +11,8 @@
/*
/*
 * The compressed (inflated) input data.
 * The compressed (inflated) input data.
 */
 */
unsigned char *deflate_input_now;
const unsigned char *deflate_input_now;
unsigned char *deflate_input_end;
const unsigned char *deflate_input_end;


/*
/*
 * The decompressed (deflated) output stream.
 * The decompressed (deflated) output stream.
@@ -465,7 +465,7 @@ static int8_t deflate_dynamic_huffman()
#endif
#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)
		unsigned char *output_buf, uint16_t output_len)
{
{
	deflate_input_now = input_buf;
	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)
		     unsigned char *output_buf, uint16_t output_len)
{
{
	if (input_len < 4) {
	if (input_len < 4) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@
#define DEFLATE_ERR_NLEN (-8)
#define DEFLATE_ERR_NLEN (-8)
#define DEFLATE_ERR_HUFFMAN (-9)
#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);
		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);
		     unsigned char *output_buf, uint16_t output_len);