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/StarBTreeDatabase.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/core/StarBTreeDatabase.cpp') diff --git a/source/core/StarBTreeDatabase.cpp b/source/core/StarBTreeDatabase.cpp index 4ac321f..b188f20 100644 --- a/source/core/StarBTreeDatabase.cpp +++ b/source/core/StarBTreeDatabase.cpp @@ -58,7 +58,7 @@ String BTreeDatabase::contentIdentifier() const { void BTreeDatabase::setContentIdentifier(String contentIdentifier) { WriteLocker writeLocker(m_lock); checkIfOpen("setContentIdentifier", false); - m_contentIdentifier = move(contentIdentifier); + m_contentIdentifier = std::move(contentIdentifier); } uint32_t BTreeDatabase::indexCacheSize() const { @@ -91,7 +91,7 @@ IODevicePtr BTreeDatabase::ioDevice() const { void BTreeDatabase::setIODevice(IODevicePtr device) { WriteLocker writeLocker(m_lock); checkIfOpen("setIODevice", false); - m_device = move(device); + m_device = std::move(device); } bool BTreeDatabase::isOpen() const { @@ -188,12 +188,12 @@ void BTreeDatabase::forEach(ByteArray const& lower, ByteArray const& upper, func ReadLocker readLocker(m_lock); checkKeySize(lower); checkKeySize(upper); - m_impl.forEach(lower, upper, move(v)); + m_impl.forEach(lower, upper, std::move(v)); } void BTreeDatabase::forAll(function v) { ReadLocker readLocker(m_lock); - m_impl.forAll(move(v)); + m_impl.forAll(std::move(v)); } bool BTreeDatabase::insert(ByteArray const& k, ByteArray const& data) { @@ -445,7 +445,7 @@ ByteArray const& BTreeDatabase::LeafNode::data(size_t i) const { } void BTreeDatabase::LeafNode::insert(size_t i, ByteArray k, ByteArray d) { - elements.insertAt(i, Element{move(k), move(d)}); + elements.insertAt(i, Element{std::move(k), std::move(d)}); } void BTreeDatabase::LeafNode::remove(size_t i) { @@ -855,7 +855,7 @@ auto BTreeDatabase::BTreeImpl::leafData(Leaf const& leaf, size_t i) -> Data { } void BTreeDatabase::BTreeImpl::leafInsert(Leaf& leaf, size_t i, Key k, Data d) { - leaf->insert(i, move(k), move(d)); + leaf->insert(i, std::move(k), std::move(d)); } void BTreeDatabase::BTreeImpl::leafRemove(Leaf& leaf, size_t i) { -- cgit v1.2.3