Commit 18dadd52 authored by Sean McBride's avatar Sean McBride

Fixed a bunch of -Wzero-as-null-pointer-constant

- most fixed automatically by clang
- a few fixed manually by me (especially in macros)
parent ea77531f
......@@ -734,7 +734,7 @@ unsigned int vtkHyperTreeGrid::GetNumberOfLevels()
vtkHyperTreeGrid::vtkHyperTreeGridIterator it;
this->InitializeTreeIterator(it);
vtkHyperTree* tree = nullptr;
while ((tree = it.GetNextTree()) != 0)
while ((tree = it.GetNextTree()) != nullptr)
{
const vtkIdType nl = tree->GetNumberOfLevels();
if (nl > nLevels)
......
......@@ -29,7 +29,7 @@ vtkHyperTreeGridNonOrientedCursor* vtkHyperTreeGridNonOrientedCursor::Clone()
{
vtkHyperTreeGridNonOrientedCursor* clone = this->NewInstance();
assert( "post: clone_exists" &&
clone != 0 );
clone != nullptr );
// Copy
clone->Grid = this->Grid;
clone->Tree = this->Tree;
......
......@@ -32,7 +32,7 @@ vtkHyperTreeGridNonOrientedGeometryCursor* vtkHyperTreeGridNonOrientedGeometryCu
{
vtkHyperTreeGridNonOrientedGeometryCursor* clone = this->NewInstance();
assert( "post: clone_exists" &&
clone != 0 );
clone != nullptr );
// Copy
clone->Grid = this->Grid;
clone->Tree = this->Tree;
......
......@@ -33,7 +33,7 @@ PURPOSE. See the above copyright Nonice for more information.
vtkHyperTreeGridNonOrientedSuperCursor* vtkHyperTreeGridNonOrientedSuperCursor::Clone()
{
vtkHyperTreeGridNonOrientedSuperCursor* clone = this->NewInstance();
assert("post: clone_exists" && clone != 0);
assert("post: clone_exists" && clone != nullptr);
// Copy
clone->Grid = this->Grid;
clone->CentralCursor->Initialize(this->CentralCursor.Get());
......
......@@ -30,7 +30,7 @@ PURPOSE. See the above copyright Nonice for more information.
vtkHyperTreeGridNonOrientedSuperCursorLight* vtkHyperTreeGridNonOrientedSuperCursorLight::Clone()
{
vtkHyperTreeGridNonOrientedSuperCursorLight* clone = this->NewInstance();
assert("post: clone_exists" && clone != 0);
assert("post: clone_exists" && clone != nullptr);
// Copy
clone->Grid = this->Grid;
clone->CentralCursor->Initialize(this->CentralCursor.Get());
......
......@@ -29,7 +29,7 @@ vtkHyperTreeGridOrientedCursor* vtkHyperTreeGridOrientedCursor::Clone()
{
vtkHyperTreeGridOrientedCursor* clone = this->NewInstance();
assert( "post: clone_exists" &&
clone != 0 );
clone != nullptr );
// Copy
clone->Grid = this->Grid;
clone->Tree = this->Tree;
......
......@@ -29,7 +29,7 @@ vtkHyperTreeGridOrientedGeometryCursor* vtkHyperTreeGridOrientedGeometryCursor::
{
vtkHyperTreeGridOrientedGeometryCursor* clone = this->NewInstance();
assert( "post: clone_exists" &&
clone != 0 );
clone != nullptr );
// Copy
clone->Grid = this->Grid;
clone->Tree = this->Tree;
......
......@@ -24,7 +24,7 @@ namespace hypertreegrid {
template < class T >
bool HasTree( const T & e )
{
return e.GetTree() != 0;
return e.GetTree() != nullptr;
}
}// namespace hypertreegrid
......
......@@ -27,7 +27,7 @@ vtkStandardNewMacro(vtkUniformHyperTreeGrid);
// Helper macros to quickly fetch a HT at a given index or iterator
#define GetHyperTreeFromOtherMacro(_obj_, _index_) \
(static_cast<vtkHyperTree*>( \
_obj_->HyperTrees.find(_index_) != _obj_->HyperTrees.end() ? _obj_->HyperTrees[_index_] : 0))
_obj_->HyperTrees.find(_index_) != _obj_->HyperTrees.end() ? _obj_->HyperTrees[_index_] : nullptr))
#define GetHyperTreeFromThisMacro(_index_) GetHyperTreeFromOtherMacro(this, _index_)
//-----------------------------------------------------------------------------
......
......@@ -36,7 +36,7 @@ public:
/**
* The whole extent of the output has to be set explicitly.
*/
void SetOutputWholeExtent(int extent[6], vtkInformation* outInfo = 0);
void SetOutputWholeExtent(int extent[6], vtkInformation* outInfo = nullptr);
void SetOutputWholeExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
void GetOutputWholeExtent(int extent[6]);
int* GetOutputWholeExtent() { return this->OutputWholeExtent; }
......
......@@ -28,18 +28,18 @@ vtkExplicitStructuredGridSurfaceFilter::vtkExplicitStructuredGridSurfaceFilter()
this->PassThroughCellIds = 0;
this->PassThroughPointIds = 0;
this->OriginalCellIdsName = 0;
this->OriginalCellIdsName = nullptr;
this->SetOriginalCellIdsName("vtkOriginalCellIds");
this->OriginalPointIdsName = 0;
this->OriginalPointIdsName = nullptr;
this->SetOriginalPointIdsName("vtkOriginalPointIds");
}
//----------------------------------------------------------------------------
vtkExplicitStructuredGridSurfaceFilter::~vtkExplicitStructuredGridSurfaceFilter()
{
this->SetOriginalCellIdsName(0);
this->SetOriginalPointIdsName(0);
this->SetOriginalCellIdsName(nullptr);
this->SetOriginalPointIdsName(nullptr);
}
// ----------------------------------------------------------------------------
......@@ -130,7 +130,7 @@ int vtkExplicitStructuredGridSurfaceFilter::ExtractSurface(
}
vtkNew<vtkIdList> cellIds;
vtkUnsignedCharArray* connectivityFlags = 0;
vtkUnsignedCharArray* connectivityFlags = nullptr;
char* facesConnectivityFlagsArrayName = input->GetFacesConnectivityFlagsArrayName();
if (facesConnectivityFlagsArrayName)
......
......@@ -362,7 +362,7 @@ void vtkAdaptiveDataSetSurfaceFilter::ProcessTrees(vtkHyperTreeGrid* input, vtkP
}
// Retrieve material mask
this->Mask = input->HasMask() ? input->GetMask() : 0;
this->Mask = input->HasMask() ? input->GetMask() : nullptr;
//
vtkUnsignedCharArray* ghost = nullptr; // DDM input->GetPointGhostArray();
......@@ -440,9 +440,9 @@ void vtkAdaptiveDataSetSurfaceFilter::ProcessTrees(vtkHyperTreeGrid* input, vtkP
<< this->Cells->GetNumberOfConnectivityEntries() << std::endl;
this->Points->Delete();
this->Points = NULL;
this->Points = nullptr;
this->Cells->Delete();
this->Cells = NULL;
this->Cells = nullptr;
if (this->Locator)
{
......
......@@ -344,7 +344,7 @@ int vtkHyperTreeGridAxisClip::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObjec
this->CurrentId = 0;
// Retrieve material mask
this->InMask = input->HasMask() ? input->GetMask() : 0;
this->InMask = input->HasMask() ? input->GetMask() : nullptr;
// Storage for Cartesian indices
unsigned int cart[3];
......
......@@ -157,7 +157,7 @@ int vtkHyperTreeGridAxisCut::ProcessTrees( vtkHyperTreeGrid* input,
}
// Retrieve material mask
this->InMask = this->OutMask ? input->GetMask() : 0;
this->InMask = this->OutMask ? input->GetMask() : nullptr;
// Storage for root cell Cartesian coordinates
unsigned int i,j,k;
......
......@@ -142,7 +142,7 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees(vtkHyperTreeGrid* input, vtkDat
}
else
{
vtkDataArray* inCoords = 0;
vtkDataArray* inCoords = nullptr;
unsigned int pmod3 = this->Plane % 3;
if (!pmod3)
{
......
......@@ -160,7 +160,7 @@ void vtkHyperTreeGridCellCenters::ProcessTrees()
this->Points = vtkPoints::New();
// Retrieve material mask
this->InMask = this->Input->HasMask() ? this->Input->GetMask() : 0;
this->InMask = this->Input->HasMask() ? this->Input->GetMask() : nullptr;
// Iterate over all hyper trees
vtkIdType index;
......
......@@ -288,7 +288,7 @@ int vtkHyperTreeGridContour::ProcessTrees( vtkHyperTreeGrid* input,
this->CurrentId = 0;
// Retrieve material mask
this->InMask = input->HasMask() ? input->GetMask() : 0;
this->InMask = input->HasMask() ? input->GetMask() : nullptr;
// Estimate output size as a multiple of 1024
vtkIdType numCells = input->GetNumberOfVertices();
......
......@@ -33,7 +33,7 @@ vtkStandardNewMacro(vtkHyperTreeGridEvaluateCoarse);
vtkHyperTreeGridEvaluateCoarse::vtkHyperTreeGridEvaluateCoarse()
{
this->Operator = vtkHyperTreeGridEvaluateCoarse::OPERATOR_DON_T_CHANGE;
this->Mask = 0;
this->Mask = nullptr;
this->Default = 0.;
......@@ -83,7 +83,7 @@ int vtkHyperTreeGridEvaluateCoarse::ProcessTrees( vtkHyperTreeGrid* input,
return 1;
}
this->Mask = output->HasMask() ? output->GetMask() : 0;
this->Mask = output->HasMask() ? output->GetMask() : nullptr;
this->BranchFactor = output->GetBranchFactor();
this->Dimension = output->GetDimension();
......
......@@ -383,12 +383,12 @@ int vtkHyperTreeGridGeometry::ProcessTrees( vtkHyperTreeGrid* input,
if ( this->Points )
{
this->Points->Delete();
this->Points = NULL;
this->Points = nullptr;
}
if ( this->Cells )
{
this->Cells->Delete();
this->Cells = NULL;
this->Cells = nullptr;
}
if ( this->Locator )
......@@ -517,7 +517,7 @@ void vtkHyperTreeGridGeometry::RecursivelyProcessTree3D(
//FR Parce que le curseur est un super curseur
bool pureMask = false;
if ( this->Mask != 0 )
if ( this->Mask != nullptr )
{
// JB Question : que fait le PureMaterialMask quand un masque est mis sur un coarse et pas toutes les filles
pureMask = this->PureMask->GetValue( cursor->GetGlobalNodeIndex() ) != 0 ;
......
......@@ -146,7 +146,7 @@ void vtkCollisionDetectionFilter::SetInputData(int idx, vtkPolyData *input)
vtkSmartPointer<vtkTrivialProducer> inputProducer =
vtkSmartPointer<vtkTrivialProducer>::New();
inputProducer->SetOutput(input);
this->SetNthInputConnection(idx, 0, input ? inputProducer->GetOutputPort() : 0);
this->SetNthInputConnection(idx, 0, input ? inputProducer->GetOutputPort() : nullptr);
}
//----------------------------------------------------------------------------
......
......@@ -5389,7 +5389,7 @@ vtkMTimeType vtkExodusIIReader::GetMetadataMTime()
} \
else \
{ \
this->propName = 0; \
this->propName = nullptr; \
}
void vtkExodusIIReader::SetFileName( const char* fname )
......
......@@ -144,12 +144,12 @@ vtkPExodusIIReader::vtkPExodusIIReader()
this->ProcRank = 0;
this->ProcSize = 1;
// NB. SetController will initialize ProcSize and ProcRank
this->Controller = 0;
this->Controller = nullptr;
this->SetController( vtkMultiProcessController::GetGlobalController() );
this->FilePattern = 0;
this->CurrentFilePattern = 0;
this->FilePrefix = 0;
this->CurrentFilePrefix = 0;
this->FilePattern = nullptr;
this->CurrentFilePattern = nullptr;
this->FilePrefix = nullptr;
this->CurrentFilePrefix = nullptr;
this->FileRange[0] = -1;
this->FileRange[1] = -1;
this->CurrentFileRange[0] = 0;
......@@ -166,9 +166,9 @@ vtkPExodusIIReader::vtkPExodusIIReader()
//----------------------------------------------------------------------------
vtkPExodusIIReader::~vtkPExodusIIReader()
{
this->SetController( 0 );
this->SetFilePattern( 0 );
this->SetFilePrefix( 0 );
this->SetController( nullptr );
this->SetFilePattern( nullptr );
this->SetFilePrefix( nullptr );
// If we've allocated filenames then delete them
if ( this->FileNames )
......@@ -1148,7 +1148,7 @@ static void BroadcastBlockSetInfo( vtkMultiProcessController* controller,
{
bsinfo->CachedConnectivity->Delete();
}
bsinfo->CachedConnectivity = 0;
bsinfo->CachedConnectivity = nullptr;
bsinfo->PointMap.clear();
bsinfo->ReversePointMap.clear();
controller->Broadcast( &len, 1, 0 );
......@@ -1522,8 +1522,8 @@ void vtkPExodusIIReader::Broadcast( vtkMultiProcessController* ctrl )
delete [] this->FilePrefix;
//this->SetFilePattern( BroadcastRecvString( ctrl, tmp ) ? &tmp[0] : 0 ); // XXX Bad set
//this->SetFilePrefix( BroadcastRecvString( ctrl, tmp ) ? &tmp[0] : 0 ); // XXX Bad set
this->FilePattern = BroadcastRecvString( ctrl, tmp ) ? vtksys::SystemTools::DuplicateString( &tmp[0] ) : 0;
this->FilePrefix = BroadcastRecvString( ctrl, tmp ) ? vtksys::SystemTools::DuplicateString( &tmp[0] ) : 0;
this->FilePattern = BroadcastRecvString( ctrl, tmp ) ? vtksys::SystemTools::DuplicateString( &tmp[0] ) : nullptr;
this->FilePrefix = BroadcastRecvString( ctrl, tmp ) ? vtksys::SystemTools::DuplicateString( &tmp[0] ) : nullptr;
}
ctrl->Broadcast( this->FileRange, 2, 0 );
ctrl->Broadcast( &this->NumberOfFiles, 1, 0 );
......
......@@ -936,7 +936,7 @@
unsigned short tmp[4];
#define VTKKWRCHelper_InitializeCompositeOneGOTrilin() \
unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
unsigned char *magPtrABCD = nullptr, *magPtrEFGH = nullptr; \
unsigned short mag; \
unsigned int mA=0,mB=0,mC=0,mD=0,mE=0,mF=0,mG=0,mH=0;
......
......@@ -88,7 +88,7 @@ inline bool testNotNull(const T& a, const std::string& msg)
{
std::cout << msg << ": ";
}
if (a != NULL)
if (a != nullptr)
{
if (print)
{
......
......@@ -125,7 +125,7 @@ void DICOMParser::CloseFile()
{
// Deleting the DataFile closes any previously opened file
delete this->DataFile;
this->DataFile = 0;
this->DataFile = nullptr;
}
DICOMParser::~DICOMParser() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment