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/items/StarActiveItem.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/items/StarActiveItem.cpp')
-rw-r--r-- | source/game/items/StarActiveItem.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/game/items/StarActiveItem.cpp b/source/game/items/StarActiveItem.cpp index 49e82be..102ad16 100644 --- a/source/game/items/StarActiveItem.cpp +++ b/source/game/items/StarActiveItem.cpp @@ -182,7 +182,7 @@ List<DamageSource> ActiveItem::damageSources() const { line.flipHorizontal(0.0f); line.translate(handPosition(Vec2F())); } - damageSources.append(move(ds)); + damageSources.append(std::move(ds)); } return damageSources; } @@ -194,7 +194,7 @@ List<PolyF> ActiveItem::shieldPolys() const { if (owner()->facingDirection() == Direction::Left) sp.flipHorizontal(0.0f); sp.translate(handPosition(Vec2F())); - shieldPolys.append(move(sp)); + shieldPolys.append(std::move(sp)); } return shieldPolys; } @@ -213,7 +213,7 @@ List<PhysicsForceRegion> ActiveItem::forceRegions() const { rfr->center[0] *= -1; rfr->center += owner()->position() + handPosition(Vec2F()); } - forceRegions.append(move(fr)); + forceRegions.append(std::move(fr)); } return forceRegions; } @@ -276,7 +276,7 @@ List<LightSource> ActiveItem::lights() const { else light.beamAngle = -Constants::pi / 2 - constrainAngle(light.beamAngle + Constants::pi / 2); } - result.append(move(light)); + result.append(std::move(light)); } result.appendAll(m_scriptedAnimator.lightSources()); return result; @@ -294,7 +294,7 @@ List<AudioInstancePtr> ActiveItem::pullNewAudios() { for (auto& audio : m_itemAnimatorDynamicTarget.pullNewAudios()) { m_activeAudio[audio] = *audio->position(); audio->setPosition(owner()->position() + handPosition(*audio->position())); - result.append(move(audio)); + result.append(std::move(audio)); } result.appendAll(m_scriptedAnimator.pullNewAudios()); return result; @@ -310,7 +310,7 @@ List<Particle> ActiveItem::pullNewParticles() { particle.velocity[0] *= -1; particle.flip = !particle.flip; } - result.append(move(particle)); + result.append(std::move(particle)); } result.appendAll(m_scriptedAnimator.pullNewParticles()); return result; @@ -462,20 +462,20 @@ LuaCallbacks ActiveItem::makeActiveItemCallbacks() { }); callbacks.registerCallback("setCursor", [this](Maybe<String> cursor) { - m_cursor = move(cursor); + m_cursor = std::move(cursor); }); callbacks.registerCallback("setScriptedAnimationParameter", [this](String name, Json value) { - m_scriptedAnimationParameters.set(move(name), move(value)); + m_scriptedAnimationParameters.set(std::move(name), std::move(value)); }); callbacks.registerCallback("setInventoryIcon", [this](String image) { setInstanceValue("inventoryIcon", image); - setIconDrawables({Drawable::makeImage(move(image), 1.0f, true, Vec2F())}); + setIconDrawables({Drawable::makeImage(std::move(image), 1.0f, true, Vec2F())}); }); callbacks.registerCallback("setInstanceValue", [this](String name, Json val) { - setInstanceValue(move(name), move(val)); + setInstanceValue(std::move(name), std::move(val)); }); callbacks.registerCallback("callOtherHandScript", [this](String const& func, LuaVariadic<LuaValue> const& args) { |