From 636882316b5191931e144212d93665c10859ac95 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic <steven.lerouzic@gmail.com> Date: Fri, 7 Mar 2025 00:00:43 +0100 Subject: Some work on clang-tidy-ing things up --- asl/types/status.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'asl/types/status.cpp') 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) { -- cgit