summaryrefslogtreecommitdiff
path: root/source/fud_string.cpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2025-03-31 08:33:08 -0500
committerDominick Allen <djallen@librehumanitas.org>2025-03-31 08:33:08 -0500
commit8b0bc70db73b48d833a3b5791e55921768cf6932 (patch)
tree862ae34933a7fc9f480038d974f59d7683a82605 /source/fud_string.cpp
parentc426110f24516f92ecb8a5374e2a281f2c79787a (diff)
Remove reinterpret_cast usage in favor of std::bit_cast.
Diffstat (limited to 'source/fud_string.cpp')
-rw-r--r--source/fud_string.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/fud_string.cpp b/source/fud_string.cpp
index 777212d..d4fd691 100644
--- a/source/fud_string.cpp
+++ b/source/fud_string.cpp
@@ -241,9 +241,9 @@ String& String::operator=(String&& rhs) noexcept
void String::cleanup()
{
- const auto* allocPtr = allocator();
+ auto* allocPtr = allocator();
if (isLarge() && m_repr.large.data != nullptr && allocPtr != nullptr) {
- allocator()->deallocate(std::bit_cast<std::byte*>(m_repr.large.data), m_repr.large.capacity);
+ allocPtr->deallocate(std::bit_cast<std::byte*>(m_repr.large.data), m_repr.large.capacity);
m_repr.large.data = nullptr;
}
}
@@ -816,8 +816,7 @@ FudStatus String::makeLarge(size_t cap, size_t len, utf8*& outputData)
if (dataResult.isError()) {
return dataResult.getError();
}
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- m_repr.large.data = reinterpret_cast<utf8*>(dataResult.getOkay());
+ m_repr.large.data = std::bit_cast<utf8*>(dataResult.getOkay());
outputData = m_repr.large.data;
setLarge();
return FudStatus::Success;