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/game/StarItemDatabase.cpp | |
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/game/StarItemDatabase.cpp')
-rw-r--r-- | source/game/StarItemDatabase.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/game/StarItemDatabase.cpp b/source/game/StarItemDatabase.cpp index 4a72ab5..0eccb2e 100644 --- a/source/game/StarItemDatabase.cpp +++ b/source/game/StarItemDatabase.cpp @@ -228,7 +228,7 @@ ItemPtr ItemDatabase::itemShared(ItemDescriptor descriptor, Maybe<float> level, get<2>(entry) = item->parameters().optUInt("seed"); // Seed could've been changed by the buildscript locker.lock(); - return m_itemCache.get(entry, [&](ItemCacheEntry const&) -> ItemPtr { return move(item); }); + return m_itemCache.get(entry, [&](ItemCacheEntry const&) -> ItemPtr { return std::move(item); }); } } @@ -521,10 +521,10 @@ ItemDatabase::ItemData const& ItemDatabase::itemData(String const& name) const { ItemRecipe ItemDatabase::makeRecipe(List<ItemDescriptor> inputs, ItemDescriptor output, float duration, StringSet groups) const { ItemRecipe res; - res.inputs = move(inputs); - res.output = move(output); + res.inputs = std::move(inputs); + res.output = std::move(output); res.duration = duration; - res.groups = move(groups); + res.groups = std::move(groups); if (auto item = ItemDatabase::itemShared(res.output)) { res.outputRarity = item->rarity(); res.guiFilterString = guiFilterString(item); @@ -585,12 +585,12 @@ void ItemDatabase::addObjectDropItem(String const& objectPath, Json const& objec // execute scripts intended for objects customConfig.remove("scripts"); - data.customConfig = move(customConfig); + data.customConfig = std::move(customConfig); if (m_items.contains(data.name)) throw ItemException(strf("Object drop '{}' shares name with existing item", data.name)); - m_items[data.name] = move(data); + m_items[data.name] = std::move(data); } void ItemDatabase::scanItems() { @@ -694,7 +694,7 @@ void ItemDatabase::addBlueprints() { configInfo["price"] = baseItem->price(); - blueprintData.customConfig = move(configInfo); + blueprintData.customConfig = std::move(configInfo); blueprintData.directory = itemData(baseDesc.name()).directory; m_items[blueprintData.name] = blueprintData; |