Branimir Karadžić 8 years ago
parent
commit
543a1be4c9
5 changed files with 18 additions and 18 deletions
  1. 7 0
      include/bx/hash.h
  2. 10 0
      include/bx/hash.inl
  3. 0 7
      include/bx/string.h
  4. 0 10
      include/bx/string.inl
  5. 1 1
      tests/handle_test.cpp

+ 7 - 0
include/bx/hash.h

@@ -7,6 +7,7 @@
 #define BX_HASH_H_HEADER_GUARD
 
 #include "allocator.h" // isAligned
+#include "string.h" // StringView
 
 namespace bx
 {
@@ -55,6 +56,12 @@ namespace bx
 	template <typename Ty>
 	uint32_t hashMurmur2A(const Ty& _data);
 
+	///
+	uint32_t hashMurmur2A(const StringView& _data);
+
+	///
+	uint32_t hashMurmur2A(const char* _data);
+
 } // namespace bx
 
 #include "hash.inl"

+ 10 - 0
include/bx/hash.inl

@@ -151,4 +151,14 @@ namespace bx
 		return hashMurmur2A(&_data, sizeof(Ty) );
 	}
 
+	inline uint32_t hashMurmur2A(const StringView& _data)
+	{
+		return hashMurmur2A(_data.getPtr(), _data.getLength() );
+	}
+
+	inline uint32_t hashMurmur2A(const char* _data)
+	{
+		return hashMurmur2A(StringView(_data) );
+	}
+
 } // namespace bx

+ 0 - 7
include/bx/string.h

@@ -10,7 +10,6 @@
 #include <wchar.h>  // wchar_t
 
 #include "allocator.h"
-#include "hash.h"
 
 namespace bx
 {
@@ -244,12 +243,6 @@ namespace bx
 	///
 	int32_t toString(char* _out, size_t _max, uint64_t _value, uint32_t _base = 10);
 
-	///
-	uint32_t hashMurmur2A(const StringView& _data);
-
-	///
-	uint32_t hashMurmur2A(const char* _data);
-
 } // namespace bx
 
 #include "string.inl"

+ 0 - 10
include/bx/string.inl

@@ -116,16 +116,6 @@ namespace bx
 		return m_len;
 	}
 
-	inline uint32_t hashMurmur2A(const StringView& _data)
-	{
-		return hashMurmur2A(_data.getPtr(), _data.getLength() );
-	}
-
-	inline uint32_t hashMurmur2A(const char* _data)
-	{
-		return hashMurmur2A(StringView(_data) );
-	}
-
 	template<bx::AllocatorI** AllocatorT>
 	inline StringT<AllocatorT>::StringT()
 		: StringView()

+ 1 - 1
tests/handle_test.cpp

@@ -5,7 +5,7 @@
 
 #include "test.h"
 #include <bx/handlealloc.h>
-#include <bx/string.h>
+#include <bx/hash.h>
 
 TEST_CASE("HandleListT", "")
 {