Skip to content

Commit

Permalink
clang-tidy (#11316)
Browse files Browse the repository at this point in the history
* 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 6dc8186.
  • Loading branch information
JohnsterID authored Oct 8, 2024
1 parent da86306 commit 8d5777b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvDllDealAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ CvDealAI* CvDllDealAI::GetInstance()
//------------------------------------------------------------------------------
ICvPlayer1* CvDllDealAI::GetPlayer()
{
CvPlayerAI* pkPlayer = (CvPlayerAI*)m_pDealAI->GetPlayer();
CvPlayerAI* pkPlayer = static_cast<CvPlayerAI*>(m_pDealAI->GetPlayer());
return (NULL != pkPlayer)? new CvDllPlayer(pkPlayer) : NULL;
}
//------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions CvGameCoreDLL_Expansion2/CvDllGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions CvGameCoreDLL_Expansion2/CvDllPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -327,13 +327,13 @@ ICvUnit1* CvDllPlot::GetUnitByIndex(int iIndex) const
void CvDllPlot::AddUnit(ICvUnit1* pUnit, bool bUpdate)
{
CvUnit* pkUnit = (NULL != pUnit)? static_cast<CvDllUnit*>(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<CvDllUnit*>(pUnit)->GetInstance() : NULL;
return m_pPlot->removeUnit(pkUnit, bUpdate);
m_pPlot->removeUnit(pkUnit, bUpdate);
}
//------------------------------------------------------------------------------
const IDInfo* CvDllPlot::NextUnitNode(const IDInfo* pNode) const
Expand Down

0 comments on commit 8d5777b

Please sign in to comment.