chore(Apps/Codestyle): add new codestyle checks for pointers and range loops (#19841)

* chore(Apps/Codestyle): add new codestyle checks for pointers and range loops

* revert a typo
This commit is contained in:
Grimdhex
2024-09-03 18:02:38 +02:00
committed by GitHub
parent c929b95172
commit 221dbd3fdb
18 changed files with 52 additions and 29 deletions
+1 -1
View File
@@ -7739,7 +7739,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
// remove FD and invisibility at all loots
constexpr std::array<AuraType, 2> toRemove = {SPELL_AURA_MOD_INVISIBILITY, SPELL_AURA_FEIGN_DEATH};
for (const auto& aura : toRemove)
for (auto const& aura : toRemove)
{
RemoveAurasByType(aura);
}
@@ -29,7 +29,7 @@ PlayerSocial::PlayerSocial(): m_playerGUID() { }
uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) const
{
uint32 counter = 0;
for (const auto& itr : m_playerSocialMap)
for (auto const& itr : m_playerSocialMap)
{
if ((itr.second.Flags & flag) != 0)
++counter;
@@ -178,7 +178,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
{
const auto& itr = m_playerSocialMap.find(guid);
auto const& itr = m_playerSocialMap.find(guid);
if (itr != m_playerSocialMap.end())
return (itr->second.Flags & flags) != 0;
+1 -1
View File
@@ -2657,7 +2657,7 @@ bool Unit::GetMeleeAttackPoint(Unit* attacker, Position& pos)
double attackerSize = attacker->GetCollisionRadius();
for (const auto& otherAttacker: attackers)
for (auto const& otherAttacker: attackers)
{
// if the otherAttacker is not valid, skip
if (!otherAttacker || otherAttacker->GetGUID() == attacker->GetGUID() ||
+1 -1
View File
@@ -71,7 +71,7 @@ namespace Movement
1.f, 0.f, 0.f, 0.f);
/* classic view:
inline void C_Evaluate(const Vector3 *vertice, float t, const float (&matrix)[4][4], Vector3 &position)
inline void C_Evaluate(Vector3 const* vertice, float t, const float (&matrix)[4][4], Vector3 &position)
{
Vector3 tvec(t*t*t, t*t, t);
int i = 0;
+2 -2
View File
@@ -127,8 +127,8 @@ public:
void DecryptData(uint8* buffer, uint32 length);
void EncryptData(uint8* buffer, uint32 length);
static bool IsValidCheckSum(uint32 checksum, const uint8 *data, const uint16 length);
static uint32 BuildChecksum(const uint8 *data, uint32 length);
static bool IsValidCheckSum(uint32 checksum, uint8 const* data, const uint16 length);
static uint32 BuildChecksum(uint8 const* data, uint32 length);
// If no check is passed, the default action from config is executed
void ApplyPenalty(uint16 checkId, std::string const& reason);