Daniele Bartolini пре 9 година
родитељ
комит
1d60f2005a
3 измењених фајлова са 7 додато и 5 уклоњено
  1. 2 2
      src/core/guid.cpp
  2. 3 1
      src/core/guid.h
  3. 2 2
      src/core/unit_tests.cpp

+ 2 - 2
src/core/guid.cpp

@@ -40,11 +40,11 @@ namespace guid
 	Guid parse(const char* str)
 	{
 		Guid guid;
-		try_parse(str, guid);
+		try_parse(guid, str);
 		return guid;
 	}
 
-	bool try_parse(const char* str, Guid& guid)
+	bool try_parse(Guid& guid, const char* str)
 	{
 		CE_ENSURE(NULL != str);
 		u32 a, b, c, d, e, f;

+ 3 - 1
src/core/guid.h

@@ -3,6 +3,8 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
 
+#pragma once
+
 #include "string_types.h"
 #include "types.h"
 
@@ -31,7 +33,7 @@ namespace guid
 	Guid parse(const char* str);
 
 	/// Parses the @a guid from @a str and returns true if success.
-	bool try_parse(const char* str, Guid& guid);
+	bool try_parse(Guid& guid, const char* str);
 
 	/// Fills @a str with the string representation of the @a guid.
 	void to_string(const Guid& guid, DynamicString& str);

+ 2 - 2
src/core/unit_tests.cpp

@@ -953,8 +953,8 @@ static void test_guid()
 	}
 	{
 		Guid guid;
-		ENSURE(guid::try_parse("961f8005-6a7e-4371-9272-8454dd786884", guid));
-		ENSURE(!guid::try_parse("961f80056a7e-4371-9272-8454dd786884", guid));
+		ENSURE(guid::try_parse(guid, "961f8005-6a7e-4371-9272-8454dd786884"));
+		ENSURE(!guid::try_parse(guid, "961f80056a7e-4371-9272-8454dd786884"));
 	}
 	memory_globals::shutdown();
 }