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/StarStatSet.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/StarStatSet.cpp')
-rw-r--r-- | source/game/StarStatSet.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/game/StarStatSet.cpp b/source/game/StarStatSet.cpp index aa6513e..82258f8 100644 --- a/source/game/StarStatSet.cpp +++ b/source/game/StarStatSet.cpp @@ -4,7 +4,7 @@ namespace Star { void StatSet::addStat(String statName, float baseValue) { - if (!m_baseStats.insert(move(statName), baseValue).second) + if (!m_baseStats.insert(std::move(statName), baseValue).second) throw StatusException::format("Added duplicate stat named '{}' in StatSet", statName); update(0.0f); } @@ -42,7 +42,7 @@ void StatSet::setStatBaseValue(String const& statName, float value) { StatModifierGroupId StatSet::addStatModifierGroup(List<StatModifier> modifiers) { bool empty = modifiers.empty(); - auto id = m_statModifierGroups.add(move(modifiers)); + auto id = m_statModifierGroups.add(std::move(modifiers)); if (!empty) update(0.0f); return id; @@ -58,7 +58,7 @@ List<StatModifier> StatSet::statModifierGroup(StatModifierGroupId modifierGroupI void StatSet::addStatModifierGroup(StatModifierGroupId groupId, List<StatModifier> modifiers) { bool empty = modifiers.empty(); - m_statModifierGroups.add(groupId, move(modifiers)); + m_statModifierGroups.add(groupId, std::move(modifiers)); if (!empty) update(0.0f); } @@ -66,7 +66,7 @@ void StatSet::addStatModifierGroup(StatModifierGroupId groupId, List<StatModifie bool StatSet::setStatModifierGroup(StatModifierGroupId groupId, List<StatModifier> modifiers) { auto& list = m_statModifierGroups.get(groupId); if (list != modifiers) { - list = move(modifiers); + list = std::move(modifiers); update(0.0f); return true; } @@ -95,7 +95,7 @@ StatModifierGroupMap const& StatSet::allStatModifierGroups() const { void StatSet::setAllStatModifierGroups(StatModifierGroupMap map) { if (m_statModifierGroups != map) { - m_statModifierGroups = move(map); + m_statModifierGroups = std::move(map); update(0.0f); } } @@ -118,7 +118,7 @@ float StatSet::statEffectiveValue(String const& statName) const { } void StatSet::addResource(String resourceName, MVariant<String, float> max, MVariant<String, float> delta) { - auto pair = m_resources.insert({move(resourceName), Resource{move(max), move(delta), false, 0.0f, {}}}); + auto pair = m_resources.insert({std::move(resourceName), Resource{std::move(max), std::move(delta), false, 0.0f, {}}}); if (!pair.second) throw StatusException::format("Added duplicate resource named '{}' in StatSet", resourceName); update(0.0f); |