From 278cc6f70a8128f8cbb5736cd4b92a08b737942b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 19 Mar 2018 16:50:45 -0600 Subject: [PATCH] libc/lzf: Fix some typos in code that was in conditional logic that was not building. Change a literal use of 13 to HLOG which used to be 13. --- include/lzf.h | 2 +- libc/lzf/lzf_c.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/lzf.h b/include/lzf.h index 118aa04101..81ffe777d8 100644 --- a/include/lzf.h +++ b/include/lzf.h @@ -71,7 +71,7 @@ struct lzf_type1_header_s /* Compressed data header */ uint8_t lzf_magic[2]; /* [0]='Z', [1]='V' */ uint8_t lzf_type; /* LZF_TYPE1_HDR */ uint8_t lzf_clen[2]; /* Compressed data length (big-endian) */ - uint8_t lzf_ulen[2]; /* Unompressed data length (big-endian) */ + uint8_t lzf_ulen[2]; /* Uncompressed data length (big-endian) */ }; /* LZF hash table */ diff --git a/libc/lzf/lzf_c.c b/libc/lzf/lzf_c.c index f138cf9a5b..a2c0da7355 100644 --- a/libc/lzf/lzf_c.c +++ b/libc/lzf/lzf_c.c @@ -38,7 +38,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define HSIZE (1 << (HLOG)) +#define HSIZE (1 << HLOG) /* Don't play with this unless you benchmark! The data format is not * dependent on the hash function. The hash function might seem strange, just @@ -74,7 +74,7 @@ #endif #define MAX_LIT (1 << 5) -#define MAX_OFF (1 << 13) +#define MAX_OFF (1 << HLOG) #define MAX_REF ((1 << 8) + (1 << 3)) #if __GNUC__ >= 3 @@ -170,9 +170,10 @@ size_t lzf_compress(FAR const void *const in_data, { lzf_hslot_t *hslot; - hval = NEXT(hval, ip); - hslot = htab + IDX(hval); - ref = *hslot + LZF_HSLOT_BIAS; *hslot = ip - LZF_HSLOT_BIAS; + hval = NEXT(hval, ip); + hslot = htab + IDX(hval); + ref = *hslot + LZF_HSLOT_BIAS; + *hslot = ip - LZF_HSLOT_BIAS; if (1 #if INIT_HTAB @@ -184,7 +185,7 @@ size_t lzf_compress(FAR const void *const in_data, #ifdef CONFIG_LIBC_LZF_ALIGN && ((ref[1] << 8) | ref[0]) == ((ip[1] << 8) | ip[0]) #else - && *(uin16_t *)ref == *(uin16_t *)ip + && *(uint16_t *)ref == *(uint16_t *)ip #endif ) { @@ -388,8 +389,8 @@ size_t lzf_compress(FAR const void *const in_data, if (expect_false(lit == MAX_LIT)) { op[- lit - 1] = lit - 1; /* Stop run */ - lit = 0;; /* Start run */ - op++' + lit = 0; /* Start run */ + op++; } } }