]> wimlib.net Git - wimlib/blobdiff - include/wimlib/lz_extend.h
win32_apply.c: WRITE_DAC is no longer needed when creating directory
[wimlib] / include / wimlib / lz_extend.h
index bd00183b973d980b5eab3f1aa2acf4b263e18569..858cb9a3b1f791edccbb6f2663f71fc8a3eb3983 100644 (file)
@@ -1,13 +1,21 @@
 /*
- * lz_extend.h
+ * lz_extend.h - fast match extension for Lempel-Ziv matchfinding
  *
- * Fast match extension for Lempel-Ziv matchfinding.
+ * The following copying information applies to this specific source code file:
  *
- * Author:     Eric Biggers
- * Year:       2014, 2015
+ * Written in 2014-2015 by Eric Biggers <ebiggers3@gmail.com>
  *
- * The author dedicates this file to the public domain.
- * You can do whatever you want with this file.
+ * To the extent possible under law, the author(s) have dedicated all copyright
+ * and related and neighboring rights to this software to the public domain
+ * worldwide via the Creative Commons Zero 1.0 Universal Public Domain
+ * Dedication (the "CC0").
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the CC0 for more details.
+ *
+ * You should have received a copy of the CC0 along with this software; if not
+ * see <http://creativecommons.org/publicdomain/zero/1.0/>.
  */
 
 #ifndef _WIMLIB_LZ_EXTEND_H
@@ -60,7 +68,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;
 }