1
0
Fork 0
forked from nuttx/nuttx-update

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.

This commit is contained in:
Gregory Nutt 2018-03-19 16:50:45 -06:00
parent af8b291482
commit 278cc6f70a
2 changed files with 10 additions and 9 deletions

View file

@ -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 */

View file

@ -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++;
}
}
}