Enable readability-const-return-type, readability-container-data-pointer, readability-delete-null-pointer

This commit is contained in:
def 2022-01-22 13:47:37 +01:00
parent 653c7715a5
commit bcb50c1b29
4 changed files with 12 additions and 21 deletions

View file

@ -37,7 +37,10 @@ Checks: >
-misc-unused-parameters,
modernize-loop-convert,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-data-pointer,
readability-qualified-auto,
readability-delete-null-pointer,
performance-*,
-performance-no-int-to-ptr,
HeaderFilterRegex: 'src/.*'

View file

@ -322,19 +322,11 @@ bool CMapLayers::STileLayerVisuals::Init(unsigned int Width, unsigned int Height
CMapLayers::STileLayerVisuals::~STileLayerVisuals()
{
if(m_TilesOfLayer)
{
delete[] m_TilesOfLayer;
}
if(m_BorderTop)
delete[] m_BorderTop;
if(m_BorderBottom)
delete[] m_BorderBottom;
if(m_BorderLeft)
delete[] m_BorderLeft;
if(m_BorderRight)
delete[] m_BorderRight;
delete[] m_TilesOfLayer;
delete[] m_BorderTop;
delete[] m_BorderBottom;
delete[] m_BorderLeft;
delete[] m_BorderRight;
m_TilesOfLayer = NULL;
m_BorderTop = NULL;

View file

@ -566,10 +566,8 @@ void CCollision::MoveBox(vec2 *pInoutPos, vec2 *pInoutVel, vec2 Size, float Elas
void CCollision::Dest()
{
if(m_pDoor)
delete[] m_pDoor;
if(m_pSwitchers)
delete[] m_pSwitchers;
delete[] m_pDoor;
delete[] m_pSwitchers;
m_pTiles = 0;
m_Width = 0;
m_Height = 0;

View file

@ -430,10 +430,8 @@ CSaveTeam::CSaveTeam(IGameController *Controller)
CSaveTeam::~CSaveTeam()
{
if(m_pSwitchers)
delete[] m_pSwitchers;
if(m_pSavedTees)
delete[] m_pSavedTees;
delete[] m_pSwitchers;
delete[] m_pSavedTees;
}
int CSaveTeam::Save(int Team)