Navigation Menu

Skip to content

Commit

Permalink
Clean up datatypes in LZS
Browse files Browse the repository at this point in the history
There is perhaps a slight performance improvement here but it's negligible.
This is mostly just for tidiness.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 8, 2015
1 parent f513a70 commit 8bf8c63
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lzs.c
Expand Up @@ -61,8 +61,8 @@ int lzs_decompress(unsigned char *dst, int dstlen, const unsigned char *src, int
{
int outlen = 0;
int bits_left = 8; /* Bits left in the current byte at *src */
int data;
int offset, length;
uint32_t data;
uint16_t offset, length;

while (1) {
/* Get 9 bits, which is the minimum and a common case */
Expand Down Expand Up @@ -166,11 +166,10 @@ do { \
*/
int lzs_compress(unsigned char *dst, int dstlen, const unsigned char *src, int srclen)
{
int inpos = 0;
uint32_t match_len;
uint32_t hash;
uint16_t hofs, longest_match_len, longest_match_ofs;
int outpos = 0;
int inpos = 0, outpos = 0;
uint16_t match_len, longest_match_len;
uint16_t hofs, longest_match_ofs;
uint16_t hash;
uint32_t outbits = 0;
int nr_outbits = 0;

Expand Down

0 comments on commit 8bf8c63

Please sign in to comment.