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/StarImageProcessing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/core/StarImageProcessing.cpp') diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index bf4d01a..27519bb 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -201,7 +201,7 @@ ImageOperation imageOperationFromString(StringView string) { else if (!which || (ptr != end && ++ptr != end)) throw ImageOperationException(strf("Improper size for hex string '{}' in imageOperationFromString", StringView(hexPtr, hexLen)), false); else // we're in A of A=B. In vanilla only A=B pairs are evaluated, so only throw an exception if B is also there. - return move(operation); + return std::move(operation); which = !which; -- cgit v1.2.3 From 7c4fbad2ba7d79580a9ebbf9fde1de117be4d08e Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 18:39:01 +0100 Subject: Removed some redundant std::move usages in return statements. --- source/core/StarImageProcessing.cpp | 2 +- source/core/StarLexicalCast.hpp | 2 +- source/core/StarMap.hpp | 4 ++-- source/core/StarOrderedMap.hpp | 2 +- source/core/StarSectorArray2D.hpp | 2 +- source/game/StarInput.cpp | 8 ++++---- source/game/scripting/StarInputLuaBindings.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source/core/StarImageProcessing.cpp') diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index 27519bb..a98e7e5 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -201,7 +201,7 @@ ImageOperation imageOperationFromString(StringView string) { else if (!which || (ptr != end && ++ptr != end)) throw ImageOperationException(strf("Improper size for hex string '{}' in imageOperationFromString", StringView(hexPtr, hexLen)), false); else // we're in A of A=B. In vanilla only A=B pairs are evaluated, so only throw an exception if B is also there. - return std::move(operation); + return operation; which = !which; diff --git a/source/core/StarLexicalCast.hpp b/source/core/StarLexicalCast.hpp index 9e5a4a2..7c43137 100644 --- a/source/core/StarLexicalCast.hpp +++ b/source/core/StarLexicalCast.hpp @@ -30,7 +30,7 @@ Maybe maybeLexicalCast(StringView s, std::ios_base::fmtflags flags = std:: if (stream >> ch) return {}; - return std::move(result); + return result; } template diff --git a/source/core/StarMap.hpp b/source/core/StarMap.hpp index e3f9d67..187f4cf 100644 --- a/source/core/StarMap.hpp +++ b/source/core/StarMap.hpp @@ -172,7 +172,7 @@ auto MapMixin::maybeTake(key_type const& k) -> Maybe { if (i != Base::end()) { mapped_type v = std::move(i->second); Base::erase(i); - return std::move(v); + return v; } return {}; @@ -198,7 +198,7 @@ template auto MapMixin::value(key_type const& k, mapped_type d) const -> mapped_type { const_iterator i = Base::find(k); if (i == Base::end()) - return std::move(d); + return d; else return i->second; } diff --git a/source/core/StarOrderedMap.hpp b/source/core/StarOrderedMap.hpp index 8c787e0..be99769 100644 --- a/source/core/StarOrderedMap.hpp +++ b/source/core/StarOrderedMap.hpp @@ -242,7 +242,7 @@ template