summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma/liblzma/check
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-22 19:39:58 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-22 19:39:58 (GMT)
commite9065e96dc80ee62fa9bf9df559d0d8e6d8e0117 (patch)
tree108f8ef033665a2d5686004e3f8a6e2a1db3254e /Utilities/cmliblzma/liblzma/check
parent741b85b42b4c8d826634b3f968d7de21df5f6c85 (diff)
parentee909a8e8b785b68c6a14fd52cc12b1841051a7d (diff)
downloadCMake-e9065e96dc80ee62fa9bf9df559d0d8e6d8e0117.zip
CMake-e9065e96dc80ee62fa9bf9df559d0d8e6d8e0117.tar.gz
CMake-e9065e96dc80ee62fa9bf9df559d0d8e6d8e0117.tar.bz2
Merge branch 'upstream-liblzma' into lzma-threads
* upstream-liblzma: liblzma 2020-03-17 (2327a461)
Diffstat (limited to 'Utilities/cmliblzma/liblzma/check')
-rw-r--r--Utilities/cmliblzma/liblzma/check/crc32_fast.c4
-rw-r--r--Utilities/cmliblzma/liblzma/check/crc32_table.c3
-rw-r--r--Utilities/cmliblzma/liblzma/check/crc64_fast.c4
-rw-r--r--Utilities/cmliblzma/liblzma/check/crc64_table.c3
4 files changed, 10 insertions, 4 deletions
diff --git a/Utilities/cmliblzma/liblzma/check/crc32_fast.c b/Utilities/cmliblzma/liblzma/check/crc32_fast.c
index 3de0263..eed7350 100644
--- a/Utilities/cmliblzma/liblzma/check/crc32_fast.c
+++ b/Utilities/cmliblzma/liblzma/check/crc32_fast.c
@@ -49,7 +49,7 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
// Calculate the CRC32 using the slice-by-eight algorithm.
while (buf < limit) {
- crc ^= *(const uint32_t *)(buf);
+ crc ^= aligned_read32ne(buf);
buf += 4;
crc = lzma_crc32_table[7][A(crc)]
@@ -57,7 +57,7 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
^ lzma_crc32_table[5][C(crc)]
^ lzma_crc32_table[4][D(crc)];
- const uint32_t tmp = *(const uint32_t *)(buf);
+ const uint32_t tmp = aligned_read32ne(buf);
buf += 4;
// At least with some compilers, it is critical for
diff --git a/Utilities/cmliblzma/liblzma/check/crc32_table.c b/Utilities/cmliblzma/liblzma/check/crc32_table.c
index 368874e..b11762a 100644
--- a/Utilities/cmliblzma/liblzma/check/crc32_table.c
+++ b/Utilities/cmliblzma/liblzma/check/crc32_table.c
@@ -12,6 +12,9 @@
#include "common.h"
+// Having the declaration here silences clang -Wmissing-variable-declarations.
+extern const uint32_t lzma_crc32_table[8][256];
+
#ifdef WORDS_BIGENDIAN
# include "crc32_table_be.h"
#else
diff --git a/Utilities/cmliblzma/liblzma/check/crc64_fast.c b/Utilities/cmliblzma/liblzma/check/crc64_fast.c
index 52af29e..8af54cd 100644
--- a/Utilities/cmliblzma/liblzma/check/crc64_fast.c
+++ b/Utilities/cmliblzma/liblzma/check/crc64_fast.c
@@ -47,9 +47,9 @@ lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
while (buf < limit) {
#ifdef WORDS_BIGENDIAN
const uint32_t tmp = (crc >> 32)
- ^ *(const uint32_t *)(buf);
+ ^ aligned_read32ne(buf);
#else
- const uint32_t tmp = crc ^ *(const uint32_t *)(buf);
+ const uint32_t tmp = crc ^ aligned_read32ne(buf);
#endif
buf += 4;
diff --git a/Utilities/cmliblzma/liblzma/check/crc64_table.c b/Utilities/cmliblzma/liblzma/check/crc64_table.c
index 1fbcd94..7560eb0 100644
--- a/Utilities/cmliblzma/liblzma/check/crc64_table.c
+++ b/Utilities/cmliblzma/liblzma/check/crc64_table.c
@@ -12,6 +12,9 @@
#include "common.h"
+// Having the declaration here silences clang -Wmissing-variable-declarations.
+extern const uint64_t lzma_crc64_table[4][256];
+
#ifdef WORDS_BIGENDIAN
# include "crc64_table_be.h"
#else