/* Pointer to the start of the output buffer. */
u8 *start;
- /* Pointer to the location in the ouput buffer at which to write the
+ /* Pointer to the location in the output buffer at which to write the
* next 16 bits. */
u8 *next_bits;
if (os->bitcount > 16) {
os->bitcount -= 16;
if (os->end - os->next_byte >= 2) {
- put_unaligned_u16_le(os->bitbuf >> os->bitcount, os->next_bits);
+ put_unaligned_le16(os->bitbuf >> os->bitcount, os->next_bits);
os->next_bits = os->next_bits2;
os->next_bits2 = os->next_byte;
os->next_byte += 2;
xpress_write_u16(struct xpress_output_bitstream *os, u16 v)
{
if (os->end - os->next_byte >= 2) {
- put_unaligned_u16_le(v, os->next_byte);
+ put_unaligned_le16(v, os->next_byte);
os->next_byte += 2;
}
}
if (os->end - os->next_byte < 2)
return 0;
- put_unaligned_u16_le(os->bitbuf << (16 - os->bitcount), os->next_bits);
- put_unaligned_u16_le(0, os->next_bits2);
+ put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next_bits);
+ put_unaligned_le16(0, os->next_bits2);
return os->next_byte - os->start;
}
/* If we've found so many matches that the cache might overflow
* if we keep finding more, then stop finding matches. This
* case is very unlikely. */
- if (unlikely(cache_ptr >= c->cache_overflow_mark || max_len < 5))
+ if (unlikely(cache_ptr >= c->cache_overflow_mark ||
+ max_len < BT_MATCHFINDER_REQUIRED_NBYTES))
break;
matches = cache_ptr;
* highly compressible, so it doesn't matter as much what we do.
*/
if (best_len >= nice_len) {
- if (unlikely(best_len + 5 >= max_len))
+ if (unlikely(best_len +
+ BT_MATCHFINDER_REQUIRED_NBYTES >= max_len))
break;
--best_len;
do {