diff options
author | Brad King <brad.king@kitware.com> | 2018-08-06 13:56:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-08-06 14:22:56 (GMT) |
commit | 6166adfdd40954767f3c4e40da502285ed16a9b1 (patch) | |
tree | de3266371a950f40937f4f5a248c44244215755d /Utilities/cmliblzma/liblzma/check/crc32_fast.c | |
parent | 0a3912112d11514ba1652423e21a767507ce75fb (diff) | |
download | CMake-6166adfdd40954767f3c4e40da502285ed16a9b1.zip CMake-6166adfdd40954767f3c4e40da502285ed16a9b1.tar.gz CMake-6166adfdd40954767f3c4e40da502285ed16a9b1.tar.bz2 |
liblzma: Revert "Port from C99 to C89/90"
Revert commit v3.1.0-rc1~255^2~5 (liblzma: Port from C99 to C89/90,
2014-07-13). We now compile as C99 or above except on MSVC where
we will use another approach.
Diffstat (limited to 'Utilities/cmliblzma/liblzma/check/crc32_fast.c')
-rw-r--r-- | Utilities/cmliblzma/liblzma/check/crc32_fast.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Utilities/cmliblzma/liblzma/check/crc32_fast.c b/Utilities/cmliblzma/liblzma/check/crc32_fast.c index c2c3cb7..3de0263 100644 --- a/Utilities/cmliblzma/liblzma/check/crc32_fast.c +++ b/Utilities/cmliblzma/liblzma/check/crc32_fast.c @@ -33,8 +33,6 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) #endif if (size > 8) { - const uint8_t * limit; - // Fix the alignment, if needed. The if statement above // ensures that this won't read past the end of buf[]. while ((uintptr_t)(buf) & 7) { @@ -43,7 +41,7 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) } // Calculate the position where to stop. - limit = buf + (size & ~(size_t)(7)); + const uint8_t *const limit = buf + (size & ~(size_t)(7)); // Calculate how many bytes must be calculated separately // before returning the result. @@ -51,8 +49,6 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) // Calculate the CRC32 using the slice-by-eight algorithm. while (buf < limit) { - uint32_t tmp; - crc ^= *(const uint32_t *)(buf); buf += 4; @@ -61,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)]; - tmp = *(const uint32_t *)(buf); + const uint32_t tmp = *(const uint32_t *)(buf); buf += 4; // At least with some compilers, it is critical for |