]> wimlib.net Git - wimlib/blobdiff - include/wimlib/decompress_common.h
compiler.h: remove concept of different unaligned access speeds
[wimlib] / include / wimlib / decompress_common.h
index 70f7dd5a8f4ed508b636ce028105e018f0c81801..54241b36592495106ff7d2efc5970e3d84b52c20 100644 (file)
@@ -67,7 +67,7 @@ bitstream_ensure_bits(struct input_bitstream *is, const unsigned num_bits)
        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;
 
@@ -75,7 +75,7 @@ bitstream_ensure_bits(struct input_bitstream *is, const unsigned num_bits)
                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;
        }
@@ -141,7 +141,7 @@ bitstream_read_u16(struct input_bitstream *is)
 
        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;
 }
@@ -154,7 +154,7 @@ bitstream_read_u32(struct input_bitstream *is)
 
        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;
 }
@@ -261,7 +261,7 @@ repeat_byte(u8 b)
 {
        machine_word_t v;
 
-       BUILD_BUG_ON(WORDSIZE != 4 && WORDSIZE != 8);
+       STATIC_ASSERT(WORDSIZE == 4 || WORDSIZE == 8);
 
        v = b;
        v |= v << 8;
@@ -299,7 +299,7 @@ lz_copy(u8 *dst, u32 length, u32 offset, const u8 *winend, u32 min_length)
         * beyond the end of the output buffer, hence the check for (winend -
         * end >= WORDSIZE - 1).
         */
-       if (UNALIGNED_ACCESS_IS_VERY_FAST &&
+       if (UNALIGNED_ACCESS_IS_FAST &&
            likely(winend - end >= WORDSIZE - 1))
        {