[set/map] Adjust hash function return type
diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh
index a7c788b..cbe918e 100644
--- a/src/hb-bit-page.hh
+++ b/src/hb-bit-page.hh
@@ -40,15 +40,15 @@
bool is_empty () const
{
- for (unsigned int i = 0; i < len (); i++)
+ for (unsigned i = 0; i < len (); i++)
if (v[i])
return false;
return true;
}
- unsigned hash () const
+ uint32_t hash () const
{
- unsigned h = 0;
- for (unsigned int i = 0; i < len (); i++)
+ uint32_t h = 0;
+ for (unsigned i = 0; i < len (); i++)
h = h * 31 + hb_hash (v[i]);
return h;
}
diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh
index 51f373c..caea47d 100644
--- a/src/hb-bit-set-invertible.hh
+++ b/src/hb-bit-set-invertible.hh
@@ -80,7 +80,7 @@
next (&v);
return v == INVALID;
}
- unsigned hash () const { return s.hash () ^ inverted; }
+ uint32_t hash () const { return s.hash () ^ inverted; }
hb_codepoint_t get_min () const
{
diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh
index 6a59f77..4d89ffd 100644
--- a/src/hb-bit-set.hh
+++ b/src/hb-bit-set.hh
@@ -80,7 +80,7 @@
bool successful = true; /* Allocations successful */
mutable unsigned int population = 0;
- mutable unsigned int hash_ = 0;
+ mutable uint32_t hash_ = 0;
mutable unsigned int last_page_lookup = 0;
hb_sorted_vector_t<page_map_t> page_map;
hb_vector_t<page_t> pages;
@@ -133,11 +133,11 @@
explicit operator bool () const { return !is_empty (); }
bool has_hash () const { return hash_ != UINT_MAX; }
- unsigned hash () const
+ uint32_t hash () const
{
if (has_hash ()) return hash_;
- unsigned h = 0;
+ uint32_t h = 0;
for (auto &map : page_map)
h = h * 31 + hb_hash (map.major) + hb_hash (pages[map.index]);
diff --git a/src/hb-map.hh b/src/hb-map.hh
index 406a82a..3f4576b 100644
--- a/src/hb-map.hh
+++ b/src/hb-map.hh
@@ -239,9 +239,9 @@
bool is_empty () const { return population == 0; }
explicit operator bool () const { return !is_empty (); }
- unsigned hash () const
+ uint32_t hash () const
{
- unsigned h = 0;
+ uint32_t h = 0;
for (auto pair : iter ())
h ^= hb_hash (pair.first) ^ hb_hash (pair.second);
return h;
diff --git a/src/hb-set.hh b/src/hb-set.hh
index b5ca07d..6025626 100644
--- a/src/hb-set.hh
+++ b/src/hb-set.hh
@@ -82,7 +82,7 @@
void clear () { s.clear (); }
void invert () { s.invert (); }
bool is_empty () const { return s.is_empty (); }
- unsigned hash () const { return s.hash (); }
+ uint32_t hash () const { return s.hash (); }
void add (hb_codepoint_t g) { s.add (g); }
bool add_range (hb_codepoint_t a, hb_codepoint_t b) { return s.add_range (a, b); }