Ver código fonte

core: use enum for constants

Daniele Bartolini 3 anos atrás
pai
commit
25964038e7
2 arquivos alterados com 12 adições e 6 exclusões
  1. 6 3
      src/core/containers/hash_map.inl
  2. 6 3
      src/core/containers/hash_set.inl

+ 6 - 3
src/core/containers/hash_map.inl

@@ -64,9 +64,12 @@ namespace hash_map
 
 namespace hash_map_internal
 {
-	const u32 END_OF_LIST = 0xffffffffu;
-	const u32 DELETED = 0x80000000u;
-	const u32 FREE = 0x00000000u;
+	enum : u32
+	{
+		END_OF_LIST = 0xffffffffu,
+		DELETED     = 0x80000000u,
+		FREE        = 0x00000000u
+	};
 
 	template <typename TKey, typename Hash>
 	inline u32 key_hash(const TKey& key)

+ 6 - 3
src/core/containers/hash_set.inl

@@ -53,9 +53,12 @@ namespace hash_set
 
 namespace hash_set_internal
 {
-	const u32 END_OF_LIST = 0xffffffffu;
-	const u32 DELETED = 0x80000000u;
-	const u32 FREE = 0x00000000u;
+	enum : u32
+	{
+		END_OF_LIST = 0xffffffffu,
+		DELETED     = 0x80000000u,
+		FREE        = 0x00000000u
+	};
 
 	template <typename TKey, typename Hash>
 	inline u32 key_hash(const TKey& key)