* This file is part of wimlib, a library for working with WIM files.
*
* wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
+ * terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* wimlib 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 GNU Lesser General Public License for more
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
- * You should have received a copy of the GNU Lesser General Public License
+ * You should have received a copy of the GNU General Public License
* along with wimlib; if not, see http://www.gnu.org/licenses/.
*/
ret = bitstream_read_bits(istream, 16, &block_size);
if (ret != 0)
return ret;
- block_size = to_le16(block_size);
+ block_size = le16_to_cpu(block_size);
}
switch (block_type) {
ret = bitstream_read_bytes(istream, sizeof(R), R);
if (ret != 0)
return ret;
- array_to_le32(R, ARRAY_LEN(3));
- queue->R0 = R[0];
- queue->R1 = R[1];
- queue->R2 = R[2];
+ queue->R0 = le32_to_cpu(R[0]);
+ queue->R1 = le32_to_cpu(R[1]);
+ queue->R2 = le32_to_cpu(R[2]);
break;
default:
LZX_DEBUG("Found invalid block.");
return -1;
}
+#if 0
+ printf("Match: src %u, dst %u, len %u\n", match_src - window,
+ match_dest - window,
+ match_len);
+ putchar('|');
+ for (i = 0; i < match_len; i++) {
+ match_dest[i] = match_src[i];
+ putchar(match_src[i]);
+ }
+ putchar('|');
+ putchar('\n');
+#else
for (i = 0; i < match_len; i++)
match_dest[i] = match_src[i];
+#endif
return match_len;
}
i++;
continue;
}
- abs_offset = to_le32(*(int32_t*)(uncompressed_data + i + 1));
+ abs_offset = le32_to_cpu(*(int32_t*)(uncompressed_data + i + 1));
if (abs_offset >= -i && abs_offset < file_size) {
if (abs_offset >= 0) {
rel_offset = abs_offset + file_size;
}
*(int32_t*)(uncompressed_data + i + 1) =
- to_le32(rel_offset);
+ cpu_to_le32(rel_offset);
}
i += 5;
}