summaryrefslogtreecommitdiff
path: root/Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h')
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h b/Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h
index de17c54fc..342a333d1 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h
+++ b/Utilities/cmliblzma/liblzma/lz/lz_encoder_hash.h
@@ -39,22 +39,25 @@
// Endianness doesn't matter in hash_2_calc() (no effect on the output).
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS
# define hash_2_calc() \
- hash_value = *(const uint16_t *)(cur)
+ const uint32_t hash_value = *(const uint16_t *)(cur)
#else
# define hash_2_calc() \
- hash_value = (uint32_t)(cur[0]) | ((uint32_t)(cur[1]) << 8)
+ const uint32_t hash_value \
+ = (uint32_t)(cur[0]) | ((uint32_t)(cur[1]) << 8)
#endif
#define hash_3_calc() \
- temp = hash_table[cur[0]] ^ cur[1]; \
- hash_2_value = temp & HASH_2_MASK; \
- hash_value = (temp ^ ((uint32_t)(cur[2]) << 8)) & mf->hash_mask
+ const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
+ const uint32_t hash_2_value = temp & HASH_2_MASK; \
+ const uint32_t hash_value \
+ = (temp ^ ((uint32_t)(cur[2]) << 8)) & mf->hash_mask
#define hash_4_calc() \
- temp = hash_table[cur[0]] ^ cur[1]; \
- hash_2_value = temp & HASH_2_MASK; \
- hash_3_value = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
- hash_value = (temp ^ ((uint32_t)(cur[2]) << 8) \
+ const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
+ const uint32_t hash_2_value = temp & HASH_2_MASK; \
+ const uint32_t hash_3_value \
+ = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
+ const uint32_t hash_value = (temp ^ ((uint32_t)(cur[2]) << 8) \
^ (hash_table[cur[3]] << 5)) & mf->hash_mask