lz_extend.h: fix for CPU_IS_BIG_ENDIAN && UNALIGNED_ACCESS_IS_FAST
authorEric Biggers <ebiggers3@gmail.com>
Sat, 5 Dec 2015 06:46:53 +0000 (00:46 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 19 Dec 2015 16:31:10 +0000 (10:31 -0600)
include/wimlib/lz_extend.h

index bd00183..7d7cd05 100644 (file)
@@ -60,7 +60,7 @@ word_differs:
        if (CPU_IS_LITTLE_ENDIAN)
                len += (ffsw(v_word) >> 3);
        else
-               len += (flsw(v_word) >> 3);
+               len += (8 * WORDSIZE - 1 - flsw(v_word)) >> 3;
        return len;
 }