Browse Source

Use hash32 type for hash functions

1vanK 3 years ago
parent
commit
77097e2ffc
2 changed files with 3 additions and 3 deletions
  1. 1 1
      Source/Urho3D/Container/HashSet.h
  2. 2 2
      Source/Urho3D/Graphics/Material.h

+ 1 - 1
Source/Urho3D/Container/HashSet.h

@@ -618,7 +618,7 @@ private:
     static bool CompareNodes(Node*& lhs, Node*& rhs) { return lhs->key_ < rhs->key_; }
     static bool CompareNodes(Node*& lhs, Node*& rhs) { return lhs->key_ < rhs->key_; }
 
 
     /// Compute a hash based on the key and the bucket size.
     /// Compute a hash based on the key and the bucket size.
-    unsigned Hash(const T& key) const { return MakeHash(key) & (NumBuckets() - 1); }
+    hash32 Hash(const T& key) const { return MakeHash(key) & (NumBuckets() - 1); }
 };
 };
 
 
 template <class T> typename Urho3D::HashSet<T>::ConstIterator begin(const Urho3D::HashSet<T>& v) { return v.Begin(); }
 template <class T> typename Urho3D::HashSet<T>::ConstIterator begin(const Urho3D::HashSet<T>& v) { return v.Begin(); }

+ 2 - 2
Source/Urho3D/Graphics/Material.h

@@ -78,9 +78,9 @@ private:
 };
 };
 
 
 /// TextureUnit hash function.
 /// TextureUnit hash function.
-template <> inline unsigned MakeHash(const TextureUnit& value)
+template <> inline hash32 MakeHash(const TextureUnit& value)
 {
 {
-    return (unsigned)value;
+    return (hash32)value;
 }
 }
 
 
 /// Describes how to render 3D geometries.
 /// Describes how to render 3D geometries.