aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-11-22 12:05:33 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-11-22 12:05:33 +0200
commitf1a28b96c900c658fe016852ff62f6c24d1f50fa (patch)
tree304ffe8bed1b8e80b536180494f7841008dab721 /src
parentEnable assembler code only if it is known to work (diff)
downloadxz-f1a28b96c900c658fe016852ff62f6c24d1f50fa.tar.xz
Add missing consts to pointer casts.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/check/crc32_fast.c4
-rw-r--r--src/liblzma/check/crc64_fast.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c
index 49dc31f2..94da8559 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 ^= *(uint32_t *)(buf);
+ crc ^= *(const uint32_t *)(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 = *(uint32_t *)(buf);
+ const uint32_t tmp = *(const uint32_t *)(buf);
buf += 4;
// At least with some compilers, it is critical for
diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c
index e42fc3dc..52af29ed 100644
--- a/src/liblzma/check/crc64_fast.c
+++ b/src/liblzma/check/crc64_fast.c
@@ -46,9 +46,10 @@ lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
while (buf < limit) {
#ifdef WORDS_BIGENDIAN
- const uint32_t tmp = (crc >> 32) ^ *(uint32_t *)(buf);
+ const uint32_t tmp = (crc >> 32)
+ ^ *(const uint32_t *)(buf);
#else
- const uint32_t tmp = crc ^ *(uint32_t *)(buf);
+ const uint32_t tmp = crc ^ *(const uint32_t *)(buf);
#endif
buf += 4;