summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/xdelta3-hash.h')
-rw-r--r--xdelta3/xdelta3-hash.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/xdelta3/xdelta3-hash.h b/xdelta3/xdelta3-hash.h
index 2919b98..c112b5a 100644
--- a/xdelta3/xdelta3-hash.h
+++ b/xdelta3/xdelta3-hash.h
@@ -72,6 +72,7 @@ xd3_checksum_hash (const xd3_hash_cfg *cfg, const usize_t cksum)
72 return (cksum >> cfg->shift) ^ (cksum & cfg->mask); 72 return (cksum >> cfg->shift) ^ (cksum & cfg->mask);
73} 73}
74 74
75#if SIZEOF_USIZE_T == 4
75inline uint32_t 76inline uint32_t
76xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look) 77xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look)
77{ 78{
@@ -88,7 +89,9 @@ xd3_large32_cksum_update (xd3_hash_cfg *cfg, const uint32_t cksum,
88{ 89{
89 return xd3_hash_multiplier32 * cksum - cfg->multiplier * base[0] + base[look]; 90 return xd3_hash_multiplier32 * cksum - cfg->multiplier * base[0] + base[look];
90} 91}
92#endif
91 93
94#if SIZEOF_USIZE_T == 8
92inline uint64_t 95inline uint64_t
93xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look) 96xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look)
94{ 97{
@@ -105,6 +108,7 @@ xd3_large64_cksum_update (xd3_hash_cfg *cfg, const uint64_t cksum,
105{ 108{
106 return xd3_hash_multiplier64 * cksum - cfg->multiplier * base[0] + base[look]; 109 return xd3_hash_multiplier64 * cksum - cfg->multiplier * base[0] + base[look];
107} 110}
111#endif
108 112
109static usize_t 113static usize_t
110xd3_size_hashtable_bits (usize_t slots) 114xd3_size_hashtable_bits (usize_t slots)