summaryrefslogtreecommitdiff
path: root/source/fud_string.cpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-03 08:07:05 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-03 08:07:05 -0500
commite420eca2b244c303af51534ab09632045a186b21 (patch)
treeba4ec2d6863b716672f35898266516b58c727aa9 /source/fud_string.cpp
parent97bbafb762defc01abc38834b70a7e8f20d654f5 (diff)
Cleanup from clang-tidy.
Diffstat (limited to 'source/fud_string.cpp')
-rw-r--r--source/fud_string.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/fud_string.cpp b/source/fud_string.cpp
index 4cffb60..3a9aca0 100644
--- a/source/fud_string.cpp
+++ b/source/fud_string.cpp
@@ -46,9 +46,11 @@ ssize_t cStringLength(const char* str, size_t maxLength)
return size;
}
+// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast)
String::String(const utf8* cString) : String(reinterpret_cast<const char*>(cString))
{
}
+// NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast)
String::String(const char* cString)
{
@@ -82,7 +84,7 @@ String::String(const String& rhs) : m_length{rhs.m_length}, m_capacity{rhs.m_cap
}
}
-String::String(String&& rhs) : m_length{rhs.m_length}, m_capacity{rhs.m_capacity}
+String::String(String&& rhs) noexcept : m_length{rhs.m_length}, m_capacity{rhs.m_capacity}
{
if (isLarge()) {
cleanup();
@@ -91,7 +93,7 @@ String::String(String&& rhs) : m_length{rhs.m_length}, m_capacity{rhs.m_capacity
m_data = rhs.m_data;
rhs.m_data = nullptr;
} else {
- m_buffer = std::move(rhs.m_buffer);
+ m_buffer = rhs.m_buffer;
fudAssert(nullTerminate() == FudStatus::Success);
}
}
@@ -122,7 +124,7 @@ String& String::operator=(const String& rhs)
return *this;
}
-String& String::operator=(String&& rhs)
+String& String::operator=(String&& rhs) noexcept
{
cleanup();
@@ -132,7 +134,7 @@ String& String::operator=(String&& rhs)
m_data = rhs.m_data;
rhs.m_data = nullptr;
} else {
- m_buffer = std::move(rhs.m_buffer);
+ m_buffer = rhs.m_buffer;
fudAssert(nullTerminate() == FudStatus::Success);
}
return *this;
@@ -172,7 +174,7 @@ FudStatus String::resize(size_t newCapacity)
return FudStatus::Success;
}
- utf8* newData;
+ utf8* newData = nullptr;
if (isLarge()) {
newData = static_cast<utf8*>(fudRealloc(m_data, newCapacity));
if (newData == nullptr) {