From 8d5777b86394cb5650e9035ab4bbaafd30463c64 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:49:38 +1030 Subject: [PATCH] clang-tidy (#11316) * readability-avoid-return-with-void-value return statement within a void function should not have a specified return value * readability-math-missing-parentheses add parentheses to explicitly specify the order of operations * cppcoreguidelines-pro-type-cstyle-cast * Revert "readability-math-missing-parentheses" This reverts commit 6dc818610a4f77da745959a57f99bd08e3a24524. --- CvGameCoreDLL_Expansion2/CvDllDealAI.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllGame.cpp | 4 ++-- CvGameCoreDLL_Expansion2/CvDllPlot.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CvGameCoreDLL_Expansion2/CvDllDealAI.cpp b/CvGameCoreDLL_Expansion2/CvDllDealAI.cpp index ae7e6440db..4dfa7ac8f9 100644 --- a/CvGameCoreDLL_Expansion2/CvDllDealAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllDealAI.cpp @@ -83,7 +83,7 @@ CvDealAI* CvDllDealAI::GetInstance() //------------------------------------------------------------------------------ ICvPlayer1* CvDllDealAI::GetPlayer() { - CvPlayerAI* pkPlayer = (CvPlayerAI*)m_pDealAI->GetPlayer(); + CvPlayerAI* pkPlayer = static_cast(m_pDealAI->GetPlayer()); return (NULL != pkPlayer)? new CvDllPlayer(pkPlayer) : NULL; } //------------------------------------------------------------------------------ diff --git a/CvGameCoreDLL_Expansion2/CvDllGame.cpp b/CvGameCoreDLL_Expansion2/CvDllGame.cpp index e7fd7f44bc..141a92aa6e 100644 --- a/CvGameCoreDLL_Expansion2/CvDllGame.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllGame.cpp @@ -289,12 +289,12 @@ bool CvDllGame::HasTurnTimerExpired(PlayerTypes playerID) //------------------------------------------------------------------------------ void CvDllGame::TurnTimerSync(float fCurTurnTime, float fTurnStartTime) { - return m_pGame->TurnTimerSync(fCurTurnTime, fTurnStartTime); + m_pGame->TurnTimerSync(fCurTurnTime, fTurnStartTime); } //------------------------------------------------------------------------------ void CvDllGame::GetTurnTimerData(float& fCurTurnTime, float& fTurnStartTime) { - return m_pGame->GetTurnTimerData(fCurTurnTime, fTurnStartTime); + m_pGame->GetTurnTimerData(fCurTurnTime, fTurnStartTime); } //------------------------------------------------------------------------------ void CvDllGame::Init(HandicapTypes eHandicap) diff --git a/CvGameCoreDLL_Expansion2/CvDllPlot.cpp b/CvGameCoreDLL_Expansion2/CvDllPlot.cpp index 955dedf3b2..7bfd8315a8 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPlot.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPlot.cpp @@ -304,7 +304,7 @@ bool CvDllPlot::GetAnyBuildProgress() const //------------------------------------------------------------------------------ void CvDllPlot::UpdateLayout(bool bDebug) { - return m_pPlot->updateLayout(bDebug); + m_pPlot->updateLayout(bDebug); } //------------------------------------------------------------------------------ ICvUnit1* CvDllPlot::GetCenterUnit() @@ -327,13 +327,13 @@ ICvUnit1* CvDllPlot::GetUnitByIndex(int iIndex) const void CvDllPlot::AddUnit(ICvUnit1* pUnit, bool bUpdate) { CvUnit* pkUnit = (NULL != pUnit)? static_cast(pUnit)->GetInstance() : NULL; - return m_pPlot->addUnit(pkUnit, bUpdate); + m_pPlot->addUnit(pkUnit, bUpdate); } //------------------------------------------------------------------------------ void CvDllPlot::RemoveUnit(ICvUnit1* pUnit, bool bUpdate) { CvUnit* pkUnit = (NULL != pUnit)? static_cast(pUnit)->GetInstance() : NULL; - return m_pPlot->removeUnit(pkUnit, bUpdate); + m_pPlot->removeUnit(pkUnit, bUpdate); } //------------------------------------------------------------------------------ const IDInfo* CvDllPlot::NextUnitNode(const IDInfo* pNode) const