From 52d89d8443c4a31a69c0701062f2c7711d82bbed Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 31 Dec 2019 00:29:48 +0200 Subject: Rename read32ne to aligned_read32ne, and similarly for the others. Using the aligned methods requires more care to ensure that the address really is aligned, so it's nicer if the aligned methods are prefixed. The next commit will remove the unaligned_ prefix from the unaligned methods which in liblzma are used in more places than the aligned ones. --- src/liblzma/check/crc32_fast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/liblzma/check/crc32_fast.c') diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index 3de02638..eed73505 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/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 -- cgit v1.2.3