fix(Core/Misc): all GCC warnings (#3457)

This commit is contained in:
Francesco Borzì
2020-09-14 17:31:12 +02:00
committed by GitHub
parent 80b149b218
commit b61ae8abcd
34 changed files with 157 additions and 75 deletions

View File

@@ -593,6 +593,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load)
// 3 spells have no amplitude set
if (!m_amplitude)
m_amplitude = 1 * IN_MILLISECONDS;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_OBS_MOD_HEALTH:
@@ -3598,7 +3599,7 @@ void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8
return;
Unit* target = aurApp->GetTarget();
uint32 mechanic;
uint32 mechanic = 0;
switch (GetId())
{

View File

@@ -1559,6 +1559,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_WARRIOR:
if (!caster)
break;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELLFAMILY_WARLOCK:
if (!caster)
break;
@@ -2637,6 +2638,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
}
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
targetList.push_back(GetUnitOwner());
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
{
if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner())

View File

@@ -1366,7 +1366,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
Map* map = m_caster->GetMap();
uint32 mapid = m_caster->GetMapId();
uint32 phasemask = m_caster->GetPhaseMask();
float destx, desty, destz, ground, startx, starty, startz, starto;
float destx, desty, destz = 0, ground, startx, starty, startz, starto;
Position pos;
Position lastpos;
@@ -1379,8 +1379,8 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
if (!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || (pos.GetPositionZ() - ground < distance))
{
float tstX, tstY, tstZ, prevX, prevY, prevZ;
float tstZ1, tstZ2, tstZ3, destz1, destz2, destz3, srange, srange1, srange2, srange3;
float tstX = 0, tstY = 0, tstZ = 0, prevX = 0, prevY = 0, prevZ = 0;
float tstZ1 = 0, tstZ2 = 0, tstZ3 = 0, destz1 = 0, destz2 = 0, destz3 = 0, srange = 0, srange1 = 0, srange2 = 0, srange3 = 0;
float maxtravelDistZ = 2.65f;
float overdistance = 0.0f;
float totalpath = 0.0f;
@@ -3571,6 +3571,7 @@ void Spell::cancel(bool bySelf)
if (m_caster->ToPlayer()->NeedSendSpectatorData())
ArenaSpectator::SendCommand_Spell(m_caster->FindMap(), m_caster->GetGUID(), "SPE", m_spellInfo->Id, bySelf ? 99998 : 99999);
}
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELL_STATE_DELAYED:
SendInterrupted(0);
// xinef: fixes bugged gcd reset in some cases
@@ -6010,6 +6011,7 @@ SpellCastResult Spell::CheckCast(bool strict)
case SUMMON_CATEGORY_PET:
if (m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
[[fallthrough]];
case SUMMON_CATEGORY_PUPPET:
if (m_caster->GetCharmGUID())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
@@ -6929,6 +6931,7 @@ SpellCastResult Spell::CheckItems()
return SPELL_FAILED_DONT_REPORT;
}
}
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
{
Item* targetItem = m_targets.GetItemTarget();
@@ -7490,8 +7493,9 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const
break;
/*case SPELL_EFFECT_CHARGE:
if (MMAP::MMapFactory::IsPathfindingEnabled(m_caster->FindMap()))
break;*/
// else no break intended
break;
[[fallthrough]];
*/
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
if (m_caster->GetTypeId() != TYPEID_PLAYER || target->GetTypeId() != TYPEID_PLAYER)
@@ -8444,7 +8448,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target)
case TARGET_CHECK_RAID_CLASS:
if (_referer->getClass() != unitTarget->getClass())
return false;
// nobreak;
[[fallthrough]];
case TARGET_CHECK_RAID:
if (unitTarget->IsTotem())
return false;

View File

@@ -165,7 +165,7 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet
targetMask = TARGET_FLAG_UNIT_PASSENGER;
break;
case TARGET_CHECK_RAID_CLASS:
// nobreak;
[[fallthrough]];
default:
targetMask = TARGET_FLAG_UNIT;
break;
@@ -2232,6 +2232,7 @@ SpellSpecificType SpellInfo::LoadSpellSpecific() const
/// @workaround For non-stacking tracking spells (We need generic solution)
if (Id == 30645) // Gas Cloud Tracking
return SPELL_SPECIFIC_NORMAL;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case SPELL_AURA_TRACK_RESOURCES:
case SPELL_AURA_TRACK_STEALTHED:
return SPELL_SPECIFIC_TRACKER;

View File

@@ -2905,6 +2905,7 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEALTH_FUNNEL ||
spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DUMMY)
continue;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
default:
if (spellInfo->Effects[j].CalcValue() || ((spellInfo->Effects[j].Effect == SPELL_EFFECT_INTERRUPT_CAST || spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) && !spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)))
if (spellInfo->Id != 69649 && spellInfo->Id != 71056 && spellInfo->Id != 71057 && spellInfo->Id != 71058 && spellInfo->Id != 73061 && spellInfo->Id != 73062 && spellInfo->Id != 73063 && spellInfo->Id != 73064) // Sindragosa Frost Breath
@@ -4375,6 +4376,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 57619: // WintergraspDemolisher - Spell Hourl Boulder - EffectRadiusIndex
case 57610: // Cannon (Siege Turret)
spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_25_YARDS; // SPELL_EFFECT_WMO_DAMAGE
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 51422: // WintergraspCannon - Spell Fire Cannon - EffectRadiusIndex
spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_10_YARDS; // SPELL_EFFECT_SCHOOL_DAMAGE
break;
@@ -4787,7 +4789,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 56430:
spellInfo->Effect[0] = SPELL_EFFECT_TRIGGER_MISSILE;
spellInfo->EffectTriggerSpell[0] = 56429;
// no break intended
[[fallthrough]];
case 56429:
spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST;
spellInfo->EffectImplicitTargetB[0] = 0;
@@ -5157,7 +5159,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[1] = TARGET_UNIT_TARGET_ANY;
spellInfo->EffectImplicitTargetB[1] = TARGET_DEST_TARGET_ANY;
spellInfo->Effect[1] = 0;
// no break intended
[[fallthrough]];
case 66317:
spellInfo->Attributes |= SPELL_ATTR0_STOP_ATTACK_TARGET;
spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
@@ -5254,6 +5256,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 65767: // light surge 0
spellInfo->excludeTargetAuraSpell = 65686;
break;
@@ -5262,6 +5265,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67274: // light surge 1
spellInfo->excludeTargetAuraSpell = 67222;
break;
@@ -5270,6 +5274,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67275: // light surge 2
spellInfo->excludeTargetAuraSpell = 67223;
break;
@@ -5278,6 +5283,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67276: // light surge 3
spellInfo->excludeTargetAuraSpell = 67224;
break;
@@ -5286,6 +5292,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 65769: // dark surge 0
spellInfo->excludeTargetAuraSpell = 65684;
break;
@@ -5294,6 +5301,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67265: // dark surge 1
spellInfo->excludeTargetAuraSpell = 67176;
break;
@@ -5302,6 +5310,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67266: // dark surge 2
spellInfo->excludeTargetAuraSpell = 67177;
break;
@@ -5310,6 +5319,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = 6;
spellInfo->EffectImplicitTargetB[0] = 0;
spellInfo->Effect[1] = 0; spellInfo->Effect[2] = 0;
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
case 67267: // dark surge 3
spellInfo->excludeTargetAuraSpell = 67178;
break;