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/game/StarStatusController.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source/game/StarStatusController.cpp') diff --git a/source/game/StarStatusController.cpp b/source/game/StarStatusController.cpp index ba0930c..fcf9924 100644 --- a/source/game/StarStatusController.cpp +++ b/source/game/StarStatusController.cpp @@ -75,10 +75,10 @@ Json StatusController::diskStore() const { return JsonObject{ {"statusProperties", m_statusProperties.get()}, - {"persistentEffectCategories", move(persistentEffectCategories)}, - {"ephemeralEffects", move(ephemeralEffects)}, - {"resourceValues", move(resourceValues)}, - {"resourcesLocked", move(resourcesLocked)}, + {"persistentEffectCategories", std::move(persistentEffectCategories)}, + {"ephemeralEffects", std::move(ephemeralEffects)}, + {"resourceValues", std::move(resourceValues)}, + {"resourcesLocked", std::move(resourcesLocked)}, }; } @@ -111,7 +111,7 @@ Json StatusController::statusProperty(String const& name, Json const& def) const void StatusController::setStatusProperty(String const& name, Json value) { m_statusProperties.update([&](JsonObject& statusProperties) { if (statusProperties[name] != value) { - statusProperties[name] = move(value); + statusProperties[name] = std::move(value); return true; } return false; @@ -355,11 +355,11 @@ List StatusController::applyDamageRequest(DamageRequest cons } void StatusController::hitOther(EntityId targetEntityId, DamageRequest damageRequest) { - m_recentHitsGiven.add({targetEntityId, move(damageRequest)}); + m_recentHitsGiven.add({targetEntityId, std::move(damageRequest)}); } void StatusController::damagedOther(DamageNotification damageNotification) { - m_recentDamageGiven.add(move(damageNotification)); + m_recentDamageGiven.add(std::move(damageNotification)); } List StatusController::pullSelfDamageNotifications() { @@ -367,10 +367,10 @@ List StatusController::pullSelfDamageNotifications() { } void StatusController::applySelfDamageRequest(DamageRequest dr) { - auto damageNotifications = applyDamageRequest(move(dr)); + auto damageNotifications = applyDamageRequest(std::move(dr)); for (auto const& dn : damageNotifications) m_recentDamageTaken.add(dn); - m_pendingSelfDamageNotifications.appendAll(move(damageNotifications)); + m_pendingSelfDamageNotifications.appendAll(std::move(damageNotifications)); } pair, uint64_t> StatusController::damageTakenSince(uint64_t since) const { @@ -514,7 +514,7 @@ void StatusController::tickMaster(float dt) { for (auto const& pair : m_uniqueEffects) parentDirectives.append(pair.second.parentDirectives); - m_parentDirectives.set(move(parentDirectives)); + m_parentDirectives.set(std::move(parentDirectives)); updateAnimators(dt); } @@ -570,7 +570,7 @@ Maybe StatusController::receiveMessage(String const& message, bool localMe } StatusController::EffectAnimator::EffectAnimator(Maybe config) { - animationConfig = move(config); + animationConfig = std::move(config); animator = animationConfig ? NetworkedAnimator(*animationConfig) : NetworkedAnimator(); } @@ -623,8 +623,8 @@ StatusController::UniqueEffectMetadata::UniqueEffectMetadata() { StatusController::UniqueEffectMetadata::UniqueEffectMetadata(UniqueStatusEffect effect, Maybe duration, Maybe sourceEntityId) : UniqueEffectMetadata() { - this->effect = move(effect); - this->duration = move(duration); + this->effect = std::move(effect); + this->duration = std::move(duration); this->maxDuration.set(this->duration.value()); this->sourceEntityId.set(sourceEntityId); } -- cgit v1.2.3