Core/Misc: Fix static analysis issues

Fix some static analysis issues reported by Coverity
This commit is contained in:
jackpoz
2015-02-21 14:53:17 +01:00
parent 68fceee10e
commit d2396fb897
4 changed files with 15 additions and 8 deletions
+10 -3
View File
@@ -177,7 +177,9 @@ void WorldSession::HandlePetitionShowSignatures(WorldPackets::Petition::Petition
signature.Choice = 0;
signaturesPacket.Signatures.push_back(signature);
result->NextRow();
// Checking the return value just to be double safe
if (!result->NextRow())
break;
}
SendPacket(signaturesPacket.Write());
@@ -447,7 +449,9 @@ void WorldSession::HandleOfferPetition(WorldPackets::Petition::OfferPetition& pa
signature.Choice = 0;
signaturesPacket.Signatures.push_back(signature);
result->NextRow();
// Checking the return value just to be double safe
if (!result->NextRow())
break;
}
player->GetSession()->SendPacket(signaturesPacket.Write());
@@ -551,7 +555,10 @@ void WorldSession::HandleTurnInPetition(WorldPackets::Petition::TurnInPetition&
{
Field* fields = result->Fetch();
guild->AddMember(ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64()));
result->NextRow();
// Checking the return value just to be double safe
if (!result->NextRow())
break;
}
SQLTransaction trans = CharacterDatabase.BeginTransaction();
+2 -2
View File
@@ -85,8 +85,8 @@ namespace WorldPackets
void Read() override;
ObjectGuid GossipUnit;
int32 GossipIndex;
int32 GossipID;
int32 GossipIndex = 0;
int32 GossipID = 0;
std::string PromotionCode;
};
@@ -226,8 +226,8 @@ namespace WorldPackets
void Read() override;
uint8 PackSlot;
uint8 Slot;
uint8 PackSlot = 0;
uint8 Slot = 0;
ObjectGuid CastItem;
SpellCastRequest Cast;
};
+1 -1
View File
@@ -640,7 +640,7 @@ void SpellHistory::LockSpellSchool(SpellSchoolMask schoolMask, uint32 lockoutTim
else if (Pet* petOwner = _owner->ToPet())
{
for (auto const& p : petOwner->m_spells)
if (p.second.state != PLAYERSPELL_REMOVED)
if (p.second.state != PETSPELL_REMOVED)
knownSpells.insert(p.first);
}
else