diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh index a7c788b16..cbe918ee4 100644 --- a/src/hb-bit-page.hh +++ b/src/hb-bit-page.hh @@ -40,15 +40,15 @@ struct hb_bit_page_t 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 51f373cdc..caea47d8d 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -80,7 +80,7 @@ struct hb_bit_set_invertible_t 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 6a59f77b6..4d89ffd11 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -80,7 +80,7 @@ struct hb_bit_set_t 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; hb_vector_t pages; @@ -133,11 +133,11 @@ struct hb_bit_set_t 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 406a82abf..3f4576bb9 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -239,9 +239,9 @@ struct hb_hashmap_t 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 b5ca07de8..602562636 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -82,7 +82,7 @@ struct hb_sparseset_t 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); }