From aceecc33f8af74b79831b83a6facc158385f5294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 29 Oct 2016 10:30:08 -0700 Subject: [PATCH] Added error reset. --- include/bx/error.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/bx/error.h b/include/bx/error.h index da1b832..d18884a 100644 --- a/include/bx/error.h +++ b/include/bx/error.h @@ -48,7 +48,13 @@ namespace bx { } - void setError(ErrorResult _errorResult, const char* _msg) + void reset() + { + m_code = 0; + m_msg.clear(); + } + + void setError(ErrorResult _errorResult, const StringView& _msg) { BX_CHECK(0 != _errorResult.code, "Invalid ErrorResult passed to setError!"); @@ -83,8 +89,8 @@ namespace bx } private: - const char* m_msg; - uint32_t m_code; + StringView m_msg; + uint32_t m_code; }; ///