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/StarException_windows.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/core/StarException_windows.cpp') diff --git a/source/core/StarException_windows.cpp b/source/core/StarException_windows.cpp index b40df12..159cf3d 100644 --- a/source/core/StarException_windows.cpp +++ b/source/core/StarException_windows.cpp @@ -117,7 +117,7 @@ inline StackCapture captureStack() { } OutputProxy outputStack(StackCapture stack) { - return OutputProxy([stack = move(stack)](std::ostream & os) { + return OutputProxy([stack = std::move(stack)](std::ostream & os) { HANDLE process = GetCurrentProcess(); g_dbgHelpLock.lock(); for (size_t i = 0; i < stack.second; ++i) { @@ -146,13 +146,13 @@ StarException::StarException() noexcept : StarException(std::string("StarExcepti StarException::~StarException() noexcept {} -StarException::StarException(std::string message, bool genStackTrace) noexcept : StarException("StarException", move(message), genStackTrace) {} +StarException::StarException(std::string message, bool genStackTrace) noexcept : StarException("StarException", std::move(message), genStackTrace) {} StarException::StarException(std::exception const& cause) noexcept : StarException("StarException", std::string(), cause) {} StarException::StarException(std::string message, std::exception const& cause) noexcept - : StarException("StarException", move(message), cause) {} + : StarException("StarException", std::move(message), cause) {} const char* StarException::what() const throw() { if (m_whatBuffer.empty()) { @@ -176,11 +176,11 @@ StarException::StarException(char const* type, std::string message, bool genStac } }; - m_printException = bind(printException, _1, _2, type, move(message), genStackTrace ? captureStack() : Maybe()); + m_printException = bind(printException, _1, _2, type, std::move(message), genStackTrace ? captureStack() : Maybe()); } StarException::StarException(char const* type, std::string message, std::exception const& cause) noexcept - : StarException(type, move(message)) { + : StarException(type, std::move(message)) { auto printException = [](std::ostream& os, bool fullStacktrace, function self, @@ -199,7 +199,7 @@ StarException::StarException(char const* type, std::string message, std::excepti }, _1, _2, std::string(cause.what())); } - m_printException = bind(printException, _1, _2, m_printException, move(printCause)); + m_printException = bind(printException, _1, _2, m_printException, std::move(printCause)); } std::string printException(std::exception const& e, bool fullStacktrace) { -- cgit v1.2.3