From 431a9c00a56cf4c603be1cf5f773b193621d8150 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 16:55:19 +0100 Subject: Fixed a huge amount of Clang warnings On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably. 99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified. Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects. Most remaining warnings are now unused parameters. --- source/core/StarDirectives.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source/core/StarDirectives.cpp') diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp index 6c335a5..5d5266f 100644 --- a/source/core/StarDirectives.cpp +++ b/source/core/StarDirectives.cpp @@ -7,7 +7,7 @@ namespace Star { Directives::Entry::Entry(ImageOperation&& newOperation, size_t strBegin, size_t strLength) { - operation = move(newOperation); + operation = std::move(newOperation); begin = strBegin; length = strLength; } @@ -43,8 +43,8 @@ bool Directives::Shared::empty() const { } Directives::Shared::Shared(List&& givenEntries, String&& givenString, StringView givenPrefix) { - entries = move(givenEntries); - string = move(givenString); + entries = std::move(givenEntries); + string = std::move(givenString); prefix = givenPrefix; hash = XXH3_64bits(string.utf8Ptr(), string.utf8Size()); } @@ -56,7 +56,7 @@ Directives::Directives(String const& directives) { } Directives::Directives(String&& directives) { - parse(move(directives)); + parse(std::move(directives)); } Directives::Directives(const char* directives) { @@ -64,7 +64,7 @@ Directives::Directives(const char* directives) { } Directives::Directives(Directives&& directives) { - *this = move(directives); + *this = std::move(directives); } Directives::Directives(Directives const& directives) { @@ -87,7 +87,7 @@ Directives& Directives::operator=(String&& s) { return *this; } - parse(move(s)); + parse(std::move(s)); return *this; } @@ -100,7 +100,7 @@ Directives& Directives::operator=(const char* s) { } Directives& Directives::operator=(Directives&& other) { - shared = move(other.shared); + shared = std::move(other.shared); return *this; } @@ -132,7 +132,7 @@ void Directives::parse(String&& directives) { if (beg == 0) { try { ImageOperation operation = imageOperationFromString(split); - newList.emplace_back(move(operation), beg, end); + newList.emplace_back(std::move(operation), beg, end); } catch (StarException const& e) { prefix = split; @@ -141,7 +141,7 @@ void Directives::parse(String&& directives) { } else { ImageOperation operation = NullImageOperation(); - newList.emplace_back(move(operation), beg, end); + newList.emplace_back(std::move(operation), beg, end); } } }); @@ -151,7 +151,7 @@ void Directives::parse(String&& directives) { return; } - shared = std::make_shared(move(newList), move(directives), prefix); + shared = std::make_shared(std::move(newList), std::move(directives), prefix); if (view.size() < 1000) { // Pre-load short enough directives for (auto& entry : shared->entries) entry.loadOperation(*shared); @@ -219,7 +219,7 @@ DataStream& operator>>(DataStream& ds, Directives& directives) { String string; ds.read(string); - directives.parse(move(string)); + directives.parse(std::move(string)); return ds; } @@ -240,7 +240,7 @@ DirectivesGroup::DirectivesGroup(String const& directives) : m_count(0) { Directives parsed(directives); if (parsed) { - m_directives.emplace_back(move(parsed)); + m_directives.emplace_back(std::move(parsed)); m_count = m_directives.back().size(); } } @@ -250,9 +250,9 @@ DirectivesGroup::DirectivesGroup(String&& directives) : m_count(0) { return; } - Directives parsed(move(directives)); + Directives parsed(std::move(directives)); if (parsed) { - m_directives.emplace_back(move(parsed)); + m_directives.emplace_back(std::move(parsed)); m_count = m_directives.back().size(); } } @@ -372,7 +372,7 @@ DataStream& operator>>(DataStream& ds, DirectivesGroup& directivesGroup) { String string; ds.read(string); - directivesGroup = DirectivesGroup(move(string)); + directivesGroup = DirectivesGroup(std::move(string)); return ds; } -- cgit v1.2.3