diff options
Diffstat (limited to 'xdelta3/xdelta3-hash.h')
-rw-r--r-- | xdelta3/xdelta3-hash.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xdelta3/xdelta3-hash.h b/xdelta3/xdelta3-hash.h index 2881000..1c2f92b 100644 --- a/xdelta3/xdelta3-hash.h +++ b/xdelta3/xdelta3-hash.h | |||
@@ -85,7 +85,7 @@ static const uint32_t hash_multiplier_powers[64] = { | |||
85 | 85 | ||
86 | #if ARITH_SMALL_CKSUM | 86 | #if ARITH_SMALL_CKSUM |
87 | #define SMALL_CKSUM_UPDATE(cksum,base,look) \ | 87 | #define SMALL_CKSUM_UPDATE(cksum,base,look) \ |
88 | (cksum) = ((*(uint32_t*)(base+1)) * 1597334677U) | 88 | (cksum) = (uint32_t) ((*(uint32_t*)(base+1)) * (uint32_t)1597334677U) |
89 | #else | 89 | #else |
90 | #define SMALL_CKSUM_UPDATE LARGE_CKSUM_UPDATE | 90 | #define SMALL_CKSUM_UPDATE LARGE_CKSUM_UPDATE |
91 | #endif | 91 | #endif |
@@ -182,10 +182,10 @@ xd3_lcksum (const uint8_t *seg, const int ln) | |||
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | #if ARITH_SMALL_CKSUM | 184 | #if ARITH_SMALL_CKSUM |
185 | static inline usize_t | 185 | static inline uint32_t |
186 | xd3_scksum (const uint8_t *seg, const int ln) | 186 | xd3_scksum (const uint8_t *seg, const int ln) |
187 | { | 187 | { |
188 | usize_t c; | 188 | uint32_t c; |
189 | /* The -1 is because UPDATE operates on seg[1..ln] */ | 189 | /* The -1 is because UPDATE operates on seg[1..ln] */ |
190 | SMALL_CKSUM_UPDATE (c,(seg-1),ln); | 190 | SMALL_CKSUM_UPDATE (c,(seg-1),ln); |
191 | return c; | 191 | return c; |
@@ -194,6 +194,7 @@ xd3_scksum (const uint8_t *seg, const int ln) | |||
194 | #define xd3_scksum(seg,ln) xd3_lcksum(seg,ln) | 194 | #define xd3_scksum(seg,ln) xd3_lcksum(seg,ln) |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | #if XD3_ENCODER | ||
197 | static usize_t | 198 | static usize_t |
198 | xd3_size_log2 (usize_t slots) | 199 | xd3_size_log2 (usize_t slots) |
199 | { | 200 | { |
@@ -226,5 +227,6 @@ xd3_size_hashtable (xd3_stream *stream, | |||
226 | cfg->mask = (cfg->size - 1); | 227 | cfg->mask = (cfg->size - 1); |
227 | cfg->shift = 32 - bits; | 228 | cfg->shift = 32 - bits; |
228 | } | 229 | } |
230 | #endif | ||
229 | 231 | ||
230 | #endif | 232 | #endif |