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/StarMultiArray.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source/core/StarMultiArray.hpp') diff --git a/source/core/StarMultiArray.hpp b/source/core/StarMultiArray.hpp index 3668c8a..bb33490 100644 --- a/source/core/StarMultiArray.hpp +++ b/source/core/StarMultiArray.hpp @@ -326,14 +326,14 @@ void MultiArray::set(IndexArray const& index, Element element) { throw MultiArrayException(strf("Out of bounds on MultiArray::set({})", index)); } - m_data[storageIndex(index)] = move(element); + m_data[storageIndex(index)] = std::move(element); } template Element MultiArray::get(IndexArray const& index, Element def) { for (size_t i = Rank; i != 0; --i) { if (index[i - 1] >= m_shape[i - 1]) - return move(def); + return std::move(def); } return m_data[storageIndex(index)]; @@ -346,7 +346,7 @@ void MultiArray::setResize(IndexArray const& index, Element eleme newShape[i] = std::max(m_shape[i], index[i] + 1); resize(newShape); - m_data[storageIndex(index)] = move(element); + m_data[storageIndex(index)] = std::move(element); } template @@ -369,26 +369,26 @@ template template void MultiArray::forEach(IndexArray const& min, SizeArray const& size, OpType&& op) { IndexArray index; - subForEach(min, size, forward(op), index, 0, 0); + subForEach(min, size, std::forward(op), index, 0, 0); } template template void MultiArray::forEach(IndexArray const& min, SizeArray const& size, OpType&& op) const { IndexArray index; - subForEach(min, size, forward(op), index, 0, 0); + subForEach(min, size, std::forward(op), index, 0, 0); } template template void MultiArray::forEach(OpType&& op) { - forEach(IndexArray::filled(0), size(), forward(op)); + forEach(IndexArray::filled(0), size(), std::forward(op)); } template template void MultiArray::forEach(OpType&& op) const { - forEach(IndexArray::filled(0), size(), forward(op)); + forEach(IndexArray::filled(0), size(), std::forward(op)); } template @@ -461,7 +461,7 @@ void MultiArray::subForEach(IndexArray const& min, SizeArray cons if (dim == Rank - 1) op(index, m_data[offset + i]); else - subForEach(min, size, forward(op), index, (offset + i) * m_shape[dim + 1], dim + 1); + subForEach(min, size, std::forward(op), index, (offset + i) * m_shape[dim + 1], dim + 1); } } @@ -475,7 +475,7 @@ void MultiArray::subForEach(IndexArray const& min, SizeArray cons if (dim == Rank - 1) op(index, m_data[offset + i]); else - subForEach(min, size, forward(op), index, (offset + i) * m_shape[dim + 1], dim + 1); + subForEach(min, size, std::forward(op), index, (offset + i) * m_shape[dim + 1], dim + 1); } } -- cgit v1.2.3