feat(runtime/hash): use size_t instead of unsigned
This commit is contained in:
parent
02e6f953c8
commit
a46e27a3d7
2 changed files with 6 additions and 3 deletions
|
|
@ -4,6 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#include <cstddef>
|
||||
|
||||
namespace lean {
|
||||
|
||||
void mix(unsigned & a, unsigned & b, unsigned & c) {
|
||||
|
|
@ -20,8 +22,9 @@ void mix(unsigned & a, unsigned & b, unsigned & c) {
|
|||
|
||||
// Bob Jenkin's hash function.
|
||||
// http://burtleburtle.net/bob/hash/doobs.html
|
||||
unsigned hash_str(unsigned length, char const * str, unsigned init_value) {
|
||||
unsigned a, b, c, len;
|
||||
unsigned hash_str(size_t length, char const * str, unsigned init_value) {
|
||||
unsigned a, b, c;
|
||||
size_t len;
|
||||
|
||||
/* Set up the internal state */
|
||||
len = length;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace lean {
|
|||
|
||||
void mix(unsigned & a, unsigned & b, unsigned & c);
|
||||
|
||||
unsigned hash_str(unsigned len, char const * str, unsigned init_value);
|
||||
unsigned hash_str(size_t len, char const * str, unsigned init_value);
|
||||
|
||||
inline unsigned hash(unsigned h1, unsigned h2) {
|
||||
h2 -= h1; h2 ^= (h1 << 8);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue