if (unlikely(is->end - is->next < 2))
goto overflow;
- is->bitbuf |= (u32)get_unaligned_u16_le(is->next) << (16 - is->bitsleft);
+ is->bitbuf |= (u32)get_unaligned_le16(is->next) << (16 - is->bitsleft);
is->next += 2;
is->bitsleft += 16;
if (unlikely(is->end - is->next < 2))
goto overflow;
- is->bitbuf |= (u32)get_unaligned_u16_le(is->next);
+ is->bitbuf |= (u32)get_unaligned_le16(is->next);
is->next += 2;
is->bitsleft = 32;
}
if (unlikely(is->end - is->next < 2))
return 0;
- v = get_unaligned_u16_le(is->next);
+ v = get_unaligned_le16(is->next);
is->next += 2;
return v;
}
if (unlikely(is->end - is->next < 4))
return 0;
- v = get_unaligned_u32_le(is->next);
+ v = get_unaligned_le32(is->next);
is->next += 4;
return v;
}
#define store_word_unaligned store_machine_word_t_unaligned
static inline u16
-get_unaligned_u16_le(const void *p)
+get_unaligned_le16(const void *p)
{
u16 v;
}
static inline u32
-get_unaligned_u32_le(const void *p)
+get_unaligned_le32(const void *p)
{
u32 v;
}
static inline void
-put_unaligned_u16_le(u16 v, void *p)
+put_unaligned_le16(u16 v, void *p)
{
if (UNALIGNED_ACCESS_IS_FAST) {
store_le16_unaligned(cpu_to_le16(v), p);
}
static inline void
-put_unaligned_u32_le(u32 v, void *p)
+put_unaligned_le32(u32 v, void *p)
{
if (UNALIGNED_ACCESS_IS_FAST) {
store_le32_unaligned(cpu_to_le32(v), p);
p += opcode_nbytes;
if (undo) {
if (i - *last_x86_pos <= max_trans_offset) {
- u32 n = get_unaligned_u32_le(p);
- put_unaligned_u32_le(n - i, p);
+ u32 n = get_unaligned_le32(p);
+ put_unaligned_le32(n - i, p);
}
- target16 = i + get_unaligned_u16_le(p);
+ target16 = i + get_unaligned_le16(p);
} else {
- target16 = i + get_unaligned_u16_le(p);
+ target16 = i + get_unaligned_le16(p);
if (i - *last_x86_pos <= max_trans_offset) {
- u32 n = get_unaligned_u32_le(p);
- put_unaligned_u32_le(n + i, p);
+ u32 n = get_unaligned_le32(p);
+ put_unaligned_le32(n + i, p);
}
}
do {
if (likely(rc->next >= rc->begin)) {
if (rc->next != rc->end) {
- put_unaligned_u16_le(rc->cache +
+ put_unaligned_le16(rc->cache +
(u16)(rc->lower_bound >> 32),
rc->next++);
}
/* Write a coding unit, unless it would underflow the buffer. */
if (os->next != os->begin)
- put_unaligned_u16_le(os->bitbuf >> os->bitcount, --os->next);
+ put_unaligned_le16(os->bitbuf >> os->bitcount, --os->next);
/* Optimization for call sites that never write more than 16
* bits at once. */
return false;
if (os->bitcount != 0)
- put_unaligned_u16_le(os->bitbuf << (16 - os->bitcount), --os->next);
+ put_unaligned_le16(os->bitbuf << (16 - os->bitcount), --os->next);
return true;
}
{
s32 abs_offset, rel_offset;
- rel_offset = get_unaligned_u32_le(target);
+ rel_offset = get_unaligned_le32(target);
if (rel_offset >= -input_pos && rel_offset < LZX_WIM_MAGIC_FILESIZE) {
if (rel_offset < LZX_WIM_MAGIC_FILESIZE - input_pos) {
/* "good translation" */
/* "compensating translation" */
abs_offset = rel_offset - LZX_WIM_MAGIC_FILESIZE;
}
- put_unaligned_u32_le(abs_offset, target);
+ put_unaligned_le32(abs_offset, target);
}
}
{
s32 abs_offset, rel_offset;
- abs_offset = get_unaligned_u32_le(target);
+ abs_offset = get_unaligned_le32(target);
if (abs_offset >= 0) {
if (abs_offset < LZX_WIM_MAGIC_FILESIZE) {
/* "good translation" */
rel_offset = abs_offset - input_pos;
- put_unaligned_u32_le(rel_offset, target);
+ put_unaligned_le32(rel_offset, target);
}
} else {
if (abs_offset >= -input_pos) {
/* "compensating translation" */
rel_offset = abs_offset + LZX_WIM_MAGIC_FILESIZE;
- put_unaligned_u32_le(rel_offset, target);
+ put_unaligned_le32(rel_offset, target);
}
}
}
if (os->end - os->next < 6)
return;
- put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 16) &
+ put_unaligned_le16(os->bitbuf >> ((os->bitcount - 16) &
shift_mask), os->next + 0);
if (max_num_bits > 16)
- put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 32) &
+ put_unaligned_le16(os->bitbuf >> ((os->bitcount - 32) &
shift_mask), os->next + 2);
if (max_num_bits > 32)
- put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 48) &
+ put_unaligned_le16(os->bitbuf >> ((os->bitcount - 48) &
shift_mask), os->next + 4);
os->next += (os->bitcount >> 4) << 1;
os->bitcount &= 15;
return 0;
if (os->bitcount != 0) {
- put_unaligned_u16_le(os->bitbuf << (16 - os->bitcount), os->next);
+ put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next);
os->next += 2;
}
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;
}