Explorar o código

Minor fixes to strings

Daniele Bartolini %!s(int64=12) %!d(string=hai) anos
pai
achega
4be62607e3
Modificáronse 2 ficheiros con 17 adicións e 22 borrados
  1. 17 14
      src/core/strings/Hash.h
  2. 0 8
      src/core/strings/Path.h

+ 17 - 14
src/core/strings/Hash.h

@@ -27,6 +27,8 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 namespace crown
 {
+
+/// String hashing.
 namespace hash
 {
 
@@ -42,18 +44,19 @@ uint32_t fnv1a_32(const void* key, size_t len);
 uint64_t fnv1a_64(const void* key, size_t len);
 
 //-----------------------------------------------------------------------------
-// MurmurHash2, by Austin Appleby
-//
-// Note - This code makes a few assumptions about how your machine behaves -
-//
-// 1. We can read a 4-byte value from any address without crashing
-// 2. sizeof(int) == 4
-//
-// And it has a few limitations -
-//
-// 1. It will not work incrementally.
-// 2. It will not produce the same results on little-endian and big-endian
-//    machines.
+/// MurmurHash2, by Austin Appleby
+///
+/// @note
+/// This code makes a few assumptions about how your machine behaves
+///
+/// 1. We can read a 4-byte value from any address without crashing
+/// 2. sizeof(int) == 4
+///
+/// And it has a few limitations -
+///
+/// 1. It will not work incrementally.
+/// 2. It will not produce the same results on little-endian and big-endian
+///    machines.
 inline uint32_t murmur2_32(const void* key, size_t len, uint32_t seed)
 {
 	assert(key != NULL);
@@ -103,7 +106,7 @@ inline uint32_t murmur2_32(const void* key, size_t len, uint32_t seed)
 }
 
 //-----------------------------------------------------------------------------
-// FNV-1a hash, 32 bit
+/// FNV-1a hash, 32 bit
 inline uint32_t fnv1a_32(const void* key, size_t len)
 {
 	assert(key != NULL);
@@ -123,7 +126,7 @@ inline uint32_t fnv1a_32(const void* key, size_t len)
 }
 
 //-----------------------------------------------------------------------------
-// FNV-1a hash, 64 bit
+/// FNV-1a hash, 64 bit
 inline uint64_t fnv1a_64(const void* key, size_t len)
 {
 	assert(key != NULL);

+ 0 - 8
src/core/strings/Path.h

@@ -136,14 +136,6 @@ inline bool is_valid_path(const char* path)
 	return true;
 }
 
-/// Returns whether @path is absolute (i.e. starts with '/').
-inline bool is_absolute_path(const char* path)
-{
-	assert(path != NULL);
-
-	return path[0] == '/';
-}
-
 /// Returns the pathname of the path.
 /// @note
 /// e.g. "/home/project/texture.tga" -> "/home/project"