@@ -138,7 +138,7 @@ fasthash_combine(fasthash_state *hs)
138
138
139
139
/* accumulate up to 8 bytes of input and combine it into the hash */
140
140
static inline void
141
- fasthash_accum (fasthash_state * hs , const char * k , int len )
141
+ fasthash_accum (fasthash_state * hs , const char * k , size_t len )
142
142
{
143
143
uint32 lower_four ;
144
144
@@ -189,14 +189,14 @@ fasthash_accum(fasthash_state *hs, const char *k, int len)
189
189
/*
190
190
* all-purpose workhorse for fasthash_accum_cstring
191
191
*/
192
- static inline int
192
+ static inline size_t
193
193
fasthash_accum_cstring_unaligned (fasthash_state * hs , const char * str )
194
194
{
195
195
const char * const start = str ;
196
196
197
197
while (* str )
198
198
{
199
- int chunk_len = 0 ;
199
+ size_t chunk_len = 0 ;
200
200
201
201
while (chunk_len < FH_SIZEOF_ACCUM && str [chunk_len ] != '\0' )
202
202
chunk_len ++ ;
@@ -215,11 +215,11 @@ fasthash_accum_cstring_unaligned(fasthash_state *hs, const char *str)
215
215
* Loading the word containing the NUL terminator cannot segfault since
216
216
* allocation boundaries are suitably aligned.
217
217
*/
218
- static inline int
218
+ static inline size_t
219
219
fasthash_accum_cstring_aligned (fasthash_state * hs , const char * str )
220
220
{
221
221
const char * const start = str ;
222
- int remainder ;
222
+ size_t remainder ;
223
223
uint64 zero_byte_low ;
224
224
225
225
Assert (PointerIsAligned (start , uint64 ));
@@ -269,14 +269,14 @@ fasthash_accum_cstring_aligned(fasthash_state *hs, const char *str)
269
269
/*
270
270
* Mix 'str' into the hash state and return the length of the string.
271
271
*/
272
- static inline int
272
+ static inline size_t
273
273
fasthash_accum_cstring (fasthash_state * hs , const char * str )
274
274
{
275
275
#if SIZEOF_VOID_P >= 8
276
276
277
- int len ;
277
+ size_t len ;
278
278
#ifdef USE_ASSERT_CHECKING
279
- int len_check ;
279
+ size_t len_check ;
280
280
fasthash_state hs_check ;
281
281
282
282
memcpy (& hs_check , hs , sizeof (fasthash_state ));
@@ -340,7 +340,7 @@ fasthash_final32(fasthash_state *hs, uint64 tweak)
340
340
* 'seed' can be zero.
341
341
*/
342
342
static inline uint64
343
- fasthash64 (const char * k , int len , uint64 seed )
343
+ fasthash64 (const char * k , size_t len , uint64 seed )
344
344
{
345
345
fasthash_state hs ;
346
346
@@ -362,7 +362,7 @@ fasthash64(const char *k, int len, uint64 seed)
362
362
363
363
/* like fasthash64, but returns a 32-bit hashcode */
364
364
static inline uint64
365
- fasthash32 (const char * k , int len , uint64 seed )
365
+ fasthash32 (const char * k , size_t len , uint64 seed )
366
366
{
367
367
return fasthash_reduce32 (fasthash64 (k , len , seed ));
368
368
}
0 commit comments