summaryrefslogtreecommitdiff
path: root/asl/types/status.cpp
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-07 00:00:43 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-07 00:00:43 +0100
commit636882316b5191931e144212d93665c10859ac95 (patch)
tree740f76daceee5bff223b790a4eb91f4e59c5be61 /asl/types/status.cpp
parentf0cccbe3285c039553e1fd8b5a5c7830d6087974 (diff)
Some work on clang-tidy-ing things up
Diffstat (limited to 'asl/types/status.cpp')
-rw-r--r--asl/types/status.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/asl/types/status.cpp b/asl/types/status.cpp
index 94c4977..43f3b9e 100644
--- a/asl/types/status.cpp
+++ b/asl/types/status.cpp
@@ -11,6 +11,8 @@
// @Todo Use custom allocator
using Allocator = asl::DefaultAllocator;
+
+// NOLINTNEXTLINE(*-non-const-global-variables)
static Allocator g_allocator{};
namespace
@@ -47,18 +49,21 @@ asl::status::status(status_code code, string_view fmt, span<format_internals::ty
asl::status_code asl::status::code_internal() const
{
ASL_ASSERT(!is_inline());
+ // NOLINTNEXTLINE(*-reinterpret-cast)
return reinterpret_cast<const StatusInternal*>(m_payload)->code;
}
asl::string_view asl::status::message_internal() const
{
ASL_ASSERT(!is_inline());
+ // NOLINTNEXTLINE(*-reinterpret-cast)
return reinterpret_cast<const StatusInternal*>(m_payload)->msg;
}
void asl::status::ref()
{
ASL_ASSERT(!is_inline());
+ // NOLINTNEXTLINE(*-reinterpret-cast)
auto* internal = reinterpret_cast<StatusInternal*>(m_payload);
atomic_fetch_increment(&internal->ref_count, memory_order::relaxed);
}
@@ -66,6 +71,7 @@ void asl::status::ref()
void asl::status::unref()
{
ASL_ASSERT(!is_inline());
+ // NOLINTNEXTLINE(*-reinterpret-cast)
auto* internal = reinterpret_cast<StatusInternal*>(m_payload);
if (atomic_fetch_decrement(&internal->ref_count, memory_order::release) == 1)
{