diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/core/StarFlatHashTable.hpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
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.
Diffstat (limited to 'source/core/StarFlatHashTable.hpp')
-rw-r--r-- | source/core/StarFlatHashTable.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/core/StarFlatHashTable.hpp b/source/core/StarFlatHashTable.hpp index a13e08a..e9a8680 100644 --- a/source/core/StarFlatHashTable.hpp +++ b/source/core/StarFlatHashTable.hpp @@ -138,7 +138,7 @@ template <typename Value, typename Key, typename GetKey, typename Hash, typename FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::Bucket::Bucket(Bucket&& rhs) { this->hash = rhs.hash; if (auto o = rhs.valuePtr()) - new (&this->value) Value(move(*o)); + new (&this->value) Value(std::move(*o)); } template <typename Value, typename Key, typename GetKey, typename Hash, typename Equals, typename Allocator> @@ -160,9 +160,9 @@ template <typename Value, typename Key, typename GetKey, typename Hash, typename auto FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::Bucket::operator=(Bucket&& rhs) -> Bucket& { if (auto o = rhs.valuePtr()) { if (auto s = valuePtr()) - *s = move(*o); + *s = std::move(*o); else - new (&this->value) Value(move(*o)); + new (&this->value) Value(std::move(*o)); } else { if (auto s = valuePtr()) s->~Value(); @@ -174,9 +174,9 @@ auto FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::Bucket::operato template <typename Value, typename Key, typename GetKey, typename Hash, typename Equals, typename Allocator> void FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::Bucket::setFilled(size_t hash, Value value) { if (auto s = valuePtr()) - *s = move(value); + *s = std::move(value); else - new (&this->value) Value(move(value)); + new (&this->value) Value(std::move(value)); this->hash = hash | FilledHashBit; } @@ -370,7 +370,7 @@ auto FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::insert(Value va currentBucket = hashBucket(currentBucket + 1); } else { - target.setFilled(hash, move(value)); + target.setFilled(hash, std::move(value)); ++m_filledCount; if (insertedBucket == NPos) insertedBucket = currentBucket; @@ -392,7 +392,7 @@ auto FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::erase(const_ite if (auto nextPtr = nextBucket->valuePtr()) { if (bucketError(nextBucketIndex, nextBucket->hash) > 0) { currentBucket->hash = nextBucket->hash; - *currentBucket->valuePtr() = move(*nextPtr); + *currentBucket->valuePtr() = std::move(*nextPtr); currentBucketIndex = nextBucketIndex; currentBucket = nextBucket; } else { @@ -548,7 +548,7 @@ void FlatHashTable<Value, Key, GetKey, Hash, Equals, Allocator>::checkCapacity(s for (auto& entry : oldBuckets) { if (auto ptr = entry.valuePtr()) - insert(move(*ptr)); + insert(std::move(*ptr)); } } |