Commit c13eb865 authored by Hans Johnson's avatar Hans Johnson

COMP: Add nullptr instead of NULL or 0

https://stackoverflow.com/questions/13816385/what-are-the-advantages-of-using-nullptr
C++11 introduces nullptr, it is known as the Null pointer constant and
It improves type safety and resolves ambiguous situations unlike the
existing implementation dependent null pointer constant NULL.

https://msdn.microsoft.com/en-us/library/4ex65770.aspx
The nullptr keyword can be used to test if a pointer or handle reference
is null before the reference is used. Function calls among languages
that use null pointer values for error checking should be interpreted
correctly. You cannot initialize a handle to zero; only nullptr can be
used.
parent 892a3335
......@@ -428,10 +428,10 @@ void vtkDebugLeaks::ClassInitialize()
vtkDebugLeaks::ExitError = 1;
vtkDebugLeaks::Observer = nullptr;
#else
vtkDebugLeaks::MemoryTable = 0;
vtkDebugLeaks::CriticalSection = 0;
vtkDebugLeaks::MemoryTable = nullptr;
vtkDebugLeaks::CriticalSection = nullptr;
vtkDebugLeaks::ExitError = 0;
vtkDebugLeaks::Observer = 0;
vtkDebugLeaks::Observer = nullptr;
#endif
}
......
......@@ -103,7 +103,7 @@ public:
// Call superclass
vtkGeometricCursor<N>* clone
= static_cast<vtkGeometricCursor<N>*>( this->Superclass::Clone() );
assert( "post: clone_exists" && clone != 0 );
assert( "post: clone_exists" && clone != nullptr );
// Copy iVars specific to this subclass
clone->Grid = this->Grid;
......@@ -287,7 +287,7 @@ protected:
vtkGeometricCursor<N>()
{
// No grid by default
this->Grid = 0;
this->Grid = nullptr;
// Default origin
this->Origin[0] = 0.;
......@@ -358,7 +358,7 @@ public:
// Call superclass
vtkSuperCursor<N>* clone
= static_cast<vtkSuperCursor<N>*>( this->Superclass::Clone() );
assert( "post: clone_exists" && clone != 0 );
assert( "post: clone_exists" && clone != nullptr );
// Return clone
return clone;
......@@ -652,12 +652,12 @@ public:
if ( this->Cursors[i] )
{
this->Cursors[i]->Delete();
this->Cursors[i] = 0;
this->Cursors[i] = nullptr;
}
}
delete [] this->Cursors;
this->Cursors = 0;
this->Cursors = nullptr;
} // if ( this->Cursors )
}
......@@ -667,7 +667,7 @@ public:
// Call superclass
vtkVonNeumannSuperCursor<N>* clone
= static_cast<vtkVonNeumannSuperCursor<N>*>( this->Superclass::Clone() );
assert( "post: clone_exists" && clone != 0 );
assert( "post: clone_exists" && clone != nullptr );
// Copy iVars specific to this subclass
for ( unsigned int i = 0; i < this->NumberOfCursors; ++ i )
......@@ -1120,12 +1120,12 @@ public:
if ( this->Cursors[i] )
{
this->Cursors[i]->Delete();
this->Cursors[i] = 0;
this->Cursors[i] = nullptr;
}
}
delete [] this->Cursors;
this->Cursors = 0;
this->Cursors = nullptr;
} // if ( this->Cursors )
}
......@@ -1135,7 +1135,7 @@ public:
// Call superclass
vtkMooreSuperCursor<N>* clone
= static_cast<vtkMooreSuperCursor<N>*>( this->Superclass::Clone() );
assert( "post: clone_exists" && clone != 0 );
assert( "post: clone_exists" && clone != nullptr );
// Copy iVars specific to this subclass
for ( unsigned int i = 0; i < this->NumberOfCursors; ++ i )
......@@ -1489,19 +1489,19 @@ vtkHyperTreeGrid::~vtkHyperTreeGrid()
if ( this->Points )
{
this->Points->Delete();
this->Points = 0;
this->Points = nullptr;
}
if ( this->Connectivity )
{
this->Connectivity->Delete();
this->Connectivity = 0;
this->Connectivity = nullptr;
}
if ( this->Links )
{
this->Links->Delete();
this->Links = 0;
this->Links = nullptr;
}
if ( this->MaterialMask )
......@@ -2933,7 +2933,7 @@ vtkIdType vtkHyperTreeGrid::FindCell( double x[3],
double pcoords[3],
double* weights )
{
return this->FindCell( x, cell, 0, cellId, tol2, subId, pcoords, weights );
return this->FindCell( x, cell, nullptr, cellId, tol2, subId, pcoords, weights );
}
//----------------------------------------------------------------------------
......@@ -3198,7 +3198,7 @@ void vtkHyperTreeGrid::ComputeDualGrid()
} // p
// Retrieve material mask
vtkBitArray* mask = this->HasMaterialMask() ? this->GetMaterialMask() : 0;
vtkBitArray* mask = this->HasMaterialMask() ? this->GetMaterialMask() : nullptr;
// Iterate over all hyper trees
vtkIdType index;
......@@ -3276,7 +3276,7 @@ void vtkHyperTreeGrid::TraverseDualRecursively( vtkHyperTreeGridCursor* cursor )
// Clean up
childCursor->Delete();
childCursor = 0;
childCursor = nullptr;
} // child
} // else
}
......@@ -3333,7 +3333,7 @@ void vtkHyperTreeGrid::TraverseDualRecursively( vtkHyperTreeGridCursor* cursor,
// Clean up
childCursor->Delete();
childCursor = 0;
childCursor = nullptr;
} // child
} // else
}
......
......@@ -29,10 +29,10 @@ vtkCxxSetObjectMacro(vtkHyperTreeGridCursor,Tree,vtkHyperTree);
vtkHyperTreeGridCursor::vtkHyperTreeGridCursor()
{
// No grid is given by default
this->Grid = 0;
this->Grid = nullptr;
// No tree is given by default
this->Tree = 0;
this->Tree = nullptr;
// Default cursor level
this->Level = 0;
......@@ -53,7 +53,7 @@ vtkHyperTreeGridCursor::~vtkHyperTreeGridCursor()
vtkHyperTreeGridCursor* vtkHyperTreeGridCursor::Clone()
{
vtkHyperTreeGridCursor* clone = this->NewInstance();
assert( "post: clone_exists" && clone != 0 );
assert( "post: clone_exists" && clone != nullptr );
// Copy iVars
clone->Grid = this->Grid;
......
......@@ -170,13 +170,13 @@ public:
* Compute the origin of the cursor.
* NB: The basic hyper tree grid cursor does not have an origin.
*/
virtual double* GetOrigin() { return 0; }
virtual double* GetOrigin() { return nullptr; }
/**
* Compute the size of the cursor.
* NB: The basic hyper tree grid cursor does not have a size.
*/
virtual double* GetSize() { return 0; }
virtual double* GetSize() { return nullptr; }
/**
* Compute the bounds of the cursor.
......@@ -204,7 +204,7 @@ public:
* NB: Only super cursors keep track of neighborhoods.
*/
virtual vtkHyperTreeGridCursor* GetCursor( unsigned int )
{ return 0; }
{ return nullptr; }
/**
* Return the list of cursors pointing to the leaves touching a
......
......@@ -553,7 +553,7 @@ int vtkLagrangeTetra::EvaluatePosition(double* x, double* closestPoint,
pcoordsMin[2]*(minBIndices[3][i] - minBIndices[0][i]))/order;
}
if(closestPoint!=0)
if(closestPoint!=nullptr)
{
// Compute both closestPoint and weights
this->EvaluateLocation(subId,pcoords,closestPoint,weights);
......
......@@ -325,7 +325,7 @@ int vtkLagrangeTriangle::EvaluatePosition(double* x, double* closestPoint,
: 0.);
}
if(closestPoint!=0)
if(closestPoint!=nullptr)
{
// Compute both closestPoint and weights
this->EvaluateLocation(subId,pcoords,closestPoint,weights);
......
......@@ -47,7 +47,7 @@ public:
int GetNumberOfEdges() override { return 3; }
int GetNumberOfFaces() override { return 0; }
vtkCell *GetEdge(int edgeId) override;
vtkCell *GetFace(int) override { return 0; }
vtkCell *GetFace(int) override { return nullptr; }
void Initialize() override;
......
......@@ -47,7 +47,7 @@ namespace AMRCommon {
// Writes a uniform grid as a structure grid
void WriteUniformGrid( vtkUniformGrid *g, const std::string &prefix )
{
assert( "pre: Uniform grid (g) is NULL!" && (g != NULL) );
assert( "pre: Uniform grid (g) is NULL!" && (g != nullptr) );
vtkXMLImageDataWriter *imgWriter = vtkXMLImageDataWriter::New();
......@@ -66,7 +66,7 @@ void WriteUniformGrid( vtkUniformGrid *g, const std::string &prefix )
void WriteAMRData( vtkOverlappingAMR *amrData, const std::string &prefix )
{
// Sanity check
assert( "pre: AMR dataset is NULL!" && (amrData != NULL) );
assert( "pre: AMR dataset is NULL!" && (amrData != nullptr) );
vtkCompositeDataWriter *writer = vtkCompositeDataWriter::New();
......@@ -88,7 +88,7 @@ vtkHierarchicalBoxDataSet* ReadAMRData( const std::string &file )
vtkXMLHierarchicalBoxDataReader *myAMRReader=
vtkXMLHierarchicalBoxDataReader::New();
assert( "pre: AMR Reader is NULL!" && (myAMRReader != NULL) );
assert( "pre: AMR Reader is NULL!" && (myAMRReader != nullptr) );
std::ostringstream oss;
oss.str("");
......@@ -103,7 +103,7 @@ vtkHierarchicalBoxDataSet* ReadAMRData( const std::string &file )
vtkHierarchicalBoxDataSet *amrData =
vtkHierarchicalBoxDataSet::SafeDownCast( myAMRReader->GetOutput() );
assert( "post: AMR data read is NULL!" && (amrData != NULL) );
assert( "post: AMR data read is NULL!" && (amrData != nullptr) );
return( amrData );
}
......@@ -113,7 +113,7 @@ vtkHierarchicalBoxDataSet* ReadAMRData( const std::string &file )
void WriteMultiBlockData( vtkMultiBlockDataSet *mbds, const std::string &prefix )
{
// Sanity check
assert( "pre: Multi-block dataset is NULL" && (mbds != NULL) );
assert( "pre: Multi-block dataset is NULL" && (mbds != nullptr) );
vtkXMLMultiBlockDataWriter *writer = vtkXMLMultiBlockDataWriter::New();
std::ostringstream oss;
......@@ -143,13 +143,13 @@ vtkUniformGrid* GetGrid( double* origin,double* h,int* ndim )
// the given grid. The cell center is stored in the supplied buffer c.
void ComputeCellCenter( vtkUniformGrid *grid, const int cellIdx, double c[3] )
{
assert( "pre: grid != NULL" && (grid != NULL) );
assert( "pre: Null cell center buffer" && (c != NULL) );
assert( "pre: grid != NULL" && (grid != nullptr) );
assert( "pre: Null cell center buffer" && (c != nullptr) );
assert( "pre: cellIdx in bounds" &&
(cellIdx >= 0) && (cellIdx < grid->GetNumberOfCells() ) );
vtkCell *myCell = grid->GetCell( cellIdx );
assert( "post: cell is NULL" && (myCell != NULL) );
assert( "post: cell is NULL" && (myCell != nullptr) );
double pCenter[3];
double *weights = new double[ myCell->GetNumberOfPoints() ];
......
......@@ -120,7 +120,7 @@ vtkGraphItem::vtkGraphItem()
vtkGraphItem::~vtkGraphItem()
{
delete this->Impl;
this->SetGraph(0);
this->SetGraph(nullptr);
}
//-----------------------------------------------------------------------------
......
......@@ -1754,7 +1754,7 @@ int IMAGE_BENCHMARK_MAIN(int argc, char *argv[])
const char **filters =
(filterName.empty() ? DefaultFilters : requestedFilters);
for (int k = 0; filters[k] != 0; k++)
for (int k = 0; filters[k] != nullptr; k++)
{
if (!RunBenchmark(filters[k], sourceName, size, scalarType,
splitMode, useSMP, bytesPerPiece, minPieceSize,
......
......@@ -49,8 +49,8 @@ public:
vtkImageInteractionCallback() {
this->Slicing = 0;
this->ImageReslice = 0;
this->Interactor = 0; };
this->ImageReslice = nullptr;
this->Interactor = nullptr; };
void SetImageReslice(vtkImageReslice *reslice) {
this->ImageReslice = reslice; };
......
......@@ -156,7 +156,7 @@ static vtkSmartPointer<vtkDataSet> ReadFinancialData(const char* filename, const
int i, npts;
char tag[80];
if ( (file = fopen(filename,"r")) == 0 )
if ( (file = fopen(filename,"r")) == nullptr )
{
std::cerr << "ERROR: Can't open file: " << filename << std::endl;
return nullptr;
......
......@@ -144,7 +144,7 @@ int main(int argc, char* argv[])
iren->Start();
// Cleanup
vtkAlgorithm::SetDefaultExecutivePrototype(0);
vtkAlgorithm::SetDefaultExecutivePrototype(nullptr);
of->Delete();
geom1->Delete();
geoMapper->Delete();
......
......@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
int clip = 0;
double reductionFactor = 1.0;
double frameRate = 10.0;
char *fileName=0;
char *fileName=nullptr;
int fileType=0;
bool independentComponents=true;
......@@ -236,8 +236,8 @@ int main(int argc, char *argv[])
iren->GetInteractorStyle()->SetDefaultRenderer(renderer);
// Read the data
vtkAlgorithm *reader=0;
vtkImageData *input=0;
vtkAlgorithm *reader=nullptr;
vtkImageData *input=nullptr;
if(dirname)
{
vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();
......
......@@ -57,7 +57,7 @@ public:
protected:
vtkBoxWidgetCallback()
{ this->Mapper = 0; }
{ this->Mapper = nullptr; }
vtkSmartVolumeMapper *Mapper;
};
......@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
int clip = 0;
double reductionFactor = 1.0;
double frameRate = 10.0;
char *fileName=0;
char *fileName=nullptr;
int fileType=0;
bool independentComponents=true;
......@@ -263,8 +263,8 @@ int main(int argc, char *argv[])
iren->GetInteractorStyle()->SetDefaultRenderer(renderer);
// Read the data
vtkAlgorithm *reader=0;
vtkImageData *input=0;
vtkAlgorithm *reader=nullptr;
vtkImageData *input=nullptr;
if(dirname)
{
vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();
......
......@@ -39,7 +39,7 @@ public:
this->SphereSource->SetPhiResolution(value/2);
this->SphereSource->SetThetaResolution(value);
}
vtkSliderCallback():SphereSource(0) {}
vtkSliderCallback():SphereSource(nullptr) {}
vtkSphereSource *SphereSource;
};
......
......@@ -35,7 +35,7 @@ public:
this->SphereSource->SetPhiResolution(value/2);
this->SphereSource->SetThetaResolution(value);
}
vtkSliderCallback():SphereSource(0) {}
vtkSliderCallback():SphereSource(nullptr) {}
vtkSphereSource *SphereSource;
};
......
......@@ -252,7 +252,7 @@ void vtkAdaptiveDataSetSurfaceFilter::ProcessTrees( vtkHyperTreeGrid* input,
this->Cells = vtkCellArray::New();
// Retrieve material mask
vtkBitArray* mask = input->HasMaterialMask() ? input->GetMaterialMask() : 0;
vtkBitArray* mask = input->HasMaterialMask() ? input->GetMaterialMask() : nullptr;
//
vtkUnsignedCharArray* ghost = input->GetPointGhostArray();
......
......@@ -348,7 +348,7 @@ int vtkHyperTreeGridAxisClip::ProcessTrees( vtkHyperTreeGrid* input,
// Retrieve material mask
vtkBitArray* mask
= input->HasMaterialMask() ? input->GetMaterialMask() : 0;
= input->HasMaterialMask() ? input->GetMaterialMask() : nullptr;
// Storage for Cartesian indices
unsigned int cart[3];
......@@ -540,7 +540,7 @@ void vtkHyperTreeGridAxisClip::RecursivelyProcessTree( vtkHyperTreeGridCursor* i
// Clean up
childCursor->Delete();
childCursor = 0;
childCursor = nullptr;
} // inChild
} // if ( ! cursor->IsLeaf() && ! clipped )
else if ( ! clipped && mask && mask->GetValue( inId ) )
......
......@@ -162,7 +162,7 @@ int vtkHyperTreeGridAxisCut::ProcessTrees( vtkHyperTreeGrid* input,
// Retrieve material mask
vtkBitArray* mask
= this->MaterialMask ? input->GetMaterialMask() : 0;
= this->MaterialMask ? input->GetMaterialMask() : nullptr;
// Storage for root cell Cartesian coordinates
unsigned int i,j,k;
......
......@@ -79,7 +79,7 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input,
// Retrieve reflection direction and coordinates to be reflected
unsigned int direction = 0;
vtkDataArray* inCoords = 0;
vtkDataArray* inCoords = nullptr;
unsigned int pmod3 = this->Plane % 3;
if ( ! pmod3 )
{
......@@ -98,8 +98,8 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input,
}
// Retrieve interface arrays if available
vtkDataArray* inNormals = 0;
vtkDataArray* inIntercepts = 0;
vtkDataArray* inNormals = nullptr;
vtkDataArray* inIntercepts = nullptr;
bool hasInterface = input->GetHasInterface() ? true : false;
if ( hasInterface )
{
......
......@@ -286,7 +286,7 @@ int vtkHyperTreeGridContour::ProcessTrees( vtkHyperTreeGrid* input,
// Retrieve material mask
vtkBitArray* mask
= input->HasMaterialMask() ? input->GetMaterialMask() : 0;
= input->HasMaterialMask() ? input->GetMaterialMask() : nullptr;
// Estimate output size as a multiple of 1024
vtkIdType numCells = input->GetNumberOfPoints();
......
......@@ -111,7 +111,7 @@ int vtkHyperTreeGridDepthLimiter::ProcessTrees( vtkHyperTreeGrid* input,
// Retrieve material mask
vtkBitArray* mask
= this->MaterialMask ? input->GetMaterialMask() : 0;
= this->MaterialMask ? input->GetMaterialMask() : nullptr;
// Initialize output trees
output->GenerateTrees();
......
......@@ -198,7 +198,7 @@ int vtkHyperTreeGridPlaneCutter::ProcessTrees( vtkHyperTreeGrid* input,
this->InData = input->GetPointData();
// Retrieve material mask
vtkBitArray* mask = input->HasMaterialMask() ? input->GetMaterialMask() : 0;
vtkBitArray* mask = input->HasMaterialMask() ? input->GetMaterialMask() : nullptr;
// Compute cut on dual or primal input depending on specification
if ( this->Dual )
......
......@@ -551,7 +551,7 @@ int vtkHyperTreeGridSource::RequestData( vtkInformation*,
}
// Iterate over constituting hypertrees
if ( ! this->ProcessTrees( 0, outputDO ) )
if ( ! this->ProcessTrees( nullptr, outputDO ) )
{
return 0;
}
......
......@@ -44,7 +44,7 @@ class VTKGUISUPPORTQT_EXPORT QFilterTreeProxyModel : public QSortFilterProxyMode
public:
QFilterTreeProxyModel(QObject* p = 0);
QFilterTreeProxyModel(QObject* p = nullptr);
~QFilterTreeProxyModel() override;
// Description:
......
......@@ -198,7 +198,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
point.pos().y() * this->DevicePixelRatio,
(e2->modifiers() & Qt::ControlModifier) > 0 ? 1 : 0,
(e2->modifiers() & Qt::ShiftModifier ) > 0 ? 1 : 0,
0,0,0, point.id());
0,0,nullptr, point.id());
}
foreach (const QTouchEvent::TouchPoint& point, e2->touchPoints())
{
......@@ -377,8 +377,8 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
// ***** keysym stuff below *****
static const char *AsciiToKeySymTable[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, "Tab", 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "Tab", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
"space", "exclam", "quotedbl", "numbersign",
"dollar", "percent", "ampersand", "quoteright",
"parenleft", "parenright", "asterisk", "plus",
......@@ -394,14 +394,14 @@ static const char *AsciiToKeySymTable[] = {
"h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w",
"x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
const char* ascii_to_key_sym(int i)
{
......@@ -409,7 +409,7 @@ const char* ascii_to_key_sym(int i)
{
return AsciiToKeySymTable[i];
}
return 0;
return nullptr;
}
#define QVTK_HANDLE(x,y) \
......@@ -424,7 +424,7 @@ const char* ascii_to_key_sym(int i)
const char* qt_key_to_key_sym(Qt::Key i, Qt::KeyboardModifiers modifiers)
{
const char* ret = 0;
const char* ret = nullptr;
switch(i)
{
// Cancel
......
......@@ -51,7 +51,7 @@ QTestApp::QTestApp(int _argc, char* _argv[])
QTestApp::~QTestApp()
{
delete App;
qInstallMessageHandler(0);
qInstallMessageHandler(nullptr);
}
int QTestApp::exec()
......
......@@ -54,7 +54,7 @@ int TestQtTreeModelAdapter(int, char*[])
}
tree->GetVertexData()->AddArray(intArr);
tree->GetVertexData()->AddArray(doubleArr);
vtkQtTreeModelAdapter adapter(0, tree);
vtkQtTreeModelAdapter adapter(nullptr, tree);
if (adapter.rowCount(QModelIndex()) != 1)
{
cerr << "ERROR: Wrong number of rows." << endl;
......
......@@ -83,7 +83,7 @@ class VTKGUISUPPORTQT_EXPORT vtkEventQtSlotConnect : public vtkObject
*/
virtual void Disconnect(
vtkObject* vtk_obj=nullptr, unsigned long event=vtkCommand::NoEvent,
const QObject* qt_obj=nullptr, const char* slot = 0, void* client_data=nullptr);
const QObject* qt_obj=nullptr, const char* slot = nullptr, void* client_data=nullptr);
/**
* Allow to query vtkEventQtSlotConnect to know if some Connect() have been
......
......@@ -51,7 +51,7 @@ vtkQtAnnotationLayersModelAdapter::vtkQtAnnotationLayersModelAdapter(vtkAnnotati
{
if (this->Annotations != nullptr)
{
this->Annotations->Register(0);
this->Annotations->Register(nullptr);
}
}
......@@ -124,7 +124,7 @@ void vtkQtAnnotationLayersModelAdapter::setAnnotationLayers(vtkAnnotationLayers*
this->Annotations = t;
if (this->Annotations != nullptr)
{
this->Annotations->Register(0);
this->Annotations->Register(nullptr);
// When setting a table, update the QHash tables for column mapping.
// If SplitMultiComponentColumns is disabled, this call will just clear
......@@ -224,7 +224,7 @@ vtkSelection* vtkQtAnnotationLayersModelAdapter::QModelIndexListToVTKIndexSelect
}
return IndexSelection;
*/
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
......
......@@ -44,8 +44,8 @@ class VTKGUISUPPORTQT_EXPORT vtkQtAnnotationLayersModelAdapter : public vtkQtAbs
Q_OBJECT
public:
vtkQtAnnotationLayersModelAdapter(QObject *parent = 0);
vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = 0);
vtkQtAnnotationLayersModelAdapter(QObject *parent = nullptr);
vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = nullptr);
~vtkQtAnnotationLayersModelAdapter() override;
//@{
......
......@@ -38,9 +38,9 @@ vtkQtConnection::vtkQtConnection(vtkEventQtSlotConnect* owner)
this->Callback = vtkCallbackCommand::New();
this->Callback->SetCallback(vtkQtConnection::DoCallback);
this->Callback->SetClientData(this);
this->VTKObject = 0;
this->QtObject = 0;
this->ClientData = 0;
this->VTKObject = nullptr;
this->QtObject = nullptr;
this->ClientData = nullptr;
this->VTKEvent = vtkCommand::NoEvent;
}
......
......@@ -33,7 +33,7 @@ public:
~qObserver() override
{
vtkDebugLeaks::SetDebugLeaksObserver(0);
vtkDebugLeaks::SetDebugLeaksObserver(nullptr);
}
void ConstructingObject(vtkObjectBase* object) override
......@@ -106,7 +106,7 @@ vtkQtDebugLeaksModel::~vtkQtDebugLeaksModel()
void vtkQtDebugLeaksModel::onAboutToQuit()
{
delete this->Observer;
this->Observer = 0;
this->Observer = nullptr;
}