From 0f26e689bb4d7477b6af1ad415f8ff2fe9c0c7c3 Mon Sep 17 00:00:00 2001 From: Manuel Grizonnet <manuel.grizonnet@cnes.fr> Date: Thu, 16 Jun 2016 11:54:52 +0200 Subject: [PATCH] STYLE: Use ITK_NULLPTR to utilize c++11 features Where available, use c++11 features to identify potential nullptr usage errors. python run-clang-tidy.py -clang-tidy-binary ~/software/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang-tidy -checks=-*,modernize-use-nullptr -header-filter=/home/grizonnetm/projets/otb/src/OTB/Modules/.*/.*/include/.* -j8 -fix -p ~/projets/otb/bin/release/OTB-clang3.8/ ~/projets/otb/src/OTB/Modules/*/*/src/*.cxx ~/projets/otb/src/OTB/Modules/*/*/app/*.cxx ~/projets/otb/src/OTB/Examples/*/*.cxx ~/projets/otb/src/OTB/Modules/*/*/test/*.cxx > ~/temporary/run-clang-tidy-nullptr-log.txt find . -type f -print -name "*.h" -o -name "*.txx" -o -name "*.cxx" |xargs perl -pi -e 's/nullptr/ITK_NULLPTR/g' --- CMake/otbTestNullPtr.cpp | 2 +- .../GeometriesChangeSpatialReference.cxx | 6 +- Examples/Filtering/GeometriesFilter.cxx | 6 +- Examples/IO/OGRWrappersExample.cxx | 2 +- .../Learning/SEMModelEstimatorExample.cxx | 4 +- Examples/Learning/SOMExample.cxx | 2 +- .../Projections/OrthoRectificationExample.cxx | 4 +- Examples/Projections/SensorModelExample.cxx | 4 +- .../LAIAndPROSAILToSensorResponse.cxx | 6 +- Examples/Tutorials/OrthoFusion.cxx | 4 +- .../CurlAdapters/src/otbCurlHelper.cxx | 2 +- .../include/otbOGRDataSourceWrapper.h | 8 +- .../GdalAdapters/include/otbOGRHelpers.h | 4 +- .../GdalAdapters/include/otbOGRLayerWrapper.h | 6 +- .../src/otbGeometriesToGeometriesFilter.cxx | 2 +- .../src/otbOGRDataSourceWrapper.cxx | 12 +-- .../GdalAdapters/src/otbOGRLayerWrapper.cxx | 2 +- .../GdalAdapters/src/otbOGRVersionProxy1x.cxx | 2 +- .../test/otbOGRDataSourceWrapperNew.cxx | 16 ++-- .../src/otbDEMConvertAdapter.cxx | 2 +- .../OSSIMAdapters/src/otbDEMHandler.cxx | 8 +- .../OSSIMAdapters/src/otbDateTimeAdapter.cxx | 2 +- .../OSSIMAdapters/src/otbEllipsoidAdapter.cxx | 2 +- .../src/otbGeometricSarSensorModelAdapter.cxx | 6 +- .../OSSIMAdapters/src/otbImageKeywordlist.cxx | 8 +- .../src/otbMapProjectionAdapter.cxx | 20 ++--- .../src/otbPlatformPositionAdapter.cxx | 6 +- .../src/otbSensorModelAdapter.cxx | 50 ++++++------- .../otbComputeOGRLayersFeaturesStatistics.cxx | 4 +- .../app/otbOGRLayerClassifier.cxx | 6 +- .../app/otbTrainOGRLayersClassifier.cxx | 4 +- .../app/otbHomologousPointsExtraction.cxx | 4 +- .../AppImageUtils/app/otbExtractROI.cxx | 2 +- .../app/otbGenerateRPCSensorModel.cxx | 2 +- .../app/otbRefineSensorModel.cxx | 2 +- .../app/otbLSMSSegmentation.cxx | 6 +- .../app/otbLSMSVectorization.cxx | 8 +- .../AppSegmentation/app/otbSegmentation.cxx | 4 +- .../AppStereo/app/otbStereoFramework.cxx | 6 +- .../include/otbCommandLineArgumentParser.h | 4 +- .../src/otbCommandLineArgumentParser.cxx | 2 +- .../otbImageAndVectorImageOperationFilter.txx | 2 +- ...bImageToModulusAndDirectionImageFilter.txx | 4 +- .../Common/include/otbImportImageFilter.txx | 2 +- .../Common/include/otbModelComponentBase.txx | 12 +-- .../Common/src/otbConfigurationManager.cxx | 2 +- .../Core/Common/src/otbFilterWatcherBase.cxx | 2 +- Modules/Core/Common/src/otbSystem.cxx | 4 +- .../Core/Common/src/otbWriterWatcherBase.cxx | 2 +- Modules/Core/Common/test/otbSystemTest.cxx | 4 +- Modules/Core/ImageBase/src/otbImageIOBase.cxx | 2 +- .../test/otbMultiChannelExtractROI.cxx | 4 +- .../test/otbMultiToMonoChannelExtractROI.cxx | 2 +- .../otbBSplineInterpolateImageFunction.txx | 2 +- .../otbGenericInterpolateImageFunction.txx | 14 ++-- .../include/otbAttributesMapLabelObject.h | 2 +- ...tbAttributesMapLabelObjectWithClassLabel.h | 2 +- ...otbImageToLabelMapWithAttributesFilter.txx | 4 +- .../LabelMap/include/otbLabelMapSource.txx | 2 +- .../include/otbLabelMapToSampleListFilter.txx | 2 +- .../include/otbLabelObjectToPolygonFunctor.h | 2 +- .../otbShapeAttributesLabelMapFilter.txx | 2 +- .../ObjectList/include/otbImageListSource.txx | 2 +- .../include/otbImageListToImageFilter.txx | 2 +- .../include/otbImageListToImageListFilter.txx | 2 +- .../otbImageListToSingleImageFilter.txx | 2 +- .../include/otbImageToImageListFilter.txx | 2 +- .../include/otbObjectListSource.txx | 2 +- .../otbObjectListToObjectListFilter.txx | 2 +- .../include/otbImageToPointSetFilter.txx | 2 +- .../PointSet/include/otbPointSetSource.txx | 2 +- .../include/otbPointSetToPointSetFilter.txx | 2 +- .../include/otbLineSpatialObject.h | 4 +- .../include/otbLineSpatialObject.txx | 2 +- .../include/otbSpatialObjectSource.txx | 2 +- .../otbSpatialObjectToImageDrawingFilter.txx | 2 +- .../src/otbPipelineMemoryPrintCalculator.cxx | 2 +- .../include/otbCompositeTransform.txx | 4 +- .../include/otbGenericMapProjection.txx | 2 +- .../include/otbGenericRSTransform.txx | 16 ++-- .../src/otbGeoInformationConversion.cxx | 6 +- .../test/otbCreateProjectionWithOSSIM.cxx | 4 +- .../test/otbCreateProjectionWithOTB.cxx | 4 +- .../Transform/test/otbGenericRSTransform.cxx | 8 +- .../test/otbGenericRSTransformWithSRID.cxx | 4 +- .../VectorDataBase/include/otbDataNode.txx | 2 +- .../include/otbDataNodeImageFunction.txx | 2 +- .../include/otbDataNodeVectorDataFunction.txx | 2 +- .../include/otbVectorDataIOBase.h | 2 +- .../include/otbVectorDataProperties.h | 2 +- .../include/otbVectorDataSource.txx | 2 +- .../src/otbVectorDataKeywordlist.cxx | 4 +- .../Core/VectorDataBase/test/otbPolygon.cxx | 2 +- .../otbLabeledSampleLocalizationGenerator.txx | 2 +- .../include/otbLikelihoodPathListFilter.txx | 2 +- ...bModulusAndDirectionImageToImageFilter.txx | 4 +- .../test/otbAlignImageToPath.cxx | 2 +- .../test/otbBreakAngularPathListFilter.cxx | 2 +- .../test/otbLikelihoodPathListFilter.cxx | 2 +- .../test/otbLinkPathListFilter.cxx | 2 +- .../test/otbRemoveTortuousPathListFilter.cxx | 2 +- .../test/otbSimplifyPathListFilter.cxx | 2 +- ...mageToSIFTKeyPointSetFilterOutputAscii.cxx | 2 +- .../otbHoughTransform2DLinesImageFilter.txx | 2 +- .../otbLineDetectorImageFilterBase.txx | 8 +- .../Edge/include/otbLineSegmentDetector.txx | 2 +- ...PixelSuppressionByDirectionImageFilter.txx | 4 +- .../include/otbSFSTexturesImageFilter.txx | 12 +-- ...otbScalarImageToAdvancedTexturesFilter.txx | 20 ++--- ...ScalarImageToHigherOrderTexturesFilter.txx | 22 +++--- .../otbScalarImageToTexturesFilter.txx | 16 ++-- ...ScalarImageToHigherOrderTexturesFilter.cxx | 10 +-- ...orNeighborhoodJoinHistogramImageFilter.txx | 4 +- ...ckLeiblerSupervizedDistanceImageFilter.txx | 12 +-- ...tivariateAlterationDetectorImageFilter.txx | 4 +- .../otbAngularProjectionBinaryImageFilter.txx | 4 +- .../otbAngularProjectionImageFilter.txx | 2 +- .../otbAngularProjectionSetImageFilter.txx | 2 +- .../otbSparseWvltToAngleMapperListFilter.txx | 2 +- ...tbBinaryFunctorNeighborhoodImageFilter.txx | 4 +- .../otbChangeInformationImageFilter.txx | 2 +- .../include/otbMaskedIteratorDecorator.txx | 2 +- .../include/otbPrintableImageFilter.txx | 2 +- ...treamingMatrixTransposeMatrixImageFilter.h | 4 +- .../test/otbChangeInformationImageFilter.cxx | 2 +- .../test/otbMaskedIteratorDecorator.cxx | 4 +- .../test/otbRegionProjectionResampler.cxx | 4 +- .../Path/include/otbDrawPathListFilter.txx | 2 +- .../otbImageFittingPolygonListFilter.txx | 2 +- .../Path/include/otbImageToPathListFilter.txx | 2 +- .../Path/include/otbPathFunction.txx | 2 +- .../otbPathListToHistogramGenerator.txx | 2 +- .../otbVectorizationPathListFilter.txx | 4 +- ...RegionImageToRectangularPathListFilter.cxx | 2 +- ...ltiChannelsPolarimetricSynthesisFilter.cxx | 8 +- ...ltiChannelsPolarimetricSynthesisFilter.cxx | 8 +- .../otbGenericRSResampleImageFilter.txx | 4 +- .../include/otbGeometriesProjectionFilter.txx | 2 +- .../otbImageToEnvelopeVectorDataFilter.txx | 2 +- .../include/otbOrthoRectificationFilter.txx | 2 +- .../include/otbVectorDataTransformFilter.txx | 2 +- .../src/otbGeometriesProjectionFilter.cxx | 2 +- ...CPsToRPCSensorModelImageFilterAndOrtho.cxx | 4 +- .../test/otbGenericRSResampleImageFilter.cxx | 2 +- .../test/otbGenericRSTransformFromImage.cxx | 4 +- .../test/otbOrthoRectificationFilter.cxx | 4 +- .../Projection/test/otbSensorModel.cxx | 10 +-- .../include/otbListSampleGenerator.txx | 4 +- ...tbListSampleToBalancedListSampleFilter.txx | 2 +- .../otbListSampleToHistogramListGenerator.txx | 2 +- .../otbListSampleToListSampleFilter.txx | 2 +- ...eToVariableDimensionHistogramGenerator.txx | 2 +- .../otbConcatenateVectorDataFilter.txx | 4 +- ...torDataToSpecificDescriptionFilterBase.txx | 2 +- .../otbVectorDataToVectorDataFilter.txx | 2 +- .../src/otbFuzzyDescriptorsModelManager.cxx | 4 +- .../include/otbFusionImageBase.h | 6 +- .../otbLmvmPanSharpeningFusionImageFilter.txx | 4 +- ...impleRcsPanSharpeningFusionImageFilter.txx | 4 +- .../include/otbSparseUnmixingImageFilter.txx | 2 +- .../otbImageToOSMVectorDataGenerator.txx | 2 +- .../Carto/include/otbMapFileProductWriter.txx | 2 +- .../src/otbOSMDataToVectorDataGenerator.cxx | 8 +- .../src/otbExtendedFilenameHelper.cxx | 2 +- Modules/IO/IOBSQ/src/otbBSQImageIO.cxx | 8 +- .../IO/IOGDAL/include/otbOGRVectorDataIO.h | 2 +- .../IO/IOGDAL/src/otbGDALDatasetWrapper.cxx | 6 +- .../src/otbGDALDriverManagerWrapper.cxx | 12 +-- Modules/IO/IOGDAL/src/otbGDALImageIO.cxx | 60 +++++++-------- .../IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx | 6 +- Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx | 38 +++++----- Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx | 34 ++++----- .../test/otbGDALImageIOTestWriteMetadata.cxx | 10 +-- .../IO/IOGDAL/test/otbGDALReadPxlComplex.cxx | 4 +- .../IO/IOJPEG2000/src/otbJPEG2000ImageIO.cxx | 36 ++++----- Modules/IO/IOKML/include/otbKMLVectorDataIO.h | 2 +- Modules/IO/IOKML/src/otbKMLVectorDataIO.cxx | 36 ++++----- Modules/IO/IOLUM/src/otbLUMImageIO.cxx | 10 +-- Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx | 64 ++++++++-------- Modules/IO/IOONERA/src/otbONERAImageIO.cxx | 4 +- Modules/IO/IORAD/src/otbRADImageIO.cxx | 10 +-- .../IO/IOTileMap/src/otbTileMapImageIO.cxx | 10 +-- .../include/otbStatisticsXMLFileReader.txx | 12 +-- .../include/otbStatisticsXMLFileWriter.txx | 4 +- .../IO/ImageIO/include/otbImageFileWriter.txx | 4 +- .../otbScalarBufferToImageFileWriter.txx | 2 +- Modules/IO/ImageIO/src/otbImageIOFactory.cxx | 2 +- .../IO/ImageIO/test/otbImageIOFactoryNew.cxx | 4 +- .../otbScalarBufferToImageFileWriterTest.cxx | 2 +- .../KMZWriter/include/otbKmzProductWriter.txx | 6 +- Modules/IO/TestKernel/include/otbTestHelper.h | 4 +- Modules/IO/TestKernel/src/otbTestDriver.cxx | 4 +- Modules/IO/TestKernel/src/otbTestHelper.cxx | 74 +++++++++---------- .../include/otbVectorDataFileReader.txx | 2 +- .../include/otbVectorDataFileWriter.txx | 6 +- .../src/otbVectorDataIOFactory.cxx | 2 +- .../otbDSFusionOfClassifiersImageFilter.txx | 2 +- .../include/otbJointMassOfBeliefFilter.txx | 2 +- .../include/otbGaussianModelComponent.txx | 4 +- .../otbKMeansImageClassificationFilter.txx | 2 +- .../LearningBase/include/otbSEMClassifier.txx | 10 +-- .../Markov/include/otbMRFSamplerRandomMAP.h | 12 +-- .../include/otbMarkovRandomFieldFilter.txx | 4 +- .../otbSOMImageClassificationFilter.txx | 2 +- .../otbSVMImageClassificationFilter.txx | 2 +- ...tbSVMImageClassificationWithRuleFilter.txx | 4 +- .../include/otbSVMImageModelEstimator.txx | 4 +- .../SVMLearning/include/otbSVMModel.h | 10 +-- .../SVMLearning/include/otbSVMModel.txx | 24 +++--- .../include/otbSVMModelEstimator.txx | 2 +- .../include/otbSVMPointSetModelEstimator.txx | 4 +- .../otbSVMSampleListModelEstimator.txx | 4 +- ...otbSVMImageModelEstimatorModelAccessor.cxx | 10 +-- .../SVMLearning/test/otbSVMModelAccessor.cxx | 10 +-- .../otbOGRDataToClassStatisticsFilter.txx | 14 ++-- .../otbPolygonClassStatisticsAccumulator.txx | 2 +- .../include/otbBoostMachineLearningModel.txx | 8 +- .../otbDecisionTreeMachineLearningModel.txx | 8 +- ...radientBoostedTreeMachineLearningModel.txx | 6 +- .../include/otbImageClassificationFilter.txx | 4 +- ...bKNearestNeighborsMachineLearningModel.txx | 4 +- .../include/otbLibSVMMachineLearningModel.txx | 2 +- .../include/otbMachineLearningModel.h | 2 +- .../otbMachineLearningModelFactory.txx | 2 +- .../otbNeuralNetworkMachineLearningModel.txx | 12 +-- .../otbNormalBayesMachineLearningModel.txx | 6 +- .../Supervised/include/otbOpenCVUtils.h | 2 +- .../otbRandomForestsMachineLearningModel.txx | 8 +- .../include/otbSVMMachineLearningModel.txx | 8 +- .../include/otbImageListToRCC8GraphFilter.txx | 2 +- .../otbPolygonListToRCC8GraphFilter.txx | 2 +- .../RCC8/include/otbRCC8GraphFileWriter.txx | 2 +- .../OBIA/RCC8/include/otbRCC8GraphSource.txx | 2 +- ...ectanceToSurfaceReflectanceImageFilter.txx | 4 +- ...eAdjacencyEffectCorrectionSchemeFilter.txx | 2 +- .../src/otbAeronetFileReader.cxx | 2 +- .../OpticalCalibration/src/otbSIXSTraits.cxx | 4 +- .../src/otbSpectralSensitivityReader.cxx | 4 +- .../test/otbSIXSTraitsTest.cxx | 2 +- .../include/otbReduceSpectralResponse.txx | 2 +- ...bSurfaceReflectanceToReflectanceFilter.txx | 2 +- .../Simulation/src/otbProspectModel.cxx | 6 +- .../Simulation/src/otbSailModel.cxx | 12 +-- .../otbDisparityMapEstimationMethod.txx | 8 +- .../include/otbDisparityMapMedianFilter.txx | 8 +- .../include/otbDisparityMapTo3DFilter.txx | 10 +-- .../include/otbDisparityMapToDEMFilter.txx | 18 ++--- .../include/otbDisparityTranslateFilter.txx | 16 ++-- .../otbFineRegistrationImageFilter.txx | 8 +- .../otbMultiDisparityMapTo3DFilter.txx | 6 +- .../include/otbNCCRegistrationFunction.txx | 4 +- .../otbPixelWiseBlockMatchingImageFilter.txx | 24 +++--- .../otbSubPixelDisparityImageFilter.txx | 18 ++--- ...hTransformToDisplacementFieldGenerator.txx | 2 +- .../include/otbAdhesionCorrectionFilter.txx | 12 +-- .../include/otbBijectionCoherencyFilter.txx | 8 +- .../include/otbMulti3DMapToDEMFilter.txx | 10 +-- ...bStereoSensorModelToElevationMapFilter.txx | 6 +- ...eorectificationDisplacementFieldSource.txx | 4 +- .../Stereo/test/otbMulti3DMapToDEMFilter.cxx | 8 +- ...bConnectedComponentMuParserFunctorTest.cxx | 4 +- .../otbLabelImageRegionMergingFilter.txx | 4 +- .../otbLabelImageRegionPruningFilter.txx | 4 +- .../otbLabelImageToOGRDataSourceFilter.txx | 12 +-- .../otbLabelImageToVectorDataFilter.txx | 12 +-- .../include/otbLabelMapToVectorDataFilter.txx | 2 +- .../otbOGRDataSourceToLabelImageFilter.txx | 6 +- .../otbPersistentImageToOGRLayerFilter.txx | 2 +- .../include/otbRasterizeVectorDataFilter.h | 2 +- .../include/otbRasterizeVectorDataFilter.txx | 18 ++--- .../include/otbVectorDataToLabelImageFilter.h | 2 +- .../otbVectorDataToLabelImageFilter.txx | 22 +++--- ...ctorDataToLabelMapWithAttributesFilter.txx | 2 +- ...esicMorphologyDecompositionImageFilter.txx | 4 +- ...ativeToMultiScaleCharacteristicsFilter.txx | 2 +- .../otbOGRLayerStreamStitchingFilter.txx | 4 +- .../test/otbOGRLayerStreamStitchingFilter.cxx | 2 +- .../ITK/include/otbWarpImageFilter.txx | 2 +- .../ThirdParty/MuParserX/src/mpCompat.h.in | 2 +- .../Ice/include/otbGlImageActor.h | 2 +- Modules/Visualization/Ice/include/otbGlView.h | 4 +- .../Ice/src/otbFragmentShaderRegistry.cxx | 4 +- .../Ice/src/otbGlVectorActor.cxx | 10 +-- .../Ice/src/otbGlVersionChecker.cxx | 12 +-- Modules/Visualization/Ice/src/otbGlView.cxx | 2 +- .../Ice/src/otbStandardShader.cxx | 4 +- .../Visualization/IceViewer/src/otbIce.cxx | 4 +- .../IceViewer/src/otbIceViewer.cxx | 14 ++-- .../src/otbWrapperApplication.cxx | 24 +++--- .../src/otbWrapperApplicationRegistry.cxx | 12 +-- .../otbWrapperComplexInputImageParameter.cxx | 6 +- .../otbWrapperComplexOutputImageParameter.cxx | 2 +- .../otbWrapperInputFilenameListParameter.cxx | 2 +- .../src/otbWrapperInputImageListParameter.cxx | 4 +- .../src/otbWrapperInputImageParameter.cxx | 6 +- .../otbWrapperInputProcessXMLParameter.cxx | 20 ++--- ...otbWrapperInputVectorDataListParameter.cxx | 4 +- .../otbWrapperInputVectorDataParameter.cxx | 4 +- .../src/otbWrapperOutputImageParameter.cxx | 4 +- .../otbWrapperOutputProcessXMLParameter.cxx | 4 +- .../src/otbWrapperParameterGroup.cxx | 4 +- .../src/otbApplicationLauncherCommandLine.cxx | 14 ++-- .../src/otbWrapperCommandLineLauncher.cxx | 6 +- .../src/otbWrapperQtWidgetChoiceParameter.cxx | 8 +- ...bWrapperQtWidgetInputFilenameParameter.cxx | 6 +- .../otbWrapperQtWidgetInputImageParameter.cxx | 6 +- ...rapperQtWidgetInputVectorDataParameter.cxx | 6 +- .../otbWrapperQtWidgetParameterFactory.cxx | 6 +- .../src/otbWrapperQtWidgetParameterGroup.cxx | 6 +- .../src/otbWrapperQtWidgetProgressReport.cxx | 2 +- Modules/Wrappers/SWIG/src/itkPyCommand.cxx | 6 +- 311 files changed, 972 insertions(+), 972 deletions(-) diff --git a/CMake/otbTestNullPtr.cpp b/CMake/otbTestNullPtr.cpp index c46836eff4..8abf4a6cae 100644 --- a/CMake/otbTestNullPtr.cpp +++ b/CMake/otbTestNullPtr.cpp @@ -1,6 +1,6 @@ int main(int argc, char *argv[]) { - int *p = nullptr; + int *p = ITK_NULLPTR; return 0; } diff --git a/Examples/Filtering/GeometriesChangeSpatialReference.cxx b/Examples/Filtering/GeometriesChangeSpatialReference.cxx index 536f26ffeb..0253b8a516 100644 --- a/Examples/Filtering/GeometriesChangeSpatialReference.cxx +++ b/Examples/Filtering/GeometriesChangeSpatialReference.cxx @@ -62,7 +62,7 @@ private: otb::ogr::UniqueGeometryPtr ReprojectTransformationFunctor::operator()(OGRGeometry const* in) const { - otb::ogr::UniqueGeometryPtr out(in ? in->clone() : 0); + otb::ogr::UniqueGeometryPtr out(in ? in->clone() : ITK_NULLPTR); if (out) { const OGRErr err = out->transform(m_reprojector.get()); @@ -204,7 +204,7 @@ int main (int argc, char **argv) otb::ogr::DataSource::Pointer output = options.workingInplace ? input - : options.outputIsStdout ? 0 + : options.outputIsStdout ? ITK_NULLPTR : otb::ogr::DataSource::New( options.outputFile, otb::ogr::DataSource::Modes::Update_LayerCreateOnly); std::cout << "input: " << otb::ogr::version_proxy::GetFileListAsStringVector(&input->ogr())[0] << " should be: " << options.inputFile << "\n"; if (output) @@ -231,7 +231,7 @@ int main (int argc, char **argv) } else { - filter->UpdateOutputData(0); + filter->UpdateOutputData(ITK_NULLPTR); assert(filter->GetOutput() && "output not set"); filter->GetOutput()->Print(std::cout, 0); } diff --git a/Examples/Filtering/GeometriesFilter.cxx b/Examples/Filtering/GeometriesFilter.cxx index 8150eceb97..35faff8aff 100644 --- a/Examples/Filtering/GeometriesFilter.cxx +++ b/Examples/Filtering/GeometriesFilter.cxx @@ -32,7 +32,7 @@ struct SwapXYFunctor typedef OGRGeometry TransformedElementType; otb::ogr::UniqueGeometryPtr operator()(OGRGeometry const* in) const { - otb::ogr::UniqueGeometryPtr out(in ? in->clone() : 0); + otb::ogr::UniqueGeometryPtr out(in ? in->clone() : ITK_NULLPTR); if (out) { #if GDAL_VERSION_NUM >= 1900 @@ -71,7 +71,7 @@ int main (int argc, char **argv) otb::ogr::DataSource::Pointer output = workingInplace ? input - : outputIsStdout ? 0 + : outputIsStdout ? ITK_NULLPTR : otb::ogr::DataSource::New( outputFile, otb::ogr::DataSource::Modes::Update_LayerCreateOnly); std::cout << "input: " << otb::ogr::version_proxy::GetFileListAsStringVector(&input->ogr())[0] << " should be: " << inputFile << "\n"; if (output) @@ -94,7 +94,7 @@ int main (int argc, char **argv) } else { - filter->UpdateOutputData(0); + filter->UpdateOutputData(ITK_NULLPTR); assert(filter->GetOutput() && "output not set"); filter->GetOutput()->Print(std::cout, 0); } diff --git a/Examples/IO/OGRWrappersExample.cxx b/Examples/IO/OGRWrappersExample.cxx index 23afc27e91..d7e3f0d7c3 100644 --- a/Examples/IO/OGRWrappersExample.cxx +++ b/Examples/IO/OGRWrappersExample.cxx @@ -106,7 +106,7 @@ int main(int argc, char * argv[]) otb::ogr::DataSource::Pointer destination = otb::ogr::DataSource::New( argv[2], otb::ogr::DataSource::Modes::Update_LayerCreateOnly); otb::ogr::Layer destLayer = destination->CreateLayer( - argv[2], 0, wkbMultiPolygon); + argv[2], ITK_NULLPTR, wkbMultiPolygon); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Learning/SEMModelEstimatorExample.cxx b/Examples/Learning/SEMModelEstimatorExample.cxx index 86f3e58f96..cbe329d52f 100644 --- a/Examples/Learning/SEMModelEstimatorExample.cxx +++ b/Examples/Learning/SEMModelEstimatorExample.cxx @@ -100,7 +100,7 @@ int main(int argc, char * argv[]) // Software Guide : EndCodeSnippet char * fileNameIn = argv[1]; - char * fileNameImgInit = NULL; + char * fileNameImgInit = ITK_NULLPTR; char * fileNameOut = argv[2]; int numberOfClasses = atoi(argv[3]); int numberOfIteration = atoi(argv[4]); @@ -146,7 +146,7 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - if (fileNameImgInit != NULL) + if (fileNameImgInit != ITK_NULLPTR) { typedef otb::ImageFileReader<OutputImageType> ImgInitReaderType; ImgInitReaderType::Pointer segReader = ImgInitReaderType::New(); diff --git a/Examples/Learning/SOMExample.cxx b/Examples/Learning/SOMExample.cxx index 3f56132f43..aa867d4433 100644 --- a/Examples/Learning/SOMExample.cxx +++ b/Examples/Learning/SOMExample.cxx @@ -406,7 +406,7 @@ int main(int itkNotUsed(argc), char* argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - if (actMapFileName != NULL) + if (actMapFileName != ITK_NULLPTR) { ActivationWriterType::Pointer actWriter = ActivationWriterType::New(); actWriter->SetFileName(actMapFileName); diff --git a/Examples/Projections/OrthoRectificationExample.cxx b/Examples/Projections/OrthoRectificationExample.cxx index 2acfc9caf0..2a529cf77a 100644 --- a/Examples/Projections/OrthoRectificationExample.cxx +++ b/Examples/Projections/OrthoRectificationExample.cxx @@ -152,8 +152,8 @@ int main(int argc, char* argv[]) orthoRectifFilter->SetDisplacementFieldSpacing(gridSpacing); ImageType::PointType origin; - origin[0] = strtod(argv[5], NULL); - origin[1] = strtod(argv[6], NULL); + origin[0] = strtod(argv[5], ITK_NULLPTR); + origin[1] = strtod(argv[6], ITK_NULLPTR); orthoRectifFilter->SetOutputOrigin(origin); // Software Guide : EndCodeSnippet diff --git a/Examples/Projections/SensorModelExample.cxx b/Examples/Projections/SensorModelExample.cxx index b162762e69..2b6b9fc8e0 100644 --- a/Examples/Projections/SensorModelExample.cxx +++ b/Examples/Projections/SensorModelExample.cxx @@ -184,8 +184,8 @@ int main(int argc, char* argv[]) spacing[1] = -0.00001; ImageType::PointType origin; - origin[0] = strtod(argv[3], NULL); //longitude - origin[1] = strtod(argv[4], NULL); //latitude + origin[0] = strtod(argv[3], ITK_NULLPTR); //longitude + origin[1] = strtod(argv[4], ITK_NULLPTR); //latitude ImageType::RegionType region; diff --git a/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx b/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx index ef71b0422a..b972fd7b4e 100644 --- a/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx +++ b/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx @@ -130,7 +130,7 @@ public: protected: ImageUniqueValuesCalculator() { - m_Image = NULL; + m_Image = ITK_NULLPTR; } ~ImageUniqueValuesCalculator() ITK_OVERRIDE { @@ -469,7 +469,7 @@ private: int main(int argc, char *argv[]) { - char *cmifname = NULL; + char *cmifname = ITK_NULLPTR; if (argc != 10) { if (argc == 11) // cloud mask filename optional parameter @@ -804,7 +804,7 @@ int main(int argc, char *argv[]) miReader->UpdateOutputInformation(); MaskImageType::Pointer maskImage = miReader->GetOutput(); - if (cmifname != NULL) + if (cmifname != ITK_NULLPTR) { MaskReaderType::Pointer cmiReader = MaskReaderType::New(); diff --git a/Examples/Tutorials/OrthoFusion.cxx b/Examples/Tutorials/OrthoFusion.cxx index 46209ceaed..a1ae3c6354 100644 --- a/Examples/Tutorials/OrthoFusion.cxx +++ b/Examples/Tutorials/OrthoFusion.cxx @@ -139,8 +139,8 @@ int main(int argc, char* argv[]) spacing[1] = atof(argv[11]); ImageType::PointType origin; - origin[0] = strtod(argv[6], NULL); - origin[1] = strtod(argv[7], NULL); + origin[0] = strtod(argv[6], ITK_NULLPTR); + origin[1] = strtod(argv[7], ITK_NULLPTR); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Modules/Adapters/CurlAdapters/src/otbCurlHelper.cxx b/Modules/Adapters/CurlAdapters/src/otbCurlHelper.cxx index e464e78742..f72a109051 100644 --- a/Modules/Adapters/CurlAdapters/src/otbCurlHelper.cxx +++ b/Modules/Adapters/CurlAdapters/src/otbCurlHelper.cxx @@ -175,7 +175,7 @@ public: { m_File = fopen(infname, "wb"); - if (m_File == NULL) + if (m_File == ITK_NULLPTR) { itkExceptionMacro(<<" otbCurlHelper::FileResource : failed to open the file ."<< infname); } diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h index 512111e942..c1c9cee5f3 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h @@ -276,7 +276,7 @@ public: * \return the extent of all layers * \throw itk::ExceptionObject if the layers extents can not be retrieved. */ - OGREnvelope GetGlobalExtent(bool force = false, std::string * outwkt=0) const; + OGREnvelope GetGlobalExtent(bool force = false, std::string * outwkt=ITK_NULLPTR) const; /** Grafts data and information from one data source to another. * \deprecated \c OGRLayer has an embedded input iterator. As a consequence, @@ -323,7 +323,7 @@ public: */ Layer CreateLayer( std::string const& name, - OGRSpatialReference * poSpatialRef = NULL, + OGRSpatialReference * poSpatialRef = ITK_NULLPTR, OGRwkbGeometryType eGType = wkbUnknown, std::vector<std::string> const& papszOptions = std::vector<std::string>()); @@ -363,7 +363,7 @@ public: Layer CopyLayer( Layer & srcLayer, std::string const& newName, - char ** papszOptions = NULL); + char ** papszOptions = ITK_NULLPTR); //@} /**\name Layers access @@ -466,7 +466,7 @@ public: * \see <em>Imperfect C++</em>, Matthew Wilson, Addisson-Welsey, par 24.6 */ operator int boolean ::* () const { - return m_DataSource ? &boolean::i : 0; + return m_DataSource ? &boolean::i : ITK_NULLPTR; } /** Flushes all changes to disk. diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRHelpers.h b/Modules/Adapters/GdalAdapters/include/otbOGRHelpers.h index f15f249b1d..713715283d 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRHelpers.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRHelpers.h @@ -76,7 +76,7 @@ struct StringListConverter { m_raw.push_back(b->c_str()); } - m_raw.push_back(0); + m_raw.push_back(ITK_NULLPTR); assert(CSLCount(const_cast <char**>(&m_raw[0])) == static_cast<int>(boost::size(strings))); } /** @@ -85,7 +85,7 @@ struct StringListConverter char ** to_ogr() const { return m_raw.size() == 1 - ? NULL + ? ITK_NULLPTR : const_cast <char**>(&m_raw[0]); } private: diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h index b26ebbce56..851ce7eece 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h @@ -230,7 +230,7 @@ public: */ operator int boolean ::* () const { - return m_Layer ? &boolean::i : 0; + return m_Layer ? &boolean::i : ITK_NULLPTR; } /** Access to raw \c OGRLayer. @@ -332,12 +332,12 @@ public: struct enabler {}; public: feature_iter() - : m_Layer(0), m_Crt(0) {} + : m_Layer(ITK_NULLPTR), m_Crt(ITK_NULLPTR) {} explicit feature_iter(otb::ogr::Layer & layer) : m_Layer(&layer), m_Crt(layer.GetNextFeature()) {} template <class OtherValue> feature_iter( feature_iter<OtherValue> const& other, - typename boost::enable_if<boost::is_convertible<OtherValue*,Value*> >::type* = 0 + typename boost::enable_if<boost::is_convertible<OtherValue*,Value*> >::type* = ITK_NULLPTR ) : m_Layer(other.m_Layer), m_Crt(other.m_Crt) {} diff --git a/Modules/Adapters/GdalAdapters/src/otbGeometriesToGeometriesFilter.cxx b/Modules/Adapters/GdalAdapters/src/otbGeometriesToGeometriesFilter.cxx index bec8f7a6ee..214aaedc70 100644 --- a/Modules/Adapters/GdalAdapters/src/otbGeometriesToGeometriesFilter.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbGeometriesToGeometriesFilter.cxx @@ -216,7 +216,7 @@ void otb::GeometriesToGeometriesFilter::GenerateData(void ) OGRSpatialReference* otb::GeometriesToGeometriesFilter::DoDefineNewLayerSpatialReference( ogr::Layer const& itkNotUsed(source)) const { - return 0; + return ITK_NULLPTR; } /*virtual*/ diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx index 891c22b662..a3d312e2ac 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx @@ -40,7 +40,7 @@ /*===========================================================================*/ bool otb::ogr::DataSource::Clear() { - Reset(0); + Reset(ITK_NULLPTR); return true; } @@ -104,7 +104,7 @@ char const* DeduceDriverName(std::string filename) boost::bind(&ExtensionDriverAssociation::Matches, _1, extension)); if (whichIt == boost::end(k_ExtensionDriverMap)) { - return 0; // nothing found + return ITK_NULLPTR; // nothing found } return whichIt->driverName; } @@ -112,7 +112,7 @@ char const* DeduceDriverName(std::string filename) otb::ogr::DataSource::DataSource() -: m_DataSource(0), +: m_DataSource(ITK_NULLPTR), m_OpenMode(Modes::Update_LayerUpdate), m_FirstModifiableLayerID(0) { @@ -195,7 +195,7 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode) ogr::version_proxy::GDALDatasetType * ds = ogr::version_proxy::Open(datasourceName.c_str(),true); - bool ds_exists = (ds!=NULL); + bool ds_exists = (ds!=ITK_NULLPTR); ogr::version_proxy::Close(ds); @@ -343,7 +343,7 @@ otb::ogr::Layer otb::ogr::DataSource::CreateLayer( } itkGenericExceptionMacro(<< "GDALDataset opening mode not supported"); - return Layer(0, false); // keep compiler happy + return Layer(ITK_NULLPTR, false); // keep compiler happy } otb::ogr::Layer otb::ogr::DataSource::CopyLayer( @@ -542,7 +542,7 @@ otb::ogr::Layer otb::ogr::DataSource::ExecuteSQL( // Cannot use the deleter made for result sets obtained from // GDALDataset::ExecuteSQL because it checks for non-nullity.... // *sigh* - return otb::ogr::Layer(0, modifiable); + return otb::ogr::Layer(ITK_NULLPTR, modifiable); #endif } return otb::ogr::Layer(layer_ptr, *m_DataSource, modifiable); diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx index b37eb9be8e..7b48b0998c 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx @@ -270,7 +270,7 @@ OGRSpatialReference const* otb::ogr::Layer::GetSpatialRef() const std::string otb::ogr::Layer::GetProjectionRef() const { assert(m_Layer && "OGRLayer not initialized"); - char * wkt = 0; + char * wkt = ITK_NULLPTR; OGRSpatialReference const* srs = GetSpatialRef(); if(srs) { diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy1x.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy1x.cxx index 6020ec3ebb..8a21d09882 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy1x.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy1x.cxx @@ -57,7 +57,7 @@ bool Delete(const char * name) { // Open dataset GDALDatasetType * poDS = Open(name,false); - GDALDriverType * poDriver = NULL; + GDALDriverType * poDriver = ITK_NULLPTR; if(poDS) { poDriver = poDS->GetDriver(); diff --git a/Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx b/Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx index 6e6eb7301b..ff19e550f6 100644 --- a/Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx +++ b/Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx @@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_shp_overwrite) ogr::DataSource::Pointer ds = ogr::DataSource::New(filename, ogr::DataSource::Modes::Overwrite); BOOST_ASSERT(ds); - ogr::Layer l = ds -> CreateLayer(layer1, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(layer1, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); l.CreateField(k_f0); l.CreateField(k_f1); @@ -222,7 +222,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_shp_overwrite) ogr::DataSource::Pointer ds = ogr::DataSource::New(filename, ogr::DataSource::Modes::Overwrite); BOOST_ASSERT(ds); - ogr::Layer l = ds -> CreateLayer(layer1, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(layer1, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); l.CreateField(k_f0); l.CreateField(k_f1); @@ -473,7 +473,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_sqlite_overwrite) ogr::DataSource::Pointer ds = ogr::DataSource::New(filename, ogr::DataSource::Modes::Overwrite); BOOST_ASSERT(ds); - ogr::Layer l = ds -> CreateLayer(layer1, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(layer1, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); l.CreateField(k_f0); l.CreateField(k_f1); @@ -507,7 +507,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_sqlite_overwrite) ogr::DataSource::Pointer ds = ogr::DataSource::New(filename, ogr::DataSource::Modes::Overwrite); BOOST_ASSERT(ds); - ogr::Layer l = ds -> CreateLayer(layer1, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(layer1, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); l.CreateField(k_f0); l.CreateField(k_f1); @@ -600,7 +600,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_sqlite_overwrite) // Check that we can read the file BOOST_ASSERT(ds); - ogr::Layer l = ds -> CreateLayer(layer1, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(layer1, ITK_NULLPTR, wkbPoint); BOOST_CHECK_EQUAL(l.GetFeatureCount(true), 0); // OGRFeatureDefn & defn = l.GetLayerDefn(); @@ -675,7 +675,7 @@ BOOST_AUTO_TEST_CASE(Add_n_Del_Fields) ogr::FieldDefn f5(*defn.GetFieldDefn(5)); BOOST_CHECK_EQUAL(f5, k_f5); - BOOST_CHECK_EQUAL(defn.GetFieldDefn(6), (void*)0); + BOOST_CHECK_EQUAL(defn.GetFieldDefn(6), (void*)ITK_NULLPTR); } #if GDAL_VERSION_NUM >= 1900 @@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_new_shp_with_features) const std::string k_shp = "SomeShapeFileWithFeatures"; ogr::DataSource::Pointer ds = ogr::DataSource::New(k_shp+".shp", ogr::DataSource::Modes::Overwrite); - ogr::Layer l = ds -> CreateLayer(k_one, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(k_one, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); l.CreateField(k_f0); @@ -837,7 +837,7 @@ BOOST_AUTO_TEST_CASE(Local_Geometries) BOOST_AUTO_TEST_CASE(Add_n_Read_Geometries) { ogr::DataSource::Pointer ds = ogr::DataSource::New(); - ogr::Layer l = ds -> CreateLayer(k_one, 0, wkbPoint); + ogr::Layer l = ds -> CreateLayer(k_one, ITK_NULLPTR, wkbPoint); OGRFeatureDefn & defn = l.GetLayerDefn(); for (int u=-10; u!=10; ++u) { diff --git a/Modules/Adapters/OSSIMAdapters/src/otbDEMConvertAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbDEMConvertAdapter.cxx index c351930bd2..4144f07eaa 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbDEMConvertAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbDEMConvertAdapter.cxx @@ -89,7 +89,7 @@ int DEMConvertAdapter::Convert(std::string tempFilename, std::string output) ih->initialize(); ossimRefPtr<ossimImageSource> source = ih.get(); - ossimRefPtr<ossimBandSelector> bs = 0; + ossimRefPtr<ossimBandSelector> bs = ITK_NULLPTR; // Get the image rectangle for the rrLevel selected. diff --git a/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx b/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx index e5dd39cc77..64eaef2f80 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx @@ -48,15 +48,15 @@ namespace otb { /** Initialize the singleton */ -DEMHandler::Pointer DEMHandler::m_Singleton = NULL; +DEMHandler::Pointer DEMHandler::m_Singleton = ITK_NULLPTR; DEMHandler::Pointer DEMHandler::Instance() { - if(m_Singleton.GetPointer() == NULL) + if(m_Singleton.GetPointer() == ITK_NULLPTR) { m_Singleton = itk::ObjectFactory<Self>::Create(); - if(m_Singleton.GetPointer() == NULL) + if(m_Singleton.GetPointer() == ITK_NULLPTR) { m_Singleton = new DEMHandler; } @@ -149,7 +149,7 @@ bool DEMHandler ::OpenGeoidFile(const char* geoidFile) { - if ((ossimGeoidManager::instance()->findGeoidByShortName("geoid1996")) == 0) + if ((ossimGeoidManager::instance()->findGeoidByShortName("geoid1996")) == ITK_NULLPTR) { otbMsgDevMacro(<< "Opening geoid: " << geoidFile); ossimFilename geoid(geoidFile); diff --git a/Modules/Adapters/OSSIMAdapters/src/otbDateTimeAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbDateTimeAdapter.cxx index 16dd4ecc5d..e4e086db44 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbDateTimeAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbDateTimeAdapter.cxx @@ -29,7 +29,7 @@ DateTimeAdapter::DateTimeAdapter() DateTimeAdapter::~DateTimeAdapter() { - if (m_LocalTm != NULL) + if (m_LocalTm != ITK_NULLPTR) { delete m_LocalTm; } diff --git a/Modules/Adapters/OSSIMAdapters/src/otbEllipsoidAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbEllipsoidAdapter.cxx index 3141cb4de3..363afa67d0 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbEllipsoidAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbEllipsoidAdapter.cxx @@ -41,7 +41,7 @@ EllipsoidAdapter::EllipsoidAdapter() EllipsoidAdapter::~EllipsoidAdapter() { - if (m_Ellipsoid != NULL) + if (m_Ellipsoid != ITK_NULLPTR) { delete m_Ellipsoid; } diff --git a/Modules/Adapters/OSSIMAdapters/src/otbGeometricSarSensorModelAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbGeometricSarSensorModelAdapter.cxx index b0fa03d062..983aef60cc 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbGeometricSarSensorModelAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbGeometricSarSensorModelAdapter.cxx @@ -42,16 +42,16 @@ namespace otb { GeometricSarSensorModelAdapter::GeometricSarSensorModelAdapter(): - m_SensorModel(NULL) + m_SensorModel(ITK_NULLPTR) { } GeometricSarSensorModelAdapter::~GeometricSarSensorModelAdapter() { - if (m_SensorModel != NULL) + if (m_SensorModel != ITK_NULLPTR) { delete m_SensorModel; - m_SensorModel = NULL; + m_SensorModel = ITK_NULLPTR; } } diff --git a/Modules/Adapters/OSSIMAdapters/src/otbImageKeywordlist.cxx b/Modules/Adapters/OSSIMAdapters/src/otbImageKeywordlist.cxx index 1e506fd35c..272eb98d72 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbImageKeywordlist.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbImageKeywordlist.cxx @@ -258,7 +258,7 @@ ReadGeometryFromImage(const std::string& filename, bool checkRpcTag) // Free memory delete projection; - projection = 0; + projection = ITK_NULLPTR; } @@ -433,15 +433,15 @@ ReadGeometryFromRPCTag(const std::string& filename) // try to use GeoTiff RPC tag if present. // Warning : RPC in subdatasets are not supported - GDALDriverH identifyDriverH = GDALIdentifyDriver(filename.c_str(), NULL); - if(identifyDriverH == NULL) + GDALDriverH identifyDriverH = GDALIdentifyDriver(filename.c_str(), ITK_NULLPTR); + if(identifyDriverH == ITK_NULLPTR) { // If no driver has identified the dataset, don't try to open it and exit return otb_kwl; } GDALDatasetH datasetH = GDALOpen(filename.c_str(), GA_ReadOnly); - if (datasetH != NULL) + if (datasetH != ITK_NULLPTR) { GDALDataset* dataset = static_cast<GDALDataset*>(datasetH); GDALRPCInfo rpcStruct; diff --git a/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx index b61797163a..8e161bfb3b 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx @@ -73,13 +73,13 @@ namespace otb { MapProjectionAdapter::MapProjectionAdapter(): - m_MapProjection(NULL), m_ProjectionRefWkt(""), m_ReinstanciateProjection(true) + m_MapProjection(ITK_NULLPTR), m_ProjectionRefWkt(""), m_ReinstanciateProjection(true) { } MapProjectionAdapter::~MapProjectionAdapter() { - if (m_MapProjection != NULL) + if (m_MapProjection != ITK_NULLPTR) { delete m_MapProjection; } @@ -88,7 +88,7 @@ MapProjectionAdapter::~MapProjectionAdapter() MapProjectionAdapter::InternalMapProjectionPointer MapProjectionAdapter::GetMapProjection() { itkDebugMacro("returning MapProjection address " << this->m_MapProjection); - if ((m_ReinstanciateProjection) || (m_MapProjection == NULL)) + if ((m_ReinstanciateProjection) || (m_MapProjection == ITK_NULLPTR)) { this->InstanciateProjection(); } @@ -99,7 +99,7 @@ MapProjectionAdapter::InternalMapProjectionPointer MapProjectionAdapter::GetMapP MapProjectionAdapter::InternalMapProjectionConstPointer MapProjectionAdapter::GetMapProjection() const { itkDebugMacro("returning MapProjection address " << this->m_MapProjection); - if ((m_ReinstanciateProjection) || (m_MapProjection == NULL)) + if ((m_ReinstanciateProjection) || (m_MapProjection == ITK_NULLPTR)) { itkExceptionMacro(<< "m_MapProjection not up-to-date, call InstanciateProjection() first"); } @@ -111,7 +111,7 @@ std::string MapProjectionAdapter::GetWkt() const { ossimKeywordlist kwl; this->GetMapProjection(); - if (m_MapProjection == NULL) + if (m_MapProjection == ITK_NULLPTR) { return ""; } @@ -217,7 +217,7 @@ std::string MapProjectionAdapter::GetParameter(const std::string& key) const bool MapProjectionAdapter::InstanciateProjection() { - if ((this->m_ReinstanciateProjection) || (m_MapProjection == NULL)) + if ((this->m_ReinstanciateProjection) || (m_MapProjection == ITK_NULLPTR)) { ossimKeywordlist kwl; ossimOgcWktTranslator wktTranslator; @@ -248,7 +248,7 @@ bool MapProjectionAdapter::InstanciateProjection() // ossimUtmProjection for example) ossimString name(m_ProjectionRefWkt); m_MapProjection = ossimMapProjectionFactory::instance()->createProjection(name); - if (m_MapProjection == NULL) + if (m_MapProjection == ITK_NULLPTR) { // Trying directly extending the m_ProjectionRefWkt (convert the // Utm to ossimUtmProjection for example) @@ -258,7 +258,7 @@ bool MapProjectionAdapter::InstanciateProjection() m_MapProjection = ossimMapProjectionFactory::instance()->createProjection(extendedName); } - if (m_MapProjection == NULL) return false; + if (m_MapProjection == ITK_NULLPTR) return false; } @@ -272,7 +272,7 @@ bool MapProjectionAdapter::InstanciateProjection() void MapProjectionAdapter::InverseTransform(double x, double y, double z, double& lon, double& lat, double& h) { - if (m_MapProjection == NULL) + if (m_MapProjection == ITK_NULLPTR) { otbMsgDevMacro(<< "WARNING: Using identity"); lon = x; @@ -296,7 +296,7 @@ void MapProjectionAdapter::InverseTransform(double x, double y, double z, void MapProjectionAdapter::ForwardTransform(double lon, double lat, double h, double& x, double& y, double& z) { - if (m_MapProjection == NULL) + if (m_MapProjection == ITK_NULLPTR) { otbMsgDevMacro(<< "WARNING: Using identity"); x = lon; diff --git a/Modules/Adapters/OSSIMAdapters/src/otbPlatformPositionAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbPlatformPositionAdapter.cxx index 3853baa480..a0ccace85c 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbPlatformPositionAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbPlatformPositionAdapter.cxx @@ -30,16 +30,16 @@ namespace otb { PlatformPositionAdapter::PlatformPositionAdapter(): - m_SensorModel(NULL) + m_SensorModel(ITK_NULLPTR) { } PlatformPositionAdapter::~PlatformPositionAdapter() { - if (m_SensorModel != NULL) + if (m_SensorModel != ITK_NULLPTR) { delete m_SensorModel; - m_SensorModel = NULL; + m_SensorModel = ITK_NULLPTR; } } diff --git a/Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx index 8f9ef69529..69debaf5be 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx @@ -51,7 +51,7 @@ namespace otb { SensorModelAdapter::SensorModelAdapter(): - m_SensorModel(NULL), m_TiePoints(NULL) // FIXME keeping the original value but... + m_SensorModel(ITK_NULLPTR), m_TiePoints(ITK_NULLPTR) // FIXME keeping the original value but... { m_DEMHandler = DEMHandler::Instance(); m_TiePoints = new ossimTieGptSet(); @@ -59,15 +59,15 @@ SensorModelAdapter::SensorModelAdapter(): SensorModelAdapter::~SensorModelAdapter() { - if (m_SensorModel != NULL) + if (m_SensorModel != ITK_NULLPTR) { delete m_SensorModel; - m_SensorModel = NULL; + m_SensorModel = ITK_NULLPTR; } - if(m_TiePoints!=NULL) + if(m_TiePoints!=ITK_NULLPTR) { delete m_TiePoints; - m_TiePoints = NULL; + m_TiePoints = ITK_NULLPTR; } } @@ -80,7 +80,7 @@ void SensorModelAdapter::CreateProjection(const ImageKeywordlist& image_kwl) otbMsgDevMacro(<< "* type: " << geom.find("type")); m_SensorModel = ossimSensorModelFactory::instance()->createProjection(geom); - if (m_SensorModel == NULL) + if (m_SensorModel == ITK_NULLPTR) { m_SensorModel = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(geom); } @@ -88,7 +88,7 @@ void SensorModelAdapter::CreateProjection(const ImageKeywordlist& image_kwl) bool SensorModelAdapter::IsValidSensorModel() { - if (m_SensorModel == NULL) + if (m_SensorModel == ITK_NULLPTR) { return false; } @@ -101,7 +101,7 @@ bool SensorModelAdapter::IsValidSensorModel() void SensorModelAdapter::ForwardTransformPoint(double x, double y, double z, double& lon, double& lat, double& h) const { - if (this->m_SensorModel == NULL) + if (this->m_SensorModel == ITK_NULLPTR) { itkExceptionMacro(<< "ForwardTransformPoint(): Invalid sensor model (m_SensorModel pointer is null)"); } @@ -120,7 +120,7 @@ void SensorModelAdapter::ForwardTransformPoint(double x, double y, double z, void SensorModelAdapter::ForwardTransformPoint(double x, double y, double& lon, double& lat, double& h) const { - if (this->m_SensorModel == NULL) + if (this->m_SensorModel == ITK_NULLPTR) { itkExceptionMacro(<< "ForwardTransformPoint(): Invalid sensor model (m_SensorModel pointer is null)"); } @@ -139,7 +139,7 @@ void SensorModelAdapter::ForwardTransformPoint(double x, double y, void SensorModelAdapter::InverseTransformPoint(double lon, double lat, double h, double& x, double& y, double& z) const { - if (this->m_SensorModel == NULL) + if (this->m_SensorModel == ITK_NULLPTR) { itkExceptionMacro(<< "InverseTransformPoint(): Invalid sensor model (m_SensorModel pointer is null)"); } @@ -159,7 +159,7 @@ void SensorModelAdapter::InverseTransformPoint(double lon, double lat, double h, void SensorModelAdapter::InverseTransformPoint(double lon, double lat, double& x, double& y, double& z) const { - if (this->m_SensorModel == NULL) + if (this->m_SensorModel == ITK_NULLPTR) { itkExceptionMacro(<< "InverseTransformPoint(): Invalid sensor model (m_SensorModel pointer is null)"); } @@ -215,27 +215,27 @@ double SensorModelAdapter::Optimize() double precision = 0.; // If tie points and model are allocated - if(m_SensorModel != NULL) + if(m_SensorModel != ITK_NULLPTR) { // try to retrieve a sensor model - ossimSensorModel * sensorModel = NULL; + ossimSensorModel * sensorModel = ITK_NULLPTR; sensorModel = dynamic_cast<ossimSensorModel *>(m_SensorModel); - ossimRpcProjection * simpleRpcModel = NULL; + ossimRpcProjection * simpleRpcModel = ITK_NULLPTR; simpleRpcModel = dynamic_cast<ossimRpcProjection *>(m_SensorModel); //Handle expections - if ( (sensorModel == NULL ) && (simpleRpcModel == NULL ) ) + if ( (sensorModel == ITK_NULLPTR ) && (simpleRpcModel == ITK_NULLPTR ) ) itkExceptionMacro(<< "Optimize(): error, both dynamic_cast from ossimProjection* to ossimSensorModel* / ossimRpcProjection* failed."); - if(sensorModel != NULL ) + if(sensorModel != ITK_NULLPTR ) { // Call optimize fit precision = sensorModel->optimizeFit(*m_TiePoints); } - else if (simpleRpcModel != NULL) + else if (simpleRpcModel != ITK_NULLPTR) { // Call optimize fit precision = simpleRpcModel->optimizeFit(*m_TiePoints); @@ -256,39 +256,39 @@ bool SensorModelAdapter::ReadGeomFile(const std::string & infile) m_SensorModel = ossimSensorModelFactory::instance()->createProjection(geom); - if (m_SensorModel == NULL) + if (m_SensorModel == ITK_NULLPTR) { m_SensorModel = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(geom); } - return (m_SensorModel != NULL); + return (m_SensorModel != ITK_NULLPTR); } bool SensorModelAdapter::WriteGeomFile(const std::string & outfile) { // If tie points and model are allocated - if(m_SensorModel != NULL) + if(m_SensorModel != ITK_NULLPTR) { // try to retrieve a sensor model - ossimSensorModel * sensorModel = NULL; + ossimSensorModel * sensorModel = ITK_NULLPTR; sensorModel = dynamic_cast<ossimSensorModel *>(m_SensorModel); - ossimRpcProjection * simpleRpcModel = NULL; + ossimRpcProjection * simpleRpcModel = ITK_NULLPTR; simpleRpcModel = dynamic_cast<ossimRpcProjection *>(m_SensorModel); //Handle expections - if ( (sensorModel == NULL ) && (simpleRpcModel == NULL ) ) + if ( (sensorModel == ITK_NULLPTR ) && (simpleRpcModel == ITK_NULLPTR ) ) itkExceptionMacro(<< "Optimize(): error, both dynamic_cast from ossimProjection* to ossimSensorModel* / ossimRpcProjection* failed."); ossimKeywordlist geom; bool success = false; - if(sensorModel != NULL ) + if(sensorModel != ITK_NULLPTR ) { // Save state success = sensorModel->saveState(geom); } - else if (simpleRpcModel != NULL) + else if (simpleRpcModel != ITK_NULLPTR) { // Save state success = simpleRpcModel->saveState(geom); diff --git a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx index d6153c4880..5ef1ccaed7 100644 --- a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx @@ -77,7 +77,7 @@ private: std::string shapefile = GetParameterString("inshp"); otb::ogr::DataSource::Pointer ogrDS; - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); OGRSpatialReference oSRS(""); std::vector<std::string> options; @@ -130,7 +130,7 @@ private: featValue.push_back(mv); feature = layer.ogr().GetNextFeature(); - goesOn = feature.addr() != 0; + goesOn = feature.addr() != ITK_NULLPTR; } MeasurementType mean; mean.SetSize(nbFeatures); diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index 50a8a736e0..b1161dddd7 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -96,7 +96,7 @@ private: std::string shapefile = GetParameterString("inshp"); otb::ogr::DataSource::Pointer ogrDS; - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); OGRSpatialReference oSRS(""); std::vector<std::string> options; @@ -168,7 +168,7 @@ private: input->PushBack(mv); target->PushBack(feature.ogr().GetFieldAsInteger("class")); feature = layer.ogr().GetNextFeature(); - goesOn = feature.addr() != 0; + goesOn = feature.addr() != ITK_NULLPTR; } ShiftScaleFilterType::Pointer trainingShiftScaleFilter = ShiftScaleFilterType::New(); @@ -210,7 +210,7 @@ private: feature2.ogr().SetField(GetParameterString("cfield").c_str(),(int)labelListSample->GetMeasurementVector(count)[0]); layer2.SetFeature(feature2); feature2 = layer2.ogr().GetNextFeature(); - goesOn2 = feature2.addr() != 0; + goesOn2 = feature2.addr() != ITK_NULLPTR; count++; } diff --git a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx index 33b752fb46..5dc706145a 100644 --- a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx @@ -95,7 +95,7 @@ private: std::string shapefile = GetParameterString("inshp"); otb::ogr::DataSource::Pointer ogrDS; - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); OGRSpatialReference oSRS(""); std::vector<std::string> options; @@ -170,7 +170,7 @@ private: target->PushBack(feature.ogr().GetFieldAsInteger(GetParameterString("cfield").c_str())); } feature = layer.ogr().GetNextFeature(); - goesOn = feature.addr() != 0; + goesOn = feature.addr() != ITK_NULLPTR; } ShiftScaleFilterType::Pointer trainingShiftScaleFilter = ShiftScaleFilterType::New(); diff --git a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx index 6284f6b589..d0089f61a9 100644 --- a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx +++ b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx @@ -202,7 +202,7 @@ private: } - void Match(FloatImageType * im1, FloatImageType * im2, RSTransformType * rsTransform, RSTransformType * rsTransform1ToWGS84,RSTransformType * rsTransform2ToWGS84, std::ofstream & file, OGRMultiLineString * mls = NULL) + void Match(FloatImageType * im1, FloatImageType * im2, RSTransformType * rsTransform, RSTransformType * rsTransform1ToWGS84,RSTransformType * rsTransform2ToWGS84, std::ofstream & file, OGRMultiLineString * mls = ITK_NULLPTR) { MatchingFilterType::Pointer matchingFilter = MatchingFilterType::New(); @@ -501,7 +501,7 @@ private: if(IsParameterEnabled("outvector")) { // Create the datasource (for matches export) - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); otb::ogr::DataSource::Pointer ogrDS; ogrDS = otb::ogr::DataSource::New(GetParameterString("outvector"), otb::ogr::DataSource::Modes::Overwrite); diff --git a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx index e09f0d852b..82ad124956 100644 --- a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx +++ b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx @@ -133,7 +133,7 @@ private: unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel(); ListViewParameter *clParam = dynamic_cast<ListViewParameter*>(GetParameterByKey("cl")); // Update the values of the channels to be selected if nbComponents is changed - if (clParam != NULL && clParam->GetNbChoices() != nbComponents) + if (clParam != ITK_NULLPTR && clParam->GetNbChoices() != nbComponents) { ClearChoices("cl"); diff --git a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx index ea59c1430a..8936100c84 100644 --- a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx +++ b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx @@ -261,7 +261,7 @@ private: if(IsParameterEnabled("outvector")) { // Create the datasource (for matches export) - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); otb::ogr::DataSource::Pointer ogrDS; ogrDS = otb::ogr::DataSource::New(GetParameterString("outvector"), otb::ogr::DataSource::Modes::Overwrite); diff --git a/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx b/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx index aacb3bfe2c..a0c32c67e2 100644 --- a/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx +++ b/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx @@ -319,7 +319,7 @@ private: if(IsParameterEnabled("outvector")) { // Create the datasource (for matches export) - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); otb::ogr::DataSource::Pointer ogrDS; ogrDS = otb::ogr::DataSource::New(GetParameterString("outvector"), otb::ogr::DataSource::Modes::Overwrite); diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx index 39e39d5258..af019a208f 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx @@ -597,7 +597,7 @@ private: WriteTile(changeLabel->GetOutput(),row,column,"RELAB"); // Remove previous tile (not needed anymore) - readerIn = 0; // release the input file + readerIn = ITK_NULLPTR; // release the input file RemoveFile(tileIn); } } @@ -654,7 +654,7 @@ private: m_FilesToRemoveAfterExecute.push_back(tmpfile); // Clean previous tiles (not needed anymore) - readerIn = 0; // release the input file + readerIn = ITK_NULLPTR; // release the input file RemoveFile(tileIn); } } @@ -686,7 +686,7 @@ private: void AfterExecuteAndWriteOutputs() ITK_OVERRIDE { // Release input files - m_FinalReader = 0; + m_FinalReader = ITK_NULLPTR; if(IsParameterEnabled("cleanup")) { diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx index df54787f26..9a0c070e99 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx @@ -154,7 +154,7 @@ private: std::vector<ImageType::PixelType>sum2(regionCount+1,defaultValue); otb::ogr::DataSource::Pointer ogrDS; - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); OGRSpatialReference oSRS(projRef.c_str()); std::vector<std::string> options; @@ -258,7 +258,7 @@ private: std::ostringstream sqloss; sqloss.str(""); sqloss<<"SELECT * FROM \""<<layername<<"\" ORDER BY label"; - otb::ogr::Layer layerTmp=ogrDS->ExecuteSQL(sqloss.str().c_str(), NULL, NULL); + otb::ogr::Layer layerTmp=ogrDS->ExecuteSQL(sqloss.str().c_str(), ITK_NULLPTR, ITK_NULLPTR); otb::ogr::Feature firstFeature = layerTmp.ogr().GetNextFeature(); //Geometry fusion @@ -271,7 +271,7 @@ private: OGRMultiPolygon geomToMerge; geomToMerge.addGeometry(firstFeature.GetGeometry()); bool merging = true; - otb::ogr::Feature nextFeature(NULL); + otb::ogr::Feature nextFeature(ITK_NULLPTR); bool haveMerged=false; while(merging) @@ -345,7 +345,7 @@ private: if(extension==".shp"){ sqloss.str(""); sqloss<<"REPACK "<<layername; - ogrDS->ogr().ExecuteSQL(sqloss.str().c_str(), NULL, NULL); + ogrDS->ogr().ExecuteSQL(sqloss.str().c_str(), ITK_NULLPTR, ITK_NULLPTR); } ogrDS->SyncToDisk(); diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx index 3e600c82a7..3f8bcd0a9b 100644 --- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx @@ -449,7 +449,7 @@ private: const std::string segType = GetParameterString("filter"); otb::ogr::DataSource::Pointer ogrDS; - otb::ogr::Layer layer(NULL, false); + otb::ogr::Layer layer(ITK_NULLPTR, false); std::string projRef = GetParameterFloatVectorImage("in")->GetProjectionRef(); @@ -686,7 +686,7 @@ private: std::string repack("REPACK "); repack = repack + shpLayerName; - ogrDS->ExecuteSQL(repack, NULL, NULL); + ogrDS->ExecuteSQL(repack, ITK_NULLPTR, ITK_NULLPTR); } } } diff --git a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx index 80dbe412d3..2c28ba79ab 100644 --- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx @@ -899,9 +899,9 @@ private: } // Compute disparities - FilterType* blockMatcherFilterPointer = NULL; - FilterType* invBlockMatcherFilterPointer = NULL; - FilterType* subPixelFilterPointer = NULL; + FilterType* blockMatcherFilterPointer = ITK_NULLPTR; + FilterType* invBlockMatcherFilterPointer = ITK_NULLPTR; + FilterType* subPixelFilterPointer = ITK_NULLPTR; BijectionFilterType::Pointer bijectFilter; // pointer diff --git a/Modules/Core/CommandLineParser/include/otbCommandLineArgumentParser.h b/Modules/Core/CommandLineParser/include/otbCommandLineArgumentParser.h index 3a524c0496..0c9cf53cfd 100644 --- a/Modules/Core/CommandLineParser/include/otbCommandLineArgumentParser.h +++ b/Modules/Core/CommandLineParser/include/otbCommandLineArgumentParser.h @@ -237,12 +237,12 @@ public: /** Add a new option with fixed number of parameters */ void AddOption(const std::string& name, const std::string& comment, - const std::string& synonym = NULL, + const std::string& synonym = ITK_NULLPTR, int nParameters = 1, bool obligatory = true); /** Add a new option with unknown number of parameters */ - void AddOptionNParams(const std::string& name, const std::string& comment, const std::string& synonym = NULL, bool obligatory = true); + void AddOptionNParams(const std::string& name, const std::string& comment, const std::string& synonym = ITK_NULLPTR, bool obligatory = true); /** Interpret options from the command line */ void ParseCommandLine(int argc, char *argv[], diff --git a/Modules/Core/CommandLineParser/src/otbCommandLineArgumentParser.cxx b/Modules/Core/CommandLineParser/src/otbCommandLineArgumentParser.cxx index eff12c580a..29cfb9dfd2 100644 --- a/Modules/Core/CommandLineParser/src/otbCommandLineArgumentParser.cxx +++ b/Modules/Core/CommandLineParser/src/otbCommandLineArgumentParser.cxx @@ -280,7 +280,7 @@ bool CommandLineArgumentParser::TryParseCommandLine(int argc, char *argv[], bool goOnFlag(true); while (goOnFlag == true) { - if (argv[i + 1] != NULL) + if (argv[i + 1] != ITK_NULLPTR) { std::string strArgv = std::string(argv[i + 1]); if (strArgv[0] == '-' ) diff --git a/Modules/Core/Common/include/otbImageAndVectorImageOperationFilter.txx b/Modules/Core/Common/include/otbImageAndVectorImageOperationFilter.txx index 83c4db4d7e..5e254ae951 100644 --- a/Modules/Core/Common/include/otbImageAndVectorImageOperationFilter.txx +++ b/Modules/Core/Common/include/otbImageAndVectorImageOperationFilter.txx @@ -71,7 +71,7 @@ const typename ImageAndVectorImageOperationFilter<TInputImage, TVectorInputImage ImageAndVectorImageOperationFilter<TInputImage, TVectorInputImage, TOutputImage> ::GetVectorInput() { - if (this->GetNumberOfInputs() < 2) return 0; + if (this->GetNumberOfInputs() < 2) return ITK_NULLPTR; return dynamic_cast<const VectorInputImageType*>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Core/Common/include/otbImageToModulusAndDirectionImageFilter.txx b/Modules/Core/Common/include/otbImageToModulusAndDirectionImageFilter.txx index 0f7b6eadce..b4a229f0a9 100644 --- a/Modules/Core/Common/include/otbImageToModulusAndDirectionImageFilter.txx +++ b/Modules/Core/Common/include/otbImageToModulusAndDirectionImageFilter.txx @@ -62,7 +62,7 @@ GetOutput() { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *> (this->itk::ProcessObject::GetOutput(0)); @@ -92,7 +92,7 @@ GetOutputDirection() { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageDirectionType *> (this->itk::ProcessObject::GetOutput(1)); diff --git a/Modules/Core/Common/include/otbImportImageFilter.txx b/Modules/Core/Common/include/otbImportImageFilter.txx index 452f84591f..a7cfa5a9f6 100644 --- a/Modules/Core/Common/include/otbImportImageFilter.txx +++ b/Modules/Core/Common/include/otbImportImageFilter.txx @@ -43,7 +43,7 @@ ImportImageFilter<TOutputImage> } m_Direction.SetIdentity(); - m_ImportPointer = 0; + m_ImportPointer = ITK_NULLPTR; m_FilterManageMemory = false; m_Size = 0; } diff --git a/Modules/Core/Common/include/otbModelComponentBase.txx b/Modules/Core/Common/include/otbModelComponentBase.txx index 843ad7834a..b0b6b348b8 100644 --- a/Modules/Core/Common/include/otbModelComponentBase.txx +++ b/Modules/Core/Common/include/otbModelComponentBase.txx @@ -34,9 +34,9 @@ template<class TSample> ModelComponentBase<TSample> ::ModelComponentBase() { - m_Sample = 0; - m_PdfFunction = 0; - m_CdfFunction = 0; + m_Sample = ITK_NULLPTR; + m_PdfFunction = ITK_NULLPTR; + m_CdfFunction = ITK_NULLPTR; m_SampleModified = 0; } @@ -48,7 +48,7 @@ ModelComponentBase<TSample> Superclass::PrintSelf(os, indent); os << indent << "Sample: "; - if (m_Sample != 0) + if (m_Sample != ITK_NULLPTR) { os << m_Sample << std::endl; } @@ -58,7 +58,7 @@ ModelComponentBase<TSample> } os << indent << "Membership Function for pdf: "; - if (m_PdfFunction != 0) + if (m_PdfFunction != ITK_NULLPTR) { os << m_PdfFunction << std::endl; } @@ -68,7 +68,7 @@ ModelComponentBase<TSample> } os << indent << "Membership Function for cdf: "; - if (m_CdfFunction != 0) + if (m_CdfFunction != ITK_NULLPTR) { os << m_CdfFunction << std::endl; } diff --git a/Modules/Core/Common/src/otbConfigurationManager.cxx b/Modules/Core/Common/src/otbConfigurationManager.cxx index 562924a071..43f1b683a9 100644 --- a/Modules/Core/Common/src/otbConfigurationManager.cxx +++ b/Modules/Core/Common/src/otbConfigurationManager.cxx @@ -47,7 +47,7 @@ ConfigurationManager::RAMValueType ConfigurationManager::GetMaxRAMHint() if(itksys::SystemTools::GetEnv("OTB_MAX_RAM_HINT",svalue)) { - unsigned long int tmp = strtoul(svalue.c_str(),NULL,10); + unsigned long int tmp = strtoul(svalue.c_str(),ITK_NULLPTR,10); if(tmp) { diff --git a/Modules/Core/Common/src/otbFilterWatcherBase.cxx b/Modules/Core/Common/src/otbFilterWatcherBase.cxx index bd88046e43..570dbbf03e 100644 --- a/Modules/Core/Common/src/otbFilterWatcherBase.cxx +++ b/Modules/Core/Common/src/otbFilterWatcherBase.cxx @@ -26,7 +26,7 @@ namespace otb FilterWatcherBase ::FilterWatcherBase() : m_Comment("Not watching an object"), - m_Process(0), + m_Process(ITK_NULLPTR), m_StartTag(0), m_EndTag(0), m_ProgressTag(0), diff --git a/Modules/Core/Common/src/otbSystem.cxx b/Modules/Core/Common/src/otbSystem.cxx index 50301533a7..c0a063035a 100644 --- a/Modules/Core/Common/src/otbSystem.cxx +++ b/Modules/Core/Common/src/otbSystem.cxx @@ -124,9 +124,9 @@ std::vector<std::string> System::Readdir(const std::string& pszPath) if (pszPath.empty() == true) path = "."; - if ((hDir = opendir(path.c_str())) != NULL) + if ((hDir = opendir(path.c_str())) != ITK_NULLPTR) { - while ((psDirEntry = readdir(hDir)) != NULL) + while ((psDirEntry = readdir(hDir)) != ITK_NULLPTR) { listFileFind.push_back(psDirEntry->d_name); } diff --git a/Modules/Core/Common/src/otbWriterWatcherBase.cxx b/Modules/Core/Common/src/otbWriterWatcherBase.cxx index cce575ef82..5ba4efff04 100644 --- a/Modules/Core/Common/src/otbWriterWatcherBase.cxx +++ b/Modules/Core/Common/src/otbWriterWatcherBase.cxx @@ -28,7 +28,7 @@ WriterWatcherBase { // Initialize state m_Comment = "Not watching any object"; - m_Process = 0; + m_Process = ITK_NULLPTR; m_StartFilterTag = 0; m_EndFilterTag = 0; m_ProgressFilterTag = 0; diff --git a/Modules/Core/Common/test/otbSystemTest.cxx b/Modules/Core/Common/test/otbSystemTest.cxx index f8fd3ecf5d..e2adb3ab9d 100644 --- a/Modules/Core/Common/test/otbSystemTest.cxx +++ b/Modules/Core/Common/test/otbSystemTest.cxx @@ -29,10 +29,10 @@ int otbSystemTest(int itkNotUsed(argc), char * argv[]) std::ostringstream msg; // Check instanciation test - otb::System * var(NULL); + otb::System * var(ITK_NULLPTR); var = new otb::System(); delete var; - var = NULL; + var = ITK_NULLPTR; if (itksys::SystemTools::FileExists(inputFileName, true) == false) { diff --git a/Modules/Core/ImageBase/src/otbImageIOBase.cxx b/Modules/Core/ImageBase/src/otbImageIOBase.cxx index 058d1a829a..5b0c9d3831 100644 --- a/Modules/Core/ImageBase/src/otbImageIOBase.cxx +++ b/Modules/Core/ImageBase/src/otbImageIOBase.cxx @@ -86,7 +86,7 @@ void ImageIOBase::Resize(const unsigned int numDimensions, const unsigned int* dimensions) { m_NumberOfDimensions = numDimensions; - if (dimensions != NULL) + if (dimensions != ITK_NULLPTR) { for (unsigned int i=0; i < m_NumberOfDimensions; i++) { diff --git a/Modules/Core/ImageBase/test/otbMultiChannelExtractROI.cxx b/Modules/Core/ImageBase/test/otbMultiChannelExtractROI.cxx index 910d3aa486..b675ef7af7 100644 --- a/Modules/Core/ImageBase/test/otbMultiChannelExtractROI.cxx +++ b/Modules/Core/ImageBase/test/otbMultiChannelExtractROI.cxx @@ -37,7 +37,7 @@ int generic_otbMultiChannelExtractROI(int itkNotUsed(argc), char * argv[], const typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); int cpt(0), nbcanaux(0); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { std::string strArgv(argv[cpt]); if (strArgv == "-startX") @@ -76,7 +76,7 @@ int generic_otbMultiChannelExtractROI(int itkNotUsed(argc), char * argv[], const bool searchChannels(true); while (searchChannels == true) { - if (argv[cpt] == NULL) + if (argv[cpt] == ITK_NULLPTR) { searchChannels = false; } diff --git a/Modules/Core/ImageBase/test/otbMultiToMonoChannelExtractROI.cxx b/Modules/Core/ImageBase/test/otbMultiToMonoChannelExtractROI.cxx index d992ab51fa..739dc5fb25 100644 --- a/Modules/Core/ImageBase/test/otbMultiToMonoChannelExtractROI.cxx +++ b/Modules/Core/ImageBase/test/otbMultiToMonoChannelExtractROI.cxx @@ -33,7 +33,7 @@ int generic_otbMultiToMonoChannelExtractROI(int itkNotUsed(argc), typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); int cpt(0); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { std::string strArgv(argv[cpt]); if (strArgv == "-startX") diff --git a/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.txx b/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.txx index 930151d251..7539a2ac2f 100644 --- a/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.txx +++ b/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.txx @@ -95,7 +95,7 @@ BSplineInterpolateImageFunction<TImageType, TCoordRep, TCoefficientType> } else { - m_Coefficients = NULL; + m_Coefficients = ITK_NULLPTR; } } diff --git a/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.txx b/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.txx index 28322f2850..8ad04c8440 100644 --- a/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.txx +++ b/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.txx @@ -30,8 +30,8 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo { m_WindowSize = 1; this->SetRadius(1); - m_OffsetTable = NULL; - m_WeightOffsetTable = NULL; + m_OffsetTable = ITK_NULLPTR; + m_WeightOffsetTable = ITK_NULLPTR; m_TablesHaveBeenGenerated = false; m_NormalizeWeight = false; } @@ -51,21 +51,21 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo ::ResetOffsetTable() { // Clear the offset table - if (m_OffsetTable != NULL) + if (m_OffsetTable != ITK_NULLPTR) { delete[] m_OffsetTable; - m_OffsetTable = NULL; + m_OffsetTable = ITK_NULLPTR; } // Clear the weights tales - if (m_WeightOffsetTable != NULL) + if (m_WeightOffsetTable != ITK_NULLPTR) { for (unsigned int i = 0; i < m_OffsetTableSize; ++i) { delete[] m_WeightOffsetTable[i]; } delete[] m_WeightOffsetTable; - m_WeightOffsetTable = NULL; + m_WeightOffsetTable = ITK_NULLPTR; } } @@ -123,7 +123,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo // Initialize the neighborhood SizeType radius; radius.Fill(this->GetRadius()); - if (this->GetInputImage() != NULL) + if (this->GetInputImage() != ITK_NULLPTR) { IteratorType it = IteratorType(radius, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion()); // Compute the offset tables (we ignore all the zero indices diff --git a/Modules/Core/LabelMap/include/otbAttributesMapLabelObject.h b/Modules/Core/LabelMap/include/otbAttributesMapLabelObject.h index ccc6977901..c3fbefea68 100644 --- a/Modules/Core/LabelMap/include/otbAttributesMapLabelObject.h +++ b/Modules/Core/LabelMap/include/otbAttributesMapLabelObject.h @@ -274,7 +274,7 @@ public: // copy the data of the current type if possible const Self * src = dynamic_cast<const Self *>(lo); - if (src == NULL) + if (src == ITK_NULLPTR) { return; } diff --git a/Modules/Core/LabelMap/include/otbAttributesMapLabelObjectWithClassLabel.h b/Modules/Core/LabelMap/include/otbAttributesMapLabelObjectWithClassLabel.h index 88d8321fc1..56888e933a 100644 --- a/Modules/Core/LabelMap/include/otbAttributesMapLabelObjectWithClassLabel.h +++ b/Modules/Core/LabelMap/include/otbAttributesMapLabelObjectWithClassLabel.h @@ -108,7 +108,7 @@ public: // copy the data of the current type if possible const Self * src = dynamic_cast<const Self *>( lo ); - if( src == NULL ) + if( src == ITK_NULLPTR ) { return; } diff --git a/Modules/Core/LabelMap/include/otbImageToLabelMapWithAttributesFilter.txx b/Modules/Core/LabelMap/include/otbImageToLabelMapWithAttributesFilter.txx index 24cab3fd19..e93f51f165 100644 --- a/Modules/Core/LabelMap/include/otbImageToLabelMapWithAttributesFilter.txx +++ b/Modules/Core/LabelMap/include/otbImageToLabelMapWithAttributesFilter.txx @@ -76,7 +76,7 @@ ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TO { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType* > @@ -90,7 +90,7 @@ ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TO { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const LabeledImageType* > diff --git a/Modules/Core/LabelMap/include/otbLabelMapSource.txx b/Modules/Core/LabelMap/include/otbLabelMapSource.txx index 252421399a..c3aaff869d 100644 --- a/Modules/Core/LabelMap/include/otbLabelMapSource.txx +++ b/Modules/Core/LabelMap/include/otbLabelMapSource.txx @@ -62,7 +62,7 @@ LabelMapSource<TOutputLabelMap> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputLabelMapType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Core/LabelMap/include/otbLabelMapToSampleListFilter.txx b/Modules/Core/LabelMap/include/otbLabelMapToSampleListFilter.txx index b85660a898..603cca39a6 100644 --- a/Modules/Core/LabelMap/include/otbLabelMapToSampleListFilter.txx +++ b/Modules/Core/LabelMap/include/otbLabelMapToSampleListFilter.txx @@ -70,7 +70,7 @@ LabelMapToSampleListFilter<TInputLabelMap,TOutputListSample,TMeasurementFunctor> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputLabelMapType* > diff --git a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h index bba63cd462..1a48b06d23 100644 --- a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h +++ b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h @@ -117,7 +117,7 @@ public: } /** Constructor */ - LabelObjectToPolygonFunctor() : m_Polygon(NULL), + LabelObjectToPolygonFunctor() : m_Polygon(ITK_NULLPTR), m_CurrentState(UP_LEFT), m_PositionFlag(LEFT_END), m_StartingPoint(), diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.txx b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.txx index bf5bff1184..35b7f25190 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.txx +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.txx @@ -46,7 +46,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> m_ComputeFlusser(true), m_ComputePolygon(true), m_ReducedAttributeSet(true), - m_LabelImage(NULL) + m_LabelImage(ITK_NULLPTR) {} /** The comparator (!=) */ diff --git a/Modules/Core/ObjectList/include/otbImageListSource.txx b/Modules/Core/ObjectList/include/otbImageListSource.txx index 7976b7a253..5cf7009ea4 100644 --- a/Modules/Core/ObjectList/include/otbImageListSource.txx +++ b/Modules/Core/ObjectList/include/otbImageListSource.txx @@ -43,7 +43,7 @@ ImageListSource<TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageListType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Core/ObjectList/include/otbImageListToImageFilter.txx b/Modules/Core/ObjectList/include/otbImageListToImageFilter.txx index bb873fa298..c264a457f0 100644 --- a/Modules/Core/ObjectList/include/otbImageListToImageFilter.txx +++ b/Modules/Core/ObjectList/include/otbImageListToImageFilter.txx @@ -56,7 +56,7 @@ ImageListToImageFilter<TInputImage, TOutputImage> if (this->GetNumberOfInputs() < 1) { // exit - return 0; + return ITK_NULLPTR; } // else return the first input return static_cast<InputImageListType *> diff --git a/Modules/Core/ObjectList/include/otbImageListToImageListFilter.txx b/Modules/Core/ObjectList/include/otbImageListToImageListFilter.txx index 8368704204..d9cf8cb16b 100644 --- a/Modules/Core/ObjectList/include/otbImageListToImageListFilter.txx +++ b/Modules/Core/ObjectList/include/otbImageListToImageListFilter.txx @@ -56,7 +56,7 @@ ImageListToImageListFilter<TInputImage, TOutputImage> if (this->GetNumberOfInputs() < 1) { // exit - return 0; + return ITK_NULLPTR; } // else return the first input return static_cast<InputImageListType *> diff --git a/Modules/Core/ObjectList/include/otbImageListToSingleImageFilter.txx b/Modules/Core/ObjectList/include/otbImageListToSingleImageFilter.txx index 57a7c29267..e833202b79 100644 --- a/Modules/Core/ObjectList/include/otbImageListToSingleImageFilter.txx +++ b/Modules/Core/ObjectList/include/otbImageListToSingleImageFilter.txx @@ -47,7 +47,7 @@ ImageListToSingleImageFilter<TImageType> if (this->GetNumberOfInputs() != 1) { // exit - return 0; + return ITK_NULLPTR; } // else return the first input return static_cast<OutputImagePointerType>( diff --git a/Modules/Core/ObjectList/include/otbImageToImageListFilter.txx b/Modules/Core/ObjectList/include/otbImageToImageListFilter.txx index 5cc0d6591d..5e82a124b7 100644 --- a/Modules/Core/ObjectList/include/otbImageToImageListFilter.txx +++ b/Modules/Core/ObjectList/include/otbImageToImageListFilter.txx @@ -56,7 +56,7 @@ ImageToImageListFilter<TInputImage, TOutputImage> if (this->GetNumberOfInputs() < 1) { // exit - return 0; + return ITK_NULLPTR; } // else return the first input return static_cast<TInputImage *> diff --git a/Modules/Core/ObjectList/include/otbObjectListSource.txx b/Modules/Core/ObjectList/include/otbObjectListSource.txx index 5085cbcc04..29142c6d49 100644 --- a/Modules/Core/ObjectList/include/otbObjectListSource.txx +++ b/Modules/Core/ObjectList/include/otbObjectListSource.txx @@ -62,7 +62,7 @@ ObjectListSource<TOutputList> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputList*> diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.txx b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.txx index ee09c19a40..99edfd1302 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.txx +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.txx @@ -51,7 +51,7 @@ ObjectListToObjectListFilter<TInputList, TOutputList> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputList *> diff --git a/Modules/Core/PointSet/include/otbImageToPointSetFilter.txx b/Modules/Core/PointSet/include/otbImageToPointSetFilter.txx index 0978188a01..d79425d366 100644 --- a/Modules/Core/PointSet/include/otbImageToPointSetFilter.txx +++ b/Modules/Core/PointSet/include/otbImageToPointSetFilter.txx @@ -94,7 +94,7 @@ const typename ImageToPointSetFilter<TInputImage, TOutputPointSet>::InputImageTy ImageToPointSetFilter<TInputImage, TOutputPointSet> ::GetInput(void) { - if (this->GetNumberOfInputs() < 1) return 0; + if (this->GetNumberOfInputs() < 1) return ITK_NULLPTR; return dynamic_cast<const InputImageType*> (this->ProcessObjectType::GetInput(0)); diff --git a/Modules/Core/PointSet/include/otbPointSetSource.txx b/Modules/Core/PointSet/include/otbPointSetSource.txx index 4ccd106ff1..c5f0dc6842 100644 --- a/Modules/Core/PointSet/include/otbPointSetSource.txx +++ b/Modules/Core/PointSet/include/otbPointSetSource.txx @@ -63,7 +63,7 @@ PointSetSource<TOutputPointSet> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputPointSet*> diff --git a/Modules/Core/PointSet/include/otbPointSetToPointSetFilter.txx b/Modules/Core/PointSet/include/otbPointSetToPointSetFilter.txx index 1444215a5d..358a274e23 100644 --- a/Modules/Core/PointSet/include/otbPointSetToPointSetFilter.txx +++ b/Modules/Core/PointSet/include/otbPointSetToPointSetFilter.txx @@ -85,7 +85,7 @@ typename PointSetToPointSetFilter<TInputPointSet, TOutputPointSet>::InputPointSe PointSetToPointSetFilter<TInputPointSet, TOutputPointSet> ::GetInput(void) { - if (this->GetNumberOfInputs() < 1) return 0; + if (this->GetNumberOfInputs() < 1) return ITK_NULLPTR; return static_cast<InputPointSetType*> (this->ProcessObjectType::GetInput(0)); diff --git a/Modules/Core/SpatialObjects/include/otbLineSpatialObject.h b/Modules/Core/SpatialObjects/include/otbLineSpatialObject.h index 72806900a0..05601adfbd 100644 --- a/Modules/Core/SpatialObjects/include/otbLineSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/otbLineSpatialObject.h @@ -89,14 +89,14 @@ public: /** Returns true if the line is evaluable at the requested point, * false otherwise. */ bool IsEvaluableAt(const PointType& point, - unsigned int depth = 0, char * name = NULL) const ITK_OVERRIDE; + unsigned int depth = 0, char * name = ITK_NULLPTR) const ITK_OVERRIDE; /** Returns the value of the line at that point. * Currently this function returns a binary value, * but it might want to return a degree of membership * in case of fuzzy Lines. */ bool ValueAt(const PointType& point, double& value, - unsigned int depth = 0, char * name = NULL) const ITK_OVERRIDE; + unsigned int depth = 0, char * name = ITK_NULLPTR) const ITK_OVERRIDE; /** Returns true if the point is inside the line, false otherwise. */ bool IsInside(const PointType& point, diff --git a/Modules/Core/SpatialObjects/include/otbLineSpatialObject.txx b/Modules/Core/SpatialObjects/include/otbLineSpatialObject.txx index e8afd0803b..e6cf4a1546 100644 --- a/Modules/Core/SpatialObjects/include/otbLineSpatialObject.txx +++ b/Modules/Core/SpatialObjects/include/otbLineSpatialObject.txx @@ -223,7 +223,7 @@ LineSpatialObject<VDimension> { // otbMsgDevMacro( "Checking the point [" << point << "] is on the Line" ); - if (name == NULL) + if (name == ITK_NULLPTR) { if (IsInside(point)) { diff --git a/Modules/Core/SpatialObjects/include/otbSpatialObjectSource.txx b/Modules/Core/SpatialObjects/include/otbSpatialObjectSource.txx index 56af7dbf0d..a2faa58a69 100644 --- a/Modules/Core/SpatialObjects/include/otbSpatialObjectSource.txx +++ b/Modules/Core/SpatialObjects/include/otbSpatialObjectSource.txx @@ -43,7 +43,7 @@ SpatialObjectSource<TSpatialObject> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<SpatialObjectType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.txx b/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.txx index ebf3d46462..197c704836 100644 --- a/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.txx +++ b/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.txx @@ -82,7 +82,7 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject, TOutputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputSpatialObject *> diff --git a/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx b/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx index 8b0dce603d..757d339e50 100644 --- a/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx +++ b/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx @@ -33,7 +33,7 @@ const double PipelineMemoryPrintCalculator::MegabyteToByte = vcl_pow(2.0, 20); PipelineMemoryPrintCalculator ::PipelineMemoryPrintCalculator() : m_MemoryPrint(0), - m_DataToWrite(NULL), + m_DataToWrite(ITK_NULLPTR), m_BiasCorrectionFactor(1.), m_VisitedProcessObjects() {} diff --git a/Modules/Core/Transform/include/otbCompositeTransform.txx b/Modules/Core/Transform/include/otbCompositeTransform.txx index 70ac7cb5ac..01464e4f2c 100644 --- a/Modules/Core/Transform/include/otbCompositeTransform.txx +++ b/Modules/Core/Transform/include/otbCompositeTransform.txx @@ -40,8 +40,8 @@ CompositeTransform<TFirstTransform, NOutputDimensions> ::CompositeTransform() : Superclass(ParametersDimension) { - m_FirstTransform = 0; - m_SecondTransform = 0; + m_FirstTransform = ITK_NULLPTR; + m_SecondTransform = ITK_NULLPTR; } template<class TFirstTransform, diff --git a/Modules/Core/Transform/include/otbGenericMapProjection.txx b/Modules/Core/Transform/include/otbGenericMapProjection.txx index 8c56ffefaf..11df836313 100644 --- a/Modules/Core/Transform/include/otbGenericMapProjection.txx +++ b/Modules/Core/Transform/include/otbGenericMapProjection.txx @@ -130,7 +130,7 @@ bool GenericMapProjection<TDirectionOfMapping, TScalarType, NInputDimensions, NOutputDimensions> ::IsProjectionDefined() const { - return (m_MapProjection->GetMapProjection() != NULL); + return (m_MapProjection->GetMapProjection() != ITK_NULLPTR); } template<TransformDirection::TransformationDirection TDirectionOfMapping, class TScalarType, unsigned int NInputDimensions, diff --git a/Modules/Core/Transform/include/otbGenericRSTransform.txx b/Modules/Core/Transform/include/otbGenericRSTransform.txx index 56cff2ad98..4d000da9f4 100644 --- a/Modules/Core/Transform/include/otbGenericRSTransform.txx +++ b/Modules/Core/Transform/include/otbGenericRSTransform.txx @@ -43,9 +43,9 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> m_OutputSpacing.Fill(1); m_OutputOrigin.Fill(0); - m_Transform = NULL; - m_InputTransform = NULL; - m_OutputTransform = NULL; + m_Transform = ITK_NULLPTR; + m_InputTransform = ITK_NULLPTR; + m_OutputTransform = ITK_NULLPTR; m_TransformUpToDate = false; m_TransformAccuracy = Projection::UNKNOWN; } @@ -96,8 +96,8 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> otbMsgDevMacro(<< " * Output Spacing: " << m_OutputSpacing); //Make sure that the state is clean: - m_InputTransform = NULL; - m_OutputTransform = NULL; + m_InputTransform = ITK_NULLPTR; + m_OutputTransform = ITK_NULLPTR; bool firstTransformGiveGeo = true; bool inputTransformIsSensor = false; @@ -158,8 +158,8 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> m_InputTransform = itk::IdentityTransform<double, NInputDimensions>::New(); // firstTransformGiveGeo = false; - OGRSpatialReferenceH hSRS = NULL; - hSRS = OSRNewSpatialReference(NULL); + OGRSpatialReferenceH hSRS = ITK_NULLPTR; + hSRS = OSRNewSpatialReference(ITK_NULLPTR); const char * wktString = m_InputProjectionRef.c_str(); if (OSRImportFromWkt(hSRS, (char **) &wktString) != OGRERR_NONE) { @@ -283,7 +283,7 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> ::GetInverse(Self * inverseTransform) const { // Test the inverseTransform pointer - if (inverseTransform == NULL) + if (inverseTransform == ITK_NULLPTR) { return false; } diff --git a/Modules/Core/Transform/src/otbGeoInformationConversion.cxx b/Modules/Core/Transform/src/otbGeoInformationConversion.cxx index 1d1f5e14aa..a12255dc88 100644 --- a/Modules/Core/Transform/src/otbGeoInformationConversion.cxx +++ b/Modules/Core/Transform/src/otbGeoInformationConversion.cxx @@ -29,12 +29,12 @@ namespace otb std::string GeoInformationConversion::ToWKT(int srid) { - char * wkt = NULL; + char * wkt = ITK_NULLPTR; std::string ret; // Build the srs from the epsg number - OGRSpatialReferenceH hSRS = NULL; - hSRS = OSRNewSpatialReference(NULL); + OGRSpatialReferenceH hSRS = ITK_NULLPTR; + hSRS = OSRNewSpatialReference(ITK_NULLPTR); if (OSRImportFromEPSG(hSRS, srid ) == OGRERR_NONE) { diff --git a/Modules/Core/Transform/test/otbCreateProjectionWithOSSIM.cxx b/Modules/Core/Transform/test/otbCreateProjectionWithOSSIM.cxx index 4fad71c80e..80b94814ec 100644 --- a/Modules/Core/Transform/test/otbCreateProjectionWithOSSIM.cxx +++ b/Modules/Core/Transform/test/otbCreateProjectionWithOSSIM.cxx @@ -82,9 +82,9 @@ int otbCreateProjectionWithOSSIM(int argc, char* argv[]) ossimGpt ossimGPoint(0, 0); ossimDpt ossimDPoint; otbGenericMsgDebugMacro(<< "Creating projection..."); - ossimProjection * model = NULL; + ossimProjection * model = ITK_NULLPTR; model = ossimProjectionFactoryRegistry::instance()->createProjection(geom); - if (model == NULL) + if (model == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Invalid Model * == NULL !"); } diff --git a/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx b/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx index ef4ab4c021..8b7d5a4694 100644 --- a/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx +++ b/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx @@ -87,10 +87,10 @@ int otbCreateProjectionWithOTB(int argc, char* argv[]) ossimGpt ossimGPoint(0, 0); ossimDpt ossimDPoint; - ossimProjection * model = NULL; + ossimProjection * model = ITK_NULLPTR; otbGenericMsgDebugMacro(<< "Creating projection..."); model = ossimProjectionFactoryRegistry::instance()->createProjection(geom); - if (model == NULL) + if (model == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Invalid Model * == NULL !"); } diff --git a/Modules/Core/Transform/test/otbGenericRSTransform.cxx b/Modules/Core/Transform/test/otbGenericRSTransform.cxx index 44bd55b12c..2899c5e20f 100644 --- a/Modules/Core/Transform/test/otbGenericRSTransform.cxx +++ b/Modules/Core/Transform/test/otbGenericRSTransform.cxx @@ -38,13 +38,13 @@ int otbGenericRSTransform(int itkNotUsed(argc), char* argv[]) // Build wgs ref oSRS.SetWellKnownGeogCS("WGS84"); - char * wgsRef = NULL; + char * wgsRef = ITK_NULLPTR; oSRS.exportToWkt(&wgsRef); // Build UTM ref oSRS.SetProjCS("UTM"); oSRS.SetUTM(31, true); - char * utmRef = NULL; + char * utmRef = ITK_NULLPTR; oSRS.exportToWkt(&utmRef); // Build Lambert II ref @@ -56,7 +56,7 @@ int otbGenericRSTransform(int itkNotUsed(argc), char* argv[]) double falseNorthingL2 = 2200000; oSRS.SetProjCS("Lambert II "); oSRS.SetLCC(stdParallel1, stdParallel2, originLatL2, originLongL2, falseEastingL2, falseNorthingL2); - char * lambertRef = NULL; + char * lambertRef = ITK_NULLPTR; oSRS.exportToWkt(&lambertRef); // Build the Transmercator ref @@ -66,7 +66,7 @@ int otbGenericRSTransform(int itkNotUsed(argc), char* argv[]) oSRS.SetProjCS("Transmercator "); oSRS.SetWellKnownGeogCS("WGS84"); oSRS.SetTM(originLatTmt, originLongTmt, 1, 0, 0); - char * tmtRef = NULL; + char * tmtRef = ITK_NULLPTR; oSRS.exportToWkt(&tmtRef); TransformType::Pointer wgs2utm = TransformType::New(); diff --git a/Modules/Core/Transform/test/otbGenericRSTransformWithSRID.cxx b/Modules/Core/Transform/test/otbGenericRSTransformWithSRID.cxx index 811e32d1b4..40474c4bed 100644 --- a/Modules/Core/Transform/test/otbGenericRSTransformWithSRID.cxx +++ b/Modules/Core/Transform/test/otbGenericRSTransformWithSRID.cxx @@ -50,7 +50,7 @@ int otbGenericRSTransformWithSRID(int itkNotUsed(argc), char* argv[]) double falseNorthingL2 = 2200000; oSRS.SetProjCS("Lambert II "); oSRS.SetLCC(stdParallel1, stdParallel2, originLatL2, originLongL2, falseEastingL2, falseNorthingL2); - char * lambertRef = NULL; + char * lambertRef = ITK_NULLPTR; oSRS.exportToWkt(&lambertRef); // Build the Transmercator ref @@ -60,7 +60,7 @@ int otbGenericRSTransformWithSRID(int itkNotUsed(argc), char* argv[]) oSRS.SetProjCS("Transmercator "); oSRS.SetWellKnownGeogCS("WGS84"); oSRS.SetTM(originLatTmt, originLongTmt, 1, 0, 0); - char * tmtRef = NULL; + char * tmtRef = ITK_NULLPTR; oSRS.exportToWkt(&tmtRef); TransformType::Pointer wgs2utm = TransformType::New(); diff --git a/Modules/Core/VectorDataBase/include/otbDataNode.txx b/Modules/Core/VectorDataBase/include/otbDataNode.txx index d6b0136697..191ba431a0 100644 --- a/Modules/Core/VectorDataBase/include/otbDataNode.txx +++ b/Modules/Core/VectorDataBase/include/otbDataNode.txx @@ -602,7 +602,7 @@ DataNode<TPrecision, VDimension, TValuePrecision> default: break; } - return NULL; + return ITK_NULLPTR; } template <class TPrecision, unsigned int VDimension, class TValuePrecision> diff --git a/Modules/Core/VectorDataBase/include/otbDataNodeImageFunction.txx b/Modules/Core/VectorDataBase/include/otbDataNodeImageFunction.txx index 1531e7ee77..22746aa1fe 100644 --- a/Modules/Core/VectorDataBase/include/otbDataNodeImageFunction.txx +++ b/Modules/Core/VectorDataBase/include/otbDataNodeImageFunction.txx @@ -30,7 +30,7 @@ template <class TImage, class TOutput, class TCoordRep, class TPrecision> DataNodeImageFunction<TImage, TOutput, TCoordRep, TPrecision> ::DataNodeImageFunction() { - m_Image = NULL; + m_Image = ITK_NULLPTR; m_StartIndex.Fill(0); m_EndIndex.Fill(0); m_StartContinuousIndex.Fill(0.0f); diff --git a/Modules/Core/VectorDataBase/include/otbDataNodeVectorDataFunction.txx b/Modules/Core/VectorDataBase/include/otbDataNodeVectorDataFunction.txx index cba0ab4013..64c338b449 100644 --- a/Modules/Core/VectorDataBase/include/otbDataNodeVectorDataFunction.txx +++ b/Modules/Core/VectorDataBase/include/otbDataNodeVectorDataFunction.txx @@ -30,7 +30,7 @@ template <class TOutput, class TCoordRep, class TPrecision> DataNodeVectorDataFunction<TOutput, TCoordRep, TPrecision> ::DataNodeVectorDataFunction() { - m_VectorData = NULL; + m_VectorData = ITK_NULLPTR; } diff --git a/Modules/Core/VectorDataBase/include/otbVectorDataIOBase.h b/Modules/Core/VectorDataBase/include/otbVectorDataIOBase.h index 26314b498f..ae857e67d7 100644 --- a/Modules/Core/VectorDataBase/include/otbVectorDataIOBase.h +++ b/Modules/Core/VectorDataBase/include/otbVectorDataIOBase.h @@ -144,7 +144,7 @@ public: /** Writes the data to disk from the memory buffer provided. Make sure * that the IORegions has been set properly. The buffer is cast to a * pointer to the beginning of the image data. */ - virtual void Write(const itk::DataObject* data, char ** papszOptions = NULL) = 0; + virtual void Write(const itk::DataObject* data, char ** papszOptions = ITK_NULLPTR) = 0; protected: VectorDataIOBase(); diff --git a/Modules/Core/VectorDataBase/include/otbVectorDataProperties.h b/Modules/Core/VectorDataBase/include/otbVectorDataProperties.h index 41cd90dd4d..3a0b71ee0b 100644 --- a/Modules/Core/VectorDataBase/include/otbVectorDataProperties.h +++ b/Modules/Core/VectorDataBase/include/otbVectorDataProperties.h @@ -81,7 +81,7 @@ public: void ComputeBoundingRegion(); protected: /** Constructor */ - VectorDataProperties() : m_VectorDataObject(NULL) {}; + VectorDataProperties() : m_VectorDataObject(ITK_NULLPTR) {}; /** Destructor */ ~VectorDataProperties() ITK_OVERRIDE {} /**PrintSelf method */ diff --git a/Modules/Core/VectorDataBase/include/otbVectorDataSource.txx b/Modules/Core/VectorDataBase/include/otbVectorDataSource.txx index 4940d52ab4..ea56e45eb2 100644 --- a/Modules/Core/VectorDataBase/include/otbVectorDataSource.txx +++ b/Modules/Core/VectorDataBase/include/otbVectorDataSource.txx @@ -107,7 +107,7 @@ VectorDataSource<TOutputVectorData> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputVectorDataType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Core/VectorDataBase/src/otbVectorDataKeywordlist.cxx b/Modules/Core/VectorDataBase/src/otbVectorDataKeywordlist.cxx index 90737a9d85..c90712c0f1 100644 --- a/Modules/Core/VectorDataBase/src/otbVectorDataKeywordlist.cxx +++ b/Modules/Core/VectorDataBase/src/otbVectorDataKeywordlist.cxx @@ -458,7 +458,7 @@ VectorDataKeywordlist } case OFTString: { - if (field.second.String != NULL) + if (field.second.String != ITK_NULLPTR) { output << field.second.String; } @@ -522,7 +522,7 @@ VectorDataKeywordlist } case OFTString: { - if (field.second.String != NULL) + if (field.second.String != ITK_NULLPTR) { CPLFree(outField.second.String); outField.second.String = CPLStrdup(field.second.String); diff --git a/Modules/Core/VectorDataBase/test/otbPolygon.cxx b/Modules/Core/VectorDataBase/test/otbPolygon.cxx index 73b5639e27..19068b6c18 100644 --- a/Modules/Core/VectorDataBase/test/otbPolygon.cxx +++ b/Modules/Core/VectorDataBase/test/otbPolygon.cxx @@ -37,7 +37,7 @@ int otbPolygon(int itkNotUsed(argc), char * argv[]) // Reading vertices from command line int cpt = 2; bool first = true; - while (argv[cpt] != NULL && argv[cpt + 1] != NULL) + while (argv[cpt] != ITK_NULLPTR && argv[cpt + 1] != ITK_NULLPTR) { if (argv[cpt][0] == 'n') { diff --git a/Modules/Detection/ObjectDetection/include/otbLabeledSampleLocalizationGenerator.txx b/Modules/Detection/ObjectDetection/include/otbLabeledSampleLocalizationGenerator.txx index 9693e7dbf2..03e8e30081 100644 --- a/Modules/Detection/ObjectDetection/include/otbLabeledSampleLocalizationGenerator.txx +++ b/Modules/Detection/ObjectDetection/include/otbLabeledSampleLocalizationGenerator.txx @@ -69,7 +69,7 @@ LabeledSampleLocalizationGenerator<TVectorData> { if (this->GetNumberOfInputs() < idx) { - return 0; + return ITK_NULLPTR; } return static_cast<const VectorDataType *>(this->Superclass::GetInput(idx)); diff --git a/Modules/Detection/RoadExtraction/include/otbLikelihoodPathListFilter.txx b/Modules/Detection/RoadExtraction/include/otbLikelihoodPathListFilter.txx index 33d2865bb1..d2b03ac77b 100644 --- a/Modules/Detection/RoadExtraction/include/otbLikelihoodPathListFilter.txx +++ b/Modules/Detection/RoadExtraction/include/otbLikelihoodPathListFilter.txx @@ -50,7 +50,7 @@ LikelihoodPathListFilter<TPath, TImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Detection/RoadExtraction/include/otbModulusAndDirectionImageToImageFilter.txx b/Modules/Detection/RoadExtraction/include/otbModulusAndDirectionImageToImageFilter.txx index 7aaf57768a..6d9cbf320d 100644 --- a/Modules/Detection/RoadExtraction/include/otbModulusAndDirectionImageToImageFilter.txx +++ b/Modules/Detection/RoadExtraction/include/otbModulusAndDirectionImageToImageFilter.txx @@ -67,7 +67,7 @@ GetInput(void) { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *> @@ -83,7 +83,7 @@ GetInputDirection(void) { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImageDirection *> diff --git a/Modules/Detection/RoadExtraction/test/otbAlignImageToPath.cxx b/Modules/Detection/RoadExtraction/test/otbAlignImageToPath.cxx index 2f0998969c..9a36942b3f 100644 --- a/Modules/Detection/RoadExtraction/test/otbAlignImageToPath.cxx +++ b/Modules/Detection/RoadExtraction/test/otbAlignImageToPath.cxx @@ -108,7 +108,7 @@ int otbAlignImageToPath(int itkNotUsed(argc), char * argv[]) otbGenericMsgDebugMacro(<< "Writing :"); FILE *file = fopen(outputFilename, "w"); - if (file == NULL) + if (file == ITK_NULLPTR) { fprintf(stderr, "Error, can't open file"); exit(-1); diff --git a/Modules/Detection/RoadExtraction/test/otbBreakAngularPathListFilter.cxx b/Modules/Detection/RoadExtraction/test/otbBreakAngularPathListFilter.cxx index f523961ba4..c6426993e3 100644 --- a/Modules/Detection/RoadExtraction/test/otbBreakAngularPathListFilter.cxx +++ b/Modules/Detection/RoadExtraction/test/otbBreakAngularPathListFilter.cxx @@ -45,7 +45,7 @@ int otbBreakAngularPathListFilter(int itkNotUsed(argc), char * argv[]) ++cpt; ListPoints.clear(); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { if (argv[cpt][0] == '|') { diff --git a/Modules/Detection/RoadExtraction/test/otbLikelihoodPathListFilter.cxx b/Modules/Detection/RoadExtraction/test/otbLikelihoodPathListFilter.cxx index 6a7334b1fb..c9b6e495c2 100644 --- a/Modules/Detection/RoadExtraction/test/otbLikelihoodPathListFilter.cxx +++ b/Modules/Detection/RoadExtraction/test/otbLikelihoodPathListFilter.cxx @@ -39,7 +39,7 @@ int otbLikelihoodPathListFilter(int itkNotUsed(argc), char * argv[]) int cpt = 3; ListPoints.clear(); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { if (argv[cpt][0] == '|') { diff --git a/Modules/Detection/RoadExtraction/test/otbLinkPathListFilter.cxx b/Modules/Detection/RoadExtraction/test/otbLinkPathListFilter.cxx index d9d5719803..5cdee745ed 100644 --- a/Modules/Detection/RoadExtraction/test/otbLinkPathListFilter.cxx +++ b/Modules/Detection/RoadExtraction/test/otbLinkPathListFilter.cxx @@ -40,7 +40,7 @@ int otbLinkPathListFilter(int itkNotUsed(argc), char * argv[]) int cpt = 4; ListPoints.clear(); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { if (argv[cpt][0] == '|') { diff --git a/Modules/Detection/RoadExtraction/test/otbRemoveTortuousPathListFilter.cxx b/Modules/Detection/RoadExtraction/test/otbRemoveTortuousPathListFilter.cxx index 0e9f47db6d..388a709c0b 100644 --- a/Modules/Detection/RoadExtraction/test/otbRemoveTortuousPathListFilter.cxx +++ b/Modules/Detection/RoadExtraction/test/otbRemoveTortuousPathListFilter.cxx @@ -35,7 +35,7 @@ int otbRemoveTortuousPathListFilter(int itkNotUsed(argc), char * argv[]) int cpt = 3; ListPoints.clear(); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { if (argv[cpt][0] == '|') { diff --git a/Modules/Detection/RoadExtraction/test/otbSimplifyPathListFilter.cxx b/Modules/Detection/RoadExtraction/test/otbSimplifyPathListFilter.cxx index 52db85ed5b..a5265309a4 100644 --- a/Modules/Detection/RoadExtraction/test/otbSimplifyPathListFilter.cxx +++ b/Modules/Detection/RoadExtraction/test/otbSimplifyPathListFilter.cxx @@ -35,7 +35,7 @@ int otbSimplifyPathListFilter(int itkNotUsed(argc), char * argv[]) int cpt = 3; ListPoints.clear(); - while (argv[cpt] != NULL) + while (argv[cpt] != ITK_NULLPTR) { if (argv[cpt][0] == '|') { diff --git a/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputAscii.cxx b/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputAscii.cxx index 5747f57e4f..2e81edd548 100644 --- a/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputAscii.cxx +++ b/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputAscii.cxx @@ -66,7 +66,7 @@ int otbImageToSIFTKeyPointSetFilterOutputAscii(int itkNotUsed(argc), char * argv filter->Update(); PointsIteratorType pIt = filter->GetOutput()->GetPoints()->Begin(); - if (filter->GetOutput()->GetPointData() == NULL) + if (filter->GetOutput()->GetPointData() == ITK_NULLPTR) { std::cerr << "No sift point found!" << std::endl; return EXIT_FAILURE; //Avoid the subsequent segfault, but need to check if that what the test want to do diff --git a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.txx b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.txx index eefe6b3aa6..c832c54290 100644 --- a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.txx +++ b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.txx @@ -50,7 +50,7 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> m_Variance = 5; m_OldModifiedTime = 0; m_OldNumberOfLines = 0; - m_SimplifyAccumulator = NULL; + m_SimplifyAccumulator = ITK_NULLPTR; } template<typename TInputPixelType, typename TOutputPixelType> diff --git a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.txx b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.txx index e60a2c7246..c945446287 100644 --- a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.txx +++ b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.txx @@ -290,11 +290,11 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In // Contains for the 4 directions the the pixels belonging to each zone //std::vector<double> PixelValues[NB_DIR][NB_ZONE]; // ROMAIN - std::vector<double>** PixelValues = NULL; + std::vector<double>** PixelValues = ITK_NULLPTR; PixelValues = new std::vector<double>*[NB_DIR]; for (unsigned int i = 0; i < NB_DIR; ++i) { - PixelValues[i] = NULL; + PixelValues[i] = ITK_NULLPTR; PixelValues[i] = new std::vector<double>[NB_ZONE]; } //otbMsgDevMacro( << "\tCentre Xc/Yc="<<Xc<<" "<<Yc<<" Yc12/Yc13="<<Yc12<<" "<<Yc13); @@ -377,10 +377,10 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In for (unsigned int i = 0; i < NB_DIR; ++i) { delete[] PixelValues[i]; - PixelValues[i] = NULL; + PixelValues[i] = ITK_NULLPTR; } delete[] PixelValues; - PixelValues = NULL; + PixelValues = ITK_NULLPTR; } } diff --git a/Modules/Feature/Edge/include/otbLineSegmentDetector.txx b/Modules/Feature/Edge/include/otbLineSegmentDetector.txx index f7c08df38c..e3eea277d0 100644 --- a/Modules/Feature/Edge/include/otbLineSegmentDetector.txx +++ b/Modules/Feature/Edge/include/otbLineSegmentDetector.txx @@ -77,7 +77,7 @@ LineSegmentDetector<TInputImage, TPrecision> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(0)); diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.txx b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.txx index aa453b206f..42864f631b 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.txx +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.txx @@ -69,7 +69,7 @@ PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *> @@ -84,7 +84,7 @@ PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *> diff --git a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.txx b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.txx index be677eb689..670e5c643c 100644 --- a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.txx +++ b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.txx @@ -76,7 +76,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[0] == false) { @@ -108,7 +108,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[1] == false) { @@ -140,7 +140,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 3) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[2] == false) { @@ -173,7 +173,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 4) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[3] == false) { @@ -205,7 +205,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 5) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[4] == false) { @@ -237,7 +237,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 6) { - return 0; + return ITK_NULLPTR; } if (this->GetTexturesStatus()[5] == false) { diff --git a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.txx b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.txx index cdf84808e9..e0463ab5c8 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.txx +++ b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.txx @@ -66,7 +66,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(0)); } @@ -79,7 +79,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(1)); } @@ -92,7 +92,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 3) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(2)); } @@ -105,7 +105,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 4) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(3)); } @@ -118,7 +118,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 5) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(4)); } @@ -131,7 +131,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 6) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(5)); } @@ -144,7 +144,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 7) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(6)); } @@ -157,7 +157,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 8) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(7)); } @@ -170,7 +170,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 9) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(8)); } @@ -183,7 +183,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 10) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(9)); } diff --git a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.txx b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.txx index 7e3c6bd181..66d4a4b65a 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.txx +++ b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.txx @@ -86,7 +86,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(0)); } @@ -99,7 +99,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(1)); } @@ -112,7 +112,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 3) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(2)); } @@ -125,7 +125,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 4) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(3)); } @@ -138,7 +138,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 5) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(4)); } @@ -151,7 +151,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 6) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(5)); } @@ -164,7 +164,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 7) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(6)); } @@ -177,7 +177,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 8) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(7)); } @@ -190,7 +190,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 9) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(8)); } @@ -203,7 +203,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 10) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(9)); } @@ -216,7 +216,7 @@ ScalarImageToHigherOrderTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 11) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(10)); } diff --git a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.txx b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.txx index 0e70914b73..7607041871 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.txx +++ b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.txx @@ -67,7 +67,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(0)); } @@ -80,7 +80,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(1)); } @@ -93,7 +93,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 3) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(2)); } @@ -106,7 +106,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 4) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(3)); } @@ -119,7 +119,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 5) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(4)); } @@ -132,7 +132,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 6) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(5)); } @@ -145,7 +145,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 7) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(6)); } @@ -158,7 +158,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 8) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->GetOutput(7)); } diff --git a/Modules/Feature/Textures/test/otbScalarImageToHigherOrderTexturesFilter.cxx b/Modules/Feature/Textures/test/otbScalarImageToHigherOrderTexturesFilter.cxx index a72f059f04..8f120fa87e 100644 --- a/Modules/Feature/Textures/test/otbScalarImageToHigherOrderTexturesFilter.cxx +++ b/Modules/Feature/Textures/test/otbScalarImageToHigherOrderTexturesFilter.cxx @@ -218,15 +218,15 @@ int otbScalarImageToHigherOrderTexturesFilter(int argc, char * argv[]) std::cout << "Testing radius = " << radius << " and default offsets" << std::endl; ImageType::Pointer inputImage = ReadInputImage(infname); - std::vector<ImageType::Pointer> results = Compute(inputImage, nbBins, radius, 0); + std::vector<ImageType::Pointer> results = Compute(inputImage, nbBins, radius, ITK_NULLPTR); - if ( ValidateAt(inputImage, results, nbBins, radius, 0, 7, 11) == EXIT_FAILURE ) + if ( ValidateAt(inputImage, results, nbBins, radius, ITK_NULLPTR, 7, 11) == EXIT_FAILURE ) return EXIT_FAILURE; - if ( ValidateAt(inputImage, results, nbBins, radius, 0, 5, 5) == EXIT_FAILURE ) + if ( ValidateAt(inputImage, results, nbBins, radius, ITK_NULLPTR, 5, 5) == EXIT_FAILURE ) return EXIT_FAILURE; - if ( ValidateAt(inputImage, results, nbBins, radius, 0, 7, 11) == EXIT_FAILURE ) + if ( ValidateAt(inputImage, results, nbBins, radius, ITK_NULLPTR, 7, 11) == EXIT_FAILURE ) return EXIT_FAILURE; - if ( ValidateAt(inputImage, results, nbBins, radius, 0, 10, 5) == EXIT_FAILURE ) + if ( ValidateAt(inputImage, results, nbBins, radius, ITK_NULLPTR, 10, 5) == EXIT_FAILURE ) return EXIT_FAILURE; } diff --git a/Modules/Filtering/ChangeDetection/include/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx b/Modules/Filtering/ChangeDetection/include/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx index e59b380649..101b289b57 100644 --- a/Modules/Filtering/ChangeDetection/include/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx +++ b/Modules/Filtering/ChangeDetection/include/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx @@ -74,7 +74,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage1 *>(this->itk::ProcessObject::GetInput(0)); } @@ -87,7 +87,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage2 *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.txx b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.txx index b5f9234106..3c454f851d 100644 --- a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.txx +++ b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.txx @@ -33,8 +33,8 @@ template <class TInput1, class TInput2, class TInputROIImage, class TOutput> KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> ::KullbackLeiblerSupervizedDistance () { - m_CumROI1 = NULL; - m_CumROI2 = NULL; + m_CumROI1 = ITK_NULLPTR; + m_CumROI2 = ITK_NULLPTR; } template <class TInput1, class TInput2, class TInputROIImage, class TOutput> @@ -42,10 +42,10 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> ::~KullbackLeiblerSupervizedDistance () { delete m_CumROI1; - m_CumROI1 = NULL; + m_CumROI1 = ITK_NULLPTR; delete m_CumROI2; - m_CumROI2 = NULL; + m_CumROI2 = ITK_NULLPTR; } template <class TInput1, class TInput2, class TInputROIImage, class TOutput> @@ -66,7 +66,7 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> conversion1->SetROIImage(imgROI); conversion1->Update(); - if (m_CumROI1 != NULL) delete m_CumROI1; + if (m_CumROI1 != ITK_NULLPTR) delete m_CumROI1; m_CumROI1 = new CumulantsForEdgeworth<ROIInputType1> (conversion1->GetOutput()); @@ -89,7 +89,7 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> conversion2->SetROIImage(imgROI); conversion2->Update(); - if (m_CumROI2 != NULL) delete m_CumROI2; + if (m_CumROI2 != ITK_NULLPTR) delete m_CumROI2; m_CumROI2 = new CumulantsForEdgeworth<ROIInputType2> (conversion2->GetOutput()); diff --git a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.txx b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.txx index 24190c3eb4..6080c210dc 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.txx +++ b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.txx @@ -54,7 +54,7 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -76,7 +76,7 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.txx b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.txx index fc3110f25f..8e1d2702bd 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.txx +++ b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.txx @@ -56,7 +56,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > { if ( this->GetNumberOfInputs() < 1 ) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage * > (this->itk::ProcessObject::GetInput(0) ); @@ -69,7 +69,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > { if ( this->GetNumberOfInputs() < 2 ) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage * > (this->itk::ProcessObject::GetInput(1)); diff --git a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.txx b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.txx index 33cf38a13a..a6ce735a83 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.txx +++ b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.txx @@ -50,7 +50,7 @@ AngularProjectionImageFilter< TInputImage, TOutputImage, TAngleArray, TPrecision { if ( i >= this->GetNumberOfInputs() ) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType * > diff --git a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionSetImageFilter.txx b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionSetImageFilter.txx index fd98c1b942..5b138d768f 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionSetImageFilter.txx +++ b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionSetImageFilter.txx @@ -53,7 +53,7 @@ AngularProjectionSetImageFilter< TInputImage, TOutputImage, TAngleList, TPrecisi { if ( i >= this->GetNumberOfInputs() ) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType * > diff --git a/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.txx b/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.txx index c99bedf39a..35c966a414 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.txx +++ b/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.txx @@ -55,7 +55,7 @@ SparseWvltToAngleMapperListFilter< TInputImageList, TOutputSampleList, VNbInputI { if ( i >= this->GetNumberOfInputs() ) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageListType * > diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.txx b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.txx index d5e13ccf18..b3169949d8 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.txx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.txx @@ -72,7 +72,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage1 *>(this->itk::ProcessObject::GetInput(0)); } @@ -85,7 +85,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage2 *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.txx b/Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.txx index d56a694eda..6f694fccc8 100644 --- a/Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.txx +++ b/Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.txx @@ -75,7 +75,7 @@ ChangeInformationImageFilter<TInputImage> // enable this key for metadata change m_ChangedKeys.insert(key); itk::MetaDataDictionary &dict = this->GetMetaDataDictionary(); - if (value == NULL) + if (value == ITK_NULLPTR) { // Remove meta-data from dictionary this->RemoveKeyFromDictionary(dict,key); diff --git a/Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx b/Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx index c4c0fed42b..ce75332a0e 100644 --- a/Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx +++ b/Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx @@ -31,7 +31,7 @@ MaskedIteratorDecorator<TIteratorType,TMaskIteratorType> const RegionType& region) { m_ItImage = TIteratorType(image,region); - if (mask == NULL) + if (mask == ITK_NULLPTR) { m_UseMask = false; } diff --git a/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.txx b/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.txx index 407fa2350b..ad4143123d 100644 --- a/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.txx +++ b/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.txx @@ -80,7 +80,7 @@ PrintableImageFilter<TInputImage, TMaskImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.h index eab69d6aa1..bb7f8efcf4 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.h @@ -148,7 +148,7 @@ public: { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } else return (static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0))); } @@ -157,7 +157,7 @@ public: { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } else return (static_cast<const TInputImage2 *>(this->itk::ProcessObject::GetInput(1))); } diff --git a/Modules/Filtering/ImageManipulation/test/otbChangeInformationImageFilter.cxx b/Modules/Filtering/ImageManipulation/test/otbChangeInformationImageFilter.cxx index 2a6a7e2a90..d3a6c078f5 100644 --- a/Modules/Filtering/ImageManipulation/test/otbChangeInformationImageFilter.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbChangeInformationImageFilter.cxx @@ -36,7 +36,7 @@ int otbChangeInformationImageFilter(int itkNotUsed(argc), char * argv[]) std::string newProj("Fake ProjRef"); filter->SetOutputMetaData<std::string>(otb::MetaDataKey::ProjectionRefKey,&newProj); // erase that choice - filter->SetOutputMetaData<std::string>(otb::MetaDataKey::ProjectionRefKey,NULL); + filter->SetOutputMetaData<std::string>(otb::MetaDataKey::ProjectionRefKey,ITK_NULLPTR); // add a no data to the image std::vector<bool> flags; flags.push_back(true); diff --git a/Modules/Filtering/ImageManipulation/test/otbMaskedIteratorDecorator.cxx b/Modules/Filtering/ImageManipulation/test/otbMaskedIteratorDecorator.cxx index 37f7a18c14..d93396d495 100644 --- a/Modules/Filtering/ImageManipulation/test/otbMaskedIteratorDecorator.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbMaskedIteratorDecorator.cxx @@ -345,12 +345,12 @@ int otbMaskedIteratorDecoratorExtended(int itkNotUsed(argc), char * itkNotUsed(a std::cout << std::endl << "itk::ImageRegionIterator without mask: "; ret = TripleTest< itk::ImageRegionIterator<ImageType>, - itk::ImageRegionIterator<MaskType> >(image, NULL, region); + itk::ImageRegionIterator<MaskType> >(image, ITK_NULLPTR, region); retGlobal = (ret == EXIT_FAILURE ? EXIT_FAILURE : retGlobal); std::cout << std::endl << "itk::ImageRegionConstIterator without mask: "; ret = TripleTest< itk::ImageRegionConstIterator<ImageType>, - itk::ImageRegionConstIterator<MaskType> >(image, NULL, region); + itk::ImageRegionConstIterator<MaskType> >(image, ITK_NULLPTR, region); retGlobal = (ret == EXIT_FAILURE ? EXIT_FAILURE : retGlobal); return retGlobal; diff --git a/Modules/Filtering/ImageManipulation/test/otbRegionProjectionResampler.cxx b/Modules/Filtering/ImageManipulation/test/otbRegionProjectionResampler.cxx index 4984bdad5f..acbbbdb90c 100644 --- a/Modules/Filtering/ImageManipulation/test/otbRegionProjectionResampler.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbRegionProjectionResampler.cxx @@ -107,8 +107,8 @@ int otbRegionProjectionResampler(int argc, char* argv[]) spacing[0] = atof(argv[8]); spacing[1] = atof(argv[9]); - origin[0] = strtod(argv[3], NULL); // origin longitude. - origin[1] = strtod(argv[4], NULL); // origin latitude. + origin[0] = strtod(argv[3], ITK_NULLPTR); // origin longitude. + origin[1] = strtod(argv[4], ITK_NULLPTR); // origin latitude. otbGenericMsgDebugMacro(<< "Origin " << origin); diff --git a/Modules/Filtering/Path/include/otbDrawPathListFilter.txx b/Modules/Filtering/Path/include/otbDrawPathListFilter.txx index 0b60c2a688..ebfca07e0a 100644 --- a/Modules/Filtering/Path/include/otbDrawPathListFilter.txx +++ b/Modules/Filtering/Path/include/otbDrawPathListFilter.txx @@ -56,7 +56,7 @@ DrawPathListFilter<TInputImage, TInputPath, TOutputImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputPathListType *>(this->ProcessObjectType::GetInput(1)); } diff --git a/Modules/Filtering/Path/include/otbImageFittingPolygonListFilter.txx b/Modules/Filtering/Path/include/otbImageFittingPolygonListFilter.txx index baf4292944..89943767c0 100644 --- a/Modules/Filtering/Path/include/otbImageFittingPolygonListFilter.txx +++ b/Modules/Filtering/Path/include/otbImageFittingPolygonListFilter.txx @@ -53,7 +53,7 @@ ImageFittingPolygonListFilter<TPath, TImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/Path/include/otbImageToPathListFilter.txx b/Modules/Filtering/Path/include/otbImageToPathListFilter.txx index df505f0a59..b67b226f89 100644 --- a/Modules/Filtering/Path/include/otbImageToPathListFilter.txx +++ b/Modules/Filtering/Path/include/otbImageToPathListFilter.txx @@ -58,7 +58,7 @@ ImageToPathListFilter<TInputImage, TOutputPath> if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *> diff --git a/Modules/Filtering/Path/include/otbPathFunction.txx b/Modules/Filtering/Path/include/otbPathFunction.txx index 43ee43a072..971f458745 100644 --- a/Modules/Filtering/Path/include/otbPathFunction.txx +++ b/Modules/Filtering/Path/include/otbPathFunction.txx @@ -30,7 +30,7 @@ template <class TInputPath, class TOutput> PathFunction<TInputPath, TOutput> ::PathFunction() { - m_Path = NULL; + m_Path = ITK_NULLPTR; } /** diff --git a/Modules/Filtering/Path/include/otbPathListToHistogramGenerator.txx b/Modules/Filtering/Path/include/otbPathListToHistogramGenerator.txx index 35f6302317..850b32dea3 100644 --- a/Modules/Filtering/Path/include/otbPathListToHistogramGenerator.txx +++ b/Modules/Filtering/Path/include/otbPathListToHistogramGenerator.txx @@ -53,7 +53,7 @@ PathListToHistogramGenerator<TPath, TFunction> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const PathListType* > (this->itk::ProcessObject::GetInput(0) ); diff --git a/Modules/Filtering/Path/include/otbVectorizationPathListFilter.txx b/Modules/Filtering/Path/include/otbVectorizationPathListFilter.txx index 038ceb4bb2..ef7c42fe40 100644 --- a/Modules/Filtering/Path/include/otbVectorizationPathListFilter.txx +++ b/Modules/Filtering/Path/include/otbVectorizationPathListFilter.txx @@ -52,7 +52,7 @@ VectorizationPathListFilter<TInputModulus, TInputDirection, TOutputPath> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputModulus*>(this->itk::ProcessObject::GetInput(0)); } @@ -73,7 +73,7 @@ VectorizationPathListFilter<TInputModulus, TInputDirection, TOutputPath> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputDirection *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Filtering/Path/test/otbRegionImageToRectangularPathListFilter.cxx b/Modules/Filtering/Path/test/otbRegionImageToRectangularPathListFilter.cxx index e088c294b2..a42753cdeb 100644 --- a/Modules/Filtering/Path/test/otbRegionImageToRectangularPathListFilter.cxx +++ b/Modules/Filtering/Path/test/otbRegionImageToRectangularPathListFilter.cxx @@ -62,7 +62,7 @@ int otbRegionImageToRectangularPathListFilter(int itkNotUsed(argc), char * argv[ ListType::Iterator listIt = pathList->Begin(); FILE *file = fopen(outputFilename, "w"); - if (file == NULL) + if (file == ITK_NULLPTR) { fprintf(stderr, "Error, can't open file"); exit(-1); diff --git a/Modules/Filtering/Polarimetry/test/otbMultiChannelsPolarimetricSynthesisFilter.cxx b/Modules/Filtering/Polarimetry/test/otbMultiChannelsPolarimetricSynthesisFilter.cxx index dab9e4dd1c..8f13439f10 100644 --- a/Modules/Filtering/Polarimetry/test/otbMultiChannelsPolarimetricSynthesisFilter.cxx +++ b/Modules/Filtering/Polarimetry/test/otbMultiChannelsPolarimetricSynthesisFilter.cxx @@ -34,10 +34,10 @@ int otbMultiChannelsPolarimetricSynthesisFilter(int itkNotUsed(argc), char * arg const char * outputFilename = argv[4]; - double PsiI = strtod(argv[5], NULL); - double KhiI = strtod(argv[6], NULL); - double PsiR = strtod(argv[7], NULL); - double KhiR = strtod(argv[8], NULL); + double PsiI = strtod(argv[5], ITK_NULLPTR); + double KhiI = strtod(argv[6], ITK_NULLPTR); + double PsiR = strtod(argv[7], ITK_NULLPTR); + double KhiR = strtod(argv[8], ITK_NULLPTR); typedef std::complex <double> InputPixelType; typedef double OutputPixelType; diff --git a/Modules/Filtering/Polarimetry/test/otbVectorMultiChannelsPolarimetricSynthesisFilter.cxx b/Modules/Filtering/Polarimetry/test/otbVectorMultiChannelsPolarimetricSynthesisFilter.cxx index 66fa248109..61b4c6a959 100644 --- a/Modules/Filtering/Polarimetry/test/otbVectorMultiChannelsPolarimetricSynthesisFilter.cxx +++ b/Modules/Filtering/Polarimetry/test/otbVectorMultiChannelsPolarimetricSynthesisFilter.cxx @@ -31,10 +31,10 @@ int otbVectorMultiChannelsPolarimetricSynthesisFilter(int itkNotUsed(argc), char const char * inputFilename = argv[1]; const char * outputFilename = argv[2]; - double PsiI = strtod(argv[3], NULL); - double KhiI = strtod(argv[4], NULL); - double PsiR = strtod(argv[5], NULL); - double KhiR = strtod(argv[6], NULL); + double PsiI = strtod(argv[3], ITK_NULLPTR); + double KhiI = strtod(argv[4], ITK_NULLPTR); + double PsiR = strtod(argv[5], ITK_NULLPTR); + double KhiR = strtod(argv[6], ITK_NULLPTR); typedef std::complex <double> InputPixelType; typedef double OutputPixelType; diff --git a/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.txx b/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.txx index 990119d130..10c6fab1dd 100644 --- a/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.txx +++ b/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.txx @@ -295,12 +295,12 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> bool hem = (geoPoint[1]>1e-10)?true:false; // Build the output UTM projection ref - OGRSpatialReferenceH oSRS = OSRNewSpatialReference(NULL); + OGRSpatialReferenceH oSRS = OSRNewSpatialReference(ITK_NULLPTR); OSRSetProjCS(oSRS, "UTM"); OSRSetWellKnownGeogCS(oSRS, "WGS84"); OSRSetUTM(oSRS, zone, hem); - char * utmRefC = NULL; + char * utmRefC = ITK_NULLPTR; OSRExportToWkt(oSRS, &utmRefC); projectionRef = utmRefC; diff --git a/Modules/Filtering/Projection/include/otbGeometriesProjectionFilter.txx b/Modules/Filtering/Projection/include/otbGeometriesProjectionFilter.txx index c6c3fdf32c..b5eace98aa 100644 --- a/Modules/Filtering/Projection/include/otbGeometriesProjectionFilter.txx +++ b/Modules/Filtering/Projection/include/otbGeometriesProjectionFilter.txx @@ -32,7 +32,7 @@ otb::ogr::UniqueGeometryPtr otb::internal::ReprojectTransformationFunctor::ByCopy::operator()(TGeometry const* in) const { boost::interprocess::unique_ptr<TGeometry, ogr::internal::GeometryDeleter> - out(in ? static_cast <TGeometry*>(in->clone()) : 0); // OGR clone doesn't use covariant return ... + out(in ? static_cast <TGeometry*>(in->clone()) : ITK_NULLPTR); // OGR clone doesn't use covariant return ... if (out) m_Reprojector.do_transform(*out); ogr::UniqueGeometryPtr res(out.release()); diff --git a/Modules/Filtering/Projection/include/otbImageToEnvelopeVectorDataFilter.txx b/Modules/Filtering/Projection/include/otbImageToEnvelopeVectorDataFilter.txx index c0804d4155..3f7908bae6 100644 --- a/Modules/Filtering/Projection/include/otbImageToEnvelopeVectorDataFilter.txx +++ b/Modules/Filtering/Projection/include/otbImageToEnvelopeVectorDataFilter.txx @@ -54,7 +54,7 @@ const TInputImage * ImageToEnvelopeVectorDataFilter<TInputImage, TOutputVectorData> ::GetInput(void) { - if (this->GetNumberOfInputs() < 1) return 0; + if (this->GetNumberOfInputs() < 1) return ITK_NULLPTR; return dynamic_cast<const InputImageType*> (this->itk::ProcessObject::GetInput(0)); diff --git a/Modules/Filtering/Projection/include/otbOrthoRectificationFilter.txx b/Modules/Filtering/Projection/include/otbOrthoRectificationFilter.txx index a3b781c1f3..eb3b407617 100644 --- a/Modules/Filtering/Projection/include/otbOrthoRectificationFilter.txx +++ b/Modules/Filtering/Projection/include/otbOrthoRectificationFilter.txx @@ -26,7 +26,7 @@ namespace otb template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision> OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision> -::OrthoRectificationFilter(): m_MapProjection(NULL) +::OrthoRectificationFilter(): m_MapProjection(ITK_NULLPTR) {} template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision> diff --git a/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.txx b/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.txx index ae07c0f89f..9bf0281aff 100644 --- a/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.txx +++ b/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.txx @@ -38,7 +38,7 @@ VectorDataTransformFilter<TInputVectorData, TOutputVectorData> // use the otb::Transform or we loose the capability of using all the existing // itk transform, so we just keep it as NULL and you have to be careful not // to burn yourself when using it. - m_Transform = NULL; + m_Transform = ITK_NULLPTR; } /** diff --git a/Modules/Filtering/Projection/src/otbGeometriesProjectionFilter.cxx b/Modules/Filtering/Projection/src/otbGeometriesProjectionFilter.cxx index 24c477ccc1..35d0ff4787 100644 --- a/Modules/Filtering/Projection/src/otbGeometriesProjectionFilter.cxx +++ b/Modules/Filtering/Projection/src/otbGeometriesProjectionFilter.cxx @@ -216,7 +216,7 @@ OGRSpatialReference* otb::GeometriesProjectionFilter::DoDefineNewLayerSpatialRef } else { - return 0; + return ITK_NULLPTR; } } diff --git a/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterAndOrtho.cxx b/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterAndOrtho.cxx index 223b841a6c..afa4ed6c4a 100644 --- a/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterAndOrtho.cxx +++ b/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterAndOrtho.cxx @@ -107,8 +107,8 @@ int otbGCPsToRPCSensorModelImageFilterAndOrtho(int argc, char* argv[]) orthoRectifFilter->SetOutputSpacing(spacing); ImageType::PointType origin; - origin[0] = strtod(argv[3], NULL); //Origin easting - origin[1] = strtod(argv[4], NULL); //Origin northing + origin[0] = strtod(argv[3], ITK_NULLPTR); //Origin easting + origin[1] = strtod(argv[4], ITK_NULLPTR); //Origin northing orthoRectifFilter->SetOutputOrigin(origin); utmMapProjection->SetZone(atoi(argv[9])); diff --git a/Modules/Filtering/Projection/test/otbGenericRSResampleImageFilter.cxx b/Modules/Filtering/Projection/test/otbGenericRSResampleImageFilter.cxx index 2c529aedac..2d9dce59a0 100644 --- a/Modules/Filtering/Projection/test/otbGenericRSResampleImageFilter.cxx +++ b/Modules/Filtering/Projection/test/otbGenericRSResampleImageFilter.cxx @@ -85,7 +85,7 @@ int otbGenericRSResampleImageFilter(int itkNotUsed(argc), char* argv[]) OGRSpatialReference oSRS; oSRS.SetProjCS("UTM"); oSRS.SetUTM(31, true); - char * utmRef = NULL; + char * utmRef = ITK_NULLPTR; oSRS.exportToWkt(&utmRef); // Displacement Field spacing diff --git a/Modules/Filtering/Projection/test/otbGenericRSTransformFromImage.cxx b/Modules/Filtering/Projection/test/otbGenericRSTransformFromImage.cxx index 2afa82d52d..fee540a43b 100644 --- a/Modules/Filtering/Projection/test/otbGenericRSTransformFromImage.cxx +++ b/Modules/Filtering/Projection/test/otbGenericRSTransformFromImage.cxx @@ -56,7 +56,7 @@ int otbGenericRSTransformFromImage(int itkNotUsed(argc), char* argv[]) // Build wgs ref OGRSpatialReference oSRS; oSRS.SetWellKnownGeogCS("WGS84"); - char * wgsRef = NULL; + char * wgsRef = ITK_NULLPTR; oSRS.exportToWkt(&wgsRef); // Instanciate WGS->Image transform @@ -106,7 +106,7 @@ int otbGenericRSTransformImageAndMNTToWGS84ConversionChecking(int itkNotUsed(arg // Build wgs ref OGRSpatialReference oSRS; oSRS.SetWellKnownGeogCS("WGS84"); - char * wgsRef = NULL; + char * wgsRef = ITK_NULLPTR; oSRS.exportToWkt(&wgsRef); DistanceType::Pointer distance = DistanceType::New(); diff --git a/Modules/Filtering/Projection/test/otbOrthoRectificationFilter.cxx b/Modules/Filtering/Projection/test/otbOrthoRectificationFilter.cxx index 4312136b7f..24b31d14e0 100644 --- a/Modules/Filtering/Projection/test/otbOrthoRectificationFilter.cxx +++ b/Modules/Filtering/Projection/test/otbOrthoRectificationFilter.cxx @@ -82,8 +82,8 @@ int otbOrthoRectificationFilter(int argc, char* argv[]) orthoRectifFilter->SetOutputSpacing(spacing); VectorImageType::PointType origin; - origin[0] = strtod(argv[3], NULL); //Origin easting - origin[1] = strtod(argv[4], NULL); //Origin northing + origin[0] = strtod(argv[3], ITK_NULLPTR); //Origin easting + origin[1] = strtod(argv[4], ITK_NULLPTR); //Origin northing orthoRectifFilter->SetOutputOrigin(origin); utmMapProjection->SetZone(atoi(argv[9])); diff --git a/Modules/Filtering/Projection/test/otbSensorModel.cxx b/Modules/Filtering/Projection/test/otbSensorModel.cxx index 30e5456c9c..5c2e116d16 100644 --- a/Modules/Filtering/Projection/test/otbSensorModel.cxx +++ b/Modules/Filtering/Projection/test/otbSensorModel.cxx @@ -65,11 +65,11 @@ int produceGCP(char * outputgcpfilename, const otb::ImageKeywordlist& kwlist, bo kwlist.convertToOSSIMKeywordlist(ossimKwlist); ossimProjection* ossimSensorModel = ossimSensorModelFactory::instance()->createProjection(ossimKwlist); - if (ossimSensorModel == NULL) + if (ossimSensorModel == ITK_NULLPTR) { ossimSensorModel = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(ossimKwlist); } - if (ossimSensorModel == NULL) // Model validity + if (ossimSensorModel == ITK_NULLPTR) // Model validity { std::cerr << "Invalid sensor model (ossimSensorModel is NULL)" << std::endl; return EXIT_FAILURE; @@ -216,7 +216,7 @@ int otbSensorModel(int argc, char* argv[]) // Build wgs ref OGRSpatialReference oSRS; oSRS.SetWellKnownGeogCS("WGS84"); - char * wgsRef = NULL; + char * wgsRef = ITK_NULLPTR; oSRS.exportToWkt(&wgsRef); typedef otb::GenericRSTransform<> GRSTransformType; @@ -251,11 +251,11 @@ int otbSensorModel(int argc, char* argv[]) kwlist.convertToOSSIMKeywordlist(ossimKwlist); ossimProjection* ossimSensorModel = ossimSensorModelFactory::instance()->createProjection(ossimKwlist); - if (ossimSensorModel == NULL) + if (ossimSensorModel == ITK_NULLPTR) { ossimSensorModel = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(ossimKwlist); } - if (ossimSensorModel == NULL) // Model validity + if (ossimSensorModel == ITK_NULLPTR) // Model validity { std::cerr << "Invalid sensor model (ossimSensorModel is NULL)" << std::endl; return EXIT_FAILURE; diff --git a/Modules/Filtering/Statistics/include/otbListSampleGenerator.txx b/Modules/Filtering/Statistics/include/otbListSampleGenerator.txx index 8b21b56eae..8945cda273 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleGenerator.txx +++ b/Modules/Filtering/Statistics/include/otbListSampleGenerator.txx @@ -97,7 +97,7 @@ ListSampleGenerator<TImage, TVectorData> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ImageType *>(this->ProcessObject::GetInput(0)); @@ -121,7 +121,7 @@ ListSampleGenerator<TImage, TVectorData> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const VectorDataType *>(this->ProcessObject::GetInput(1)); diff --git a/Modules/Filtering/Statistics/include/otbListSampleToBalancedListSampleFilter.txx b/Modules/Filtering/Statistics/include/otbListSampleToBalancedListSampleFilter.txx index 6a98e8deec..3c411abe62 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleToBalancedListSampleFilter.txx +++ b/Modules/Filtering/Statistics/include/otbListSampleToBalancedListSampleFilter.txx @@ -86,7 +86,7 @@ ListSampleToBalancedListSampleFilter<TInputSampleList, TLabelSampleList, TOutput { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const LabelSampleListType* > diff --git a/Modules/Filtering/Statistics/include/otbListSampleToHistogramListGenerator.txx b/Modules/Filtering/Statistics/include/otbListSampleToHistogramListGenerator.txx index ad4370cb19..f5e8324b49 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleToHistogramListGenerator.txx +++ b/Modules/Filtering/Statistics/include/otbListSampleToHistogramListGenerator.txx @@ -69,7 +69,7 @@ ListSampleToHistogramListGenerator<TListSample,THistogramMeasurement, TFrequency { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ListSampleType* > (this->itk::ProcessObject::GetInput(0) ); diff --git a/Modules/Filtering/Statistics/include/otbListSampleToListSampleFilter.txx b/Modules/Filtering/Statistics/include/otbListSampleToListSampleFilter.txx index 3d7ef2ac1c..80ed0d7146 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleToListSampleFilter.txx +++ b/Modules/Filtering/Statistics/include/otbListSampleToListSampleFilter.txx @@ -49,7 +49,7 @@ ListSampleToListSampleFilter<TInputSampleList, TOutputSampleList> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputSampleListType * > diff --git a/Modules/Filtering/Statistics/include/otbListSampleToVariableDimensionHistogramGenerator.txx b/Modules/Filtering/Statistics/include/otbListSampleToVariableDimensionHistogramGenerator.txx index dd1123c660..b2c66e5cc4 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleToVariableDimensionHistogramGenerator.txx +++ b/Modules/Filtering/Statistics/include/otbListSampleToVariableDimensionHistogramGenerator.txx @@ -64,7 +64,7 @@ ListSampleToVariableDimensionHistogramGenerator<TListSample, THistogramMeasureme { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ListSampleType* > (this->itk::ProcessObject::GetInput(0) ); diff --git a/Modules/Filtering/VectorDataManipulation/include/otbConcatenateVectorDataFilter.txx b/Modules/Filtering/VectorDataManipulation/include/otbConcatenateVectorDataFilter.txx index ddc3fd4f4e..7c41c0f2a0 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbConcatenateVectorDataFilter.txx +++ b/Modules/Filtering/VectorDataManipulation/include/otbConcatenateVectorDataFilter.txx @@ -71,7 +71,7 @@ ConcatenateVectorDataFilter<TVectorData> { if (this->GetNumberOfInputs() < idx) { - return 0; + return ITK_NULLPTR; } return static_cast<const VectorDataType *>(this->Superclass::GetInput(idx)); } @@ -123,7 +123,7 @@ void ConcatenateVectorDataFilter<TVectorData> ::ProcessNode(TreeNodeType * source, DataNodeType * outputDocument) { - if (source == 0) + if (source == ITK_NULLPTR) return; diff --git a/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToSpecificDescriptionFilterBase.txx b/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToSpecificDescriptionFilterBase.txx index 1806d07333..24e40c8195 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToSpecificDescriptionFilterBase.txx +++ b/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToSpecificDescriptionFilterBase.txx @@ -51,7 +51,7 @@ VectorDataToSpecificDescriptionFilterBase<TVectorData> { if (this->GetNumberOfInputs() < idx+2) { - return 0; + return ITK_NULLPTR; } return static_cast<const DataObject *> diff --git a/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToVectorDataFilter.txx b/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToVectorDataFilter.txx index 6ff5429638..4524933da9 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToVectorDataFilter.txx +++ b/Modules/Filtering/VectorDataManipulation/include/otbVectorDataToVectorDataFilter.txx @@ -53,7 +53,7 @@ VectorDataToVectorDataFilter<TInputVectorData, TOutputVectorData> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputVectorData *> diff --git a/Modules/Fusion/Fuzzy/src/otbFuzzyDescriptorsModelManager.cxx b/Modules/Fusion/Fuzzy/src/otbFuzzyDescriptorsModelManager.cxx index fd28876504..692e3b1495 100644 --- a/Modules/Fusion/Fuzzy/src/otbFuzzyDescriptorsModelManager.cxx +++ b/Modules/Fusion/Fuzzy/src/otbFuzzyDescriptorsModelManager.cxx @@ -120,7 +120,7 @@ FuzzyDescriptorsModelManager // Iterate through the tree to get all the stats for( TiXmlElement* currentStat = root.FirstChildElement().ToElement(); - currentStat != NULL; + currentStat != ITK_NULLPTR; currentStat = currentStat->NextSiblingElement() ) { PairType currentDescriptor; @@ -133,7 +133,7 @@ FuzzyDescriptorsModelManager ParameterType param; for( TiXmlElement* sample = currentStat->FirstChildElement("Parameter"); - sample != NULL; + sample != ITK_NULLPTR; sample = sample->NextSiblingElement() ) { // Get the current value of the descriptor diff --git a/Modules/Fusion/PanSharpening/include/otbFusionImageBase.h b/Modules/Fusion/PanSharpening/include/otbFusionImageBase.h index aef6003fa6..8cc7c49b87 100644 --- a/Modules/Fusion/PanSharpening/include/otbFusionImageBase.h +++ b/Modules/Fusion/PanSharpening/include/otbFusionImageBase.h @@ -98,7 +98,7 @@ public: { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } else return (static_cast<const InputMultiSpectralImageType *>(this->itk::ProcessObject::GetInput(0))); } @@ -107,7 +107,7 @@ public: { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } else return (static_cast<const InputMultiSpectralInterpImageType *>(this->itk::ProcessObject::GetInput(1))); } @@ -116,7 +116,7 @@ public: { if (this->GetNumberOfInputs() < 3) { - return 0; + return ITK_NULLPTR; } else return (static_cast<const InputPanchroImageType *>(this->itk::ProcessObject::GetInput(2))); } diff --git a/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.txx b/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.txx index 2dee5c593f..5c6acc98f5 100644 --- a/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.txx +++ b/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.txx @@ -86,7 +86,7 @@ LmvmPanSharpeningFusionImageFilter { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TPanImageType *> @@ -115,7 +115,7 @@ LmvmPanSharpeningFusionImageFilter { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TXsImageType *> diff --git a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx index be46021863..4ddbe48317 100644 --- a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx +++ b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx @@ -75,7 +75,7 @@ SimpleRcsPanSharpeningFusionImageFilter { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TPanImageType *> @@ -104,7 +104,7 @@ SimpleRcsPanSharpeningFusionImageFilter { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TXsImageType *> diff --git a/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.txx b/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.txx index 830cd37e31..8b84cb874f 100644 --- a/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.txx +++ b/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.txx @@ -75,7 +75,7 @@ SparseUnmixingImageFilter< TInputImage, TOutputImage, VNbInputImage, TPrecision, { if ( i >= this->GetNumberOfInputs() ) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType * > diff --git a/Modules/IO/Carto/include/otbImageToOSMVectorDataGenerator.txx b/Modules/IO/Carto/include/otbImageToOSMVectorDataGenerator.txx index e8da8dedef..b7cbbe177c 100644 --- a/Modules/IO/Carto/include/otbImageToOSMVectorDataGenerator.txx +++ b/Modules/IO/Carto/include/otbImageToOSMVectorDataGenerator.txx @@ -57,7 +57,7 @@ ImageToOSMVectorDataGenerator<TImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const ImageType* > diff --git a/Modules/IO/Carto/include/otbMapFileProductWriter.txx b/Modules/IO/Carto/include/otbMapFileProductWriter.txx index da8f09e847..f960e0b2f2 100644 --- a/Modules/IO/Carto/include/otbMapFileProductWriter.txx +++ b/Modules/IO/Carto/include/otbMapFileProductWriter.txx @@ -84,7 +84,7 @@ MapFileProductWriter<TInputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage * > diff --git a/Modules/IO/Carto/src/otbOSMDataToVectorDataGenerator.cxx b/Modules/IO/Carto/src/otbOSMDataToVectorDataGenerator.cxx index 6d16f6ed7d..3aa7df3e2b 100644 --- a/Modules/IO/Carto/src/otbOSMDataToVectorDataGenerator.cxx +++ b/Modules/IO/Carto/src/otbOSMDataToVectorDataGenerator.cxx @@ -139,7 +139,7 @@ void OSMDataToVectorDataGenerator::ParseXmlFile() // Iterate through the tree to get all the nodes and store them in // a std::map for( TiXmlElement* node = root.FirstChild("node").ToElement(); - node != NULL && strcmp(node->Value(),"node")==0; + node != ITK_NULLPTR && strcmp(node->Value(),"node")==0; node = node->NextSiblingElement() ) { int id = 0; @@ -168,7 +168,7 @@ void OSMDataToVectorDataGenerator::ParseXmlFile() // Iterate through the tree to get all the fields ways with tag k=key for( TiXmlElement* currentLayer = root.FirstChildElement("way").ToElement(); - currentLayer != NULL && strcmp(currentLayer->Value(),"way") ==0; + currentLayer != ITK_NULLPTR && strcmp(currentLayer->Value(),"way") ==0; currentLayer = currentLayer->NextSiblingElement() ) { bool foundKey = false; @@ -180,7 +180,7 @@ void OSMDataToVectorDataGenerator::ParseXmlFile() // Iterate through the node tag to find the "key" for( TiXmlElement* currentTag = currentLayer->FirstChild("tag")->ToElement(); - currentTag != NULL; + currentTag != ITK_NULLPTR; currentTag = currentTag->NextSiblingElement() ) { std::string result = currentTag->Attribute("k"); @@ -211,7 +211,7 @@ void OSMDataToVectorDataGenerator::ParseXmlFile() // put the current layer pointer to the begining for( TiXmlElement* currentNode = currentLayer->FirstChildElement("nd"); - currentNode != NULL; + currentNode != ITK_NULLPTR; currentNode = currentNode->NextSiblingElement() ) { int value=0; diff --git a/Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx b/Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx index 49cd5f44c1..c89b2cb7b2 100644 --- a/Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx +++ b/Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx @@ -24,7 +24,7 @@ void ExtendedFilenameHelper ::SetExtendedFileName(const char *extFname) { - if (extFname == NULL) + if (extFname == ITK_NULLPTR) { itkGenericExceptionMacro( << "Filename is NULL" ); } diff --git a/Modules/IO/IOBSQ/src/otbBSQImageIO.cxx b/Modules/IO/IOBSQ/src/otbBSQImageIO.cxx index 9d1fa0e37b..fd7039484e 100644 --- a/Modules/IO/IOBSQ/src/otbBSQImageIO.cxx +++ b/Modules/IO/IOBSQ/src/otbBSQImageIO.cxx @@ -54,7 +54,7 @@ BSQImageIO::BSQImageIO() // (consistency between ImageIO, see Mantis #942) m_Origin[0] = 0.5; m_Origin[1] = 0.5; - m_ChannelsFile = NULL; + m_ChannelsFile = ITK_NULLPTR; m_FlagWriteImageInformation = true; this->AddSupportedWriteExtension(".hd"); @@ -71,7 +71,7 @@ BSQImageIO::~BSQImageIO() { m_HeaderFile.close(); } - if (m_ChannelsFile != NULL) + if (m_ChannelsFile != ITK_NULLPTR) { for (unsigned int numComponent = 0; numComponent < this->GetNumberOfComponents(); numComponent++) { @@ -152,7 +152,7 @@ void BSQImageIO::Read(void* buffer) step = step * (unsigned long) (this->GetComponentSize()); char * value = new char[numberOfBytesToBeRead]; - if (value == NULL) + if (value == ITK_NULLPTR) { itkExceptionMacro(<< "BSQImageIO::Read(): Bad alloc"); return; @@ -528,7 +528,7 @@ void BSQImageIO::Write(const void* buffer) const char * p = static_cast<const char *>(buffer); char* value = new char[numberOfBytesToBeWrite]; - if (value == NULL) + if (value == ITK_NULLPTR) { itkExceptionMacro(<< "Memory allocation error"); return; diff --git a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h index 39067cf082..d912fc3153 100644 --- a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h +++ b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h @@ -98,7 +98,7 @@ public: bool CanWriteFile(const char*) const ITK_OVERRIDE; /** Writes the data to disk from the memory buffer provided */ - void Write(const itk::DataObject* data, char ** papszOptions = NULL) ITK_OVERRIDE; + void Write(const itk::DataObject* data, char ** papszOptions = ITK_NULLPTR) ITK_OVERRIDE; protected: /** Constructor.*/ diff --git a/Modules/IO/IOGDAL/src/otbGDALDatasetWrapper.cxx b/Modules/IO/IOGDAL/src/otbGDALDatasetWrapper.cxx index c1d23d23a1..8842ef89e3 100644 --- a/Modules/IO/IOGDAL/src/otbGDALDatasetWrapper.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALDatasetWrapper.cxx @@ -26,7 +26,7 @@ namespace otb { GDALDatasetWrapper -::GDALDatasetWrapper(): m_Dataset(NULL) +::GDALDatasetWrapper(): m_Dataset(ITK_NULLPTR) { } @@ -41,7 +41,7 @@ GDALDatasetWrapper // GDALDriverManagerWrapper::Open(). So, it should be destroyed by // GDALClose() (see // http://gdal.org/classGDALDataset.html#a4d110533d799bac7dcfad3c41d30c0e7). - m_Dataset = NULL; + m_Dataset = ITK_NULLPTR; } } @@ -66,7 +66,7 @@ GDALDatasetWrapper bool GDALDatasetWrapper::IsJPEG2000() const { - if (m_Dataset == NULL) + if (m_Dataset == ITK_NULLPTR) { return false; } diff --git a/Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx b/Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx index 747d851f3a..6eb7a346fd 100644 --- a/Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx @@ -29,7 +29,7 @@ GDALDriverManagerWrapper::GDALDriverManagerWrapper() { GDALAllRegister(); - GDALDriver* driver = 0; + GDALDriver* driver = ITK_NULLPTR; // Ignore incompatible Jpeg2000 drivers (Jasper) driver = GetGDALDriverManager()->GetDriverByName( "JPEG2000" ); @@ -63,8 +63,8 @@ GDALDriverManagerWrapper::Open( std::string filename ) const } // test if a driver can identify the dataset - GDALDriverH identifyDriverH = GDALIdentifyDriver(filename.c_str(), NULL); - if(identifyDriverH == NULL) + GDALDriverH identifyDriverH = GDALIdentifyDriver(filename.c_str(), ITK_NULLPTR); + if(identifyDriverH == ITK_NULLPTR) { // don't try to open it and exit return datasetWrapper; @@ -83,7 +83,7 @@ GDALDriverManagerWrapper::Open( std::string filename ) const GDALDatasetH dataset = GDALOpen(filename.c_str(), GA_ReadOnly); - if (dataset != NULL) + if (dataset != ITK_NULLPTR) { datasetWrapper = GDALDatasetWrapper::New(); datasetWrapper->m_Dataset = static_cast<GDALDataset*>(dataset); @@ -100,14 +100,14 @@ GDALDriverManagerWrapper::Create( std::string driverShortName, std::string filen GDALDatasetWrapper::Pointer datasetWrapper; GDALDriver* driver = GetDriverByName( driverShortName ); - if(driver != NULL) + if(driver != ITK_NULLPTR) { GDALDataset* dataset = driver->Create(filename.c_str(), nXSize, nYSize, nBands, eType, papszOptions ); - if (dataset != NULL) + if (dataset != ITK_NULLPTR) { datasetWrapper = GDALDatasetWrapper::New(); datasetWrapper->m_Dataset = dataset; diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx index 41b09e6673..796458b295 100644 --- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx @@ -172,7 +172,7 @@ GDALImageIO::~GDALImageIO() bool GDALImageIO::CanReadFile(const char* file) { // First check the extension - if (file == NULL) + if (file == ITK_NULLPTR) { itkDebugMacro(<< "No filename specified."); return false; @@ -202,7 +202,7 @@ void GDALImageIO::Read(void* buffer) unsigned char *p = static_cast<unsigned char *>(buffer); // Check if conversion succeed - if (p == NULL) + if (p == ITK_NULLPTR) { itkExceptionMacro(<< "GDAL : Bad alloc"); return; @@ -418,7 +418,7 @@ void GDALImageIO::Read(void* buffer) m_PxType->pixType, nbBands, // We want to read all bands - NULL, + ITK_NULLPTR, pixelOffset, lineOffset, bandOffset); @@ -449,7 +449,7 @@ bool GDALImageIO::GetSubDatasetInfo(std::vector<std::string> &names, std::vector (strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(),"HDF5") == 0) || (strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(),"SENTINEL2") == 0) ) ) { - for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) + for (int cpt = 0; papszMetadata[cpt] != ITK_NULLPTR; ++cpt) { std::string key, name; if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name)) @@ -602,7 +602,7 @@ void GDALImageIO::InternalReadImageInformation() std::vector<std::string> names; if( CSLCount(papszMetadata) > 0 ) { - for( int cpt = 0; papszMetadata[cpt] != NULL; ++cpt ) + for( int cpt = 0; papszMetadata[cpt] != ITK_NULLPTR; ++cpt ) { std::string key, name; if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name)) @@ -891,7 +891,7 @@ void GDALImageIO::InternalReadImageInformation() if (m_NumberOfDimensions == 3) m_Spacing[2] = 1; - char** papszMetadata = dataset->GetMetadata(NULL); + char** papszMetadata = dataset->GetMetadata(ITK_NULLPTR); /* -------------------------------------------------------------------- */ /* Report general info. */ @@ -915,16 +915,16 @@ void GDALImageIO::InternalReadImageInformation() /* -------------------------------------------------------------------- */ /* Get the projection coordinate system of the image : ProjectionRef */ /* -------------------------------------------------------------------- */ - if (dataset->GetProjectionRef() != NULL && !std::string(dataset->GetProjectionRef()).empty()) + if (dataset->GetProjectionRef() != ITK_NULLPTR && !std::string(dataset->GetProjectionRef()).empty()) { - OGRSpatialReferenceH pSR = OSRNewSpatialReference(NULL); + OGRSpatialReferenceH pSR = OSRNewSpatialReference(ITK_NULLPTR); - const char * pszProjection = NULL; + const char * pszProjection = ITK_NULLPTR; pszProjection = dataset->GetProjectionRef(); if (OSRImportFromWkt(pSR, (char **) (&pszProjection)) == OGRERR_NONE) { - char * pszPrettyWkt = NULL; + char * pszPrettyWkt = ITK_NULLPTR; OSRExportToPrettyWkt(pSR, &pszPrettyWkt, FALSE); itk::EncapsulateMetaData<std::string> (dict, MetaDataKey::ProjectionRefKey, @@ -938,10 +938,10 @@ void GDALImageIO::InternalReadImageInformation() static_cast<std::string>(dataset->GetProjectionRef())); } - if (pSR != NULL) + if (pSR != ITK_NULLPTR) { OSRRelease(pSR); - pSR = NULL; + pSR = ITK_NULLPTR; } } else @@ -970,7 +970,7 @@ void GDALImageIO::InternalReadImageInformation() // assert( gcpProj!=NULL ); - if( gcpProj!=NULL ) + if( gcpProj!=ITK_NULLPTR ) gcpProjectionKey = gcpProj; } @@ -1084,12 +1084,12 @@ void GDALImageIO::InternalReadImageInformation() /* Report metadata. */ /* -------------------------------------------------------------------- */ - papszMetadata = dataset->GetMetadata(NULL); + papszMetadata = dataset->GetMetadata(ITK_NULLPTR); if (CSLCount(papszMetadata) > 0) { std::string key; - for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) + for (int cpt = 0; papszMetadata[cpt] != ITK_NULLPTR; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::MetadataKey << cpt; @@ -1103,7 +1103,7 @@ void GDALImageIO::InternalReadImageInformation() /* Special case for JPEG2000, also look in the GML boxes */ if (m_Dataset->IsJPEG2000()) { - char **gmlMetadata = NULL; + char **gmlMetadata = ITK_NULLPTR; GDALJP2Metadata jp2Metadata; if (jp2Metadata.ReadAndParse(m_FileName.c_str())) { @@ -1117,7 +1117,7 @@ void GDALImageIO::InternalReadImageInformation() std::string key; int cptOffset = CSLCount(papszMetadata); - for (int cpt = 0; gmlMetadata[cpt] != NULL; ++cpt) + for (int cpt = 0; gmlMetadata[cpt] != ITK_NULLPTR; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::MetadataKey << (cpt+cptOffset); @@ -1140,7 +1140,7 @@ void GDALImageIO::InternalReadImageInformation() { std::string key; - for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) + for (int cpt = 0; papszMetadata[cpt] != ITK_NULLPTR; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::SubMetadataKey << cpt; @@ -1200,7 +1200,7 @@ void GDALImageIO::InternalReadImageInformation() GDALRasterBandH hBand; hBand = GDALGetRasterBand(dataset, iBand + 1); if ((GDALGetRasterColorInterpretation(hBand) == GCI_PaletteIndex) - && (hTable = GDALGetRasterColorTable(hBand)) != NULL) + && (hTable = GDALGetRasterColorTable(hBand)) != ITK_NULLPTR) { m_IsIndexed = true; @@ -1269,7 +1269,7 @@ void GDALImageIO::InternalReadImageInformation() bool GDALImageIO::CanWriteFile(const char* name) { // First check the filename - if (name == NULL) + if (name == ITK_NULLPTR) { itkDebugMacro(<< "No filename specified."); return false; @@ -1286,8 +1286,8 @@ bool GDALImageIO::CanWriteFile(const char* name) // Check the driver for support of Create or at least CreateCopy GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName); - if ( GDALGetMetadataItem( driver, GDAL_DCAP_CREATE, NULL ) == NULL - && GDALGetMetadataItem( driver, GDAL_DCAP_CREATECOPY, NULL ) == NULL ) + if ( GDALGetMetadataItem( driver, GDAL_DCAP_CREATE, ITK_NULLPTR ) == ITK_NULLPTR + && GDALGetMetadataItem( driver, GDAL_DCAP_CREATECOPY, ITK_NULLPTR ) == ITK_NULLPTR ) { itkDebugMacro(<< "The driver " << GDALGetDriverShortName(driver) << " does not support writing"); return false; @@ -1301,12 +1301,12 @@ bool GDALImageIO::CanStreamWrite() std::string gdalDriverShortName = FilenameToGdalDriverShortName(m_FileName); GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName); - if (driver == NULL) + if (driver == ITK_NULLPTR) { itkDebugMacro(<< "Unable to instantiate driver " << gdalDriverShortName); m_CanStreamWrite = false; } - if ( GDALGetMetadataItem( driver, GDAL_DCAP_CREATE, NULL ) != NULL ) + if ( GDALGetMetadataItem( driver, GDAL_DCAP_CREATE, ITK_NULLPTR ) != ITK_NULLPTR ) { m_CanStreamWrite = true; } @@ -1327,7 +1327,7 @@ void GDALImageIO::Write(const void* buffer) } // Check if conversion succeed - if (buffer == NULL) + if (buffer == ITK_NULLPTR) { itkExceptionMacro(<< "GDAL : Bad alloc"); return; @@ -1381,7 +1381,7 @@ void GDALImageIO::Write(const void* buffer) m_PxType->pixType, m_NbBands, // We want to write all bands - NULL, + ITK_NULLPTR, // Pixel offset // is nbComp * BytePerPixel m_BytePerPixel * m_NbBands, @@ -1410,7 +1410,7 @@ void GDALImageIO::Write(const void* buffer) std::string realFileName = GetGdalWriteImageFileName(gdalDriverShortName, m_FileName); GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName); - if (driver == NULL) + if (driver == ITK_NULLPTR) { itkExceptionMacro(<< "Unable to instantiate driver " << gdalDriverShortName << " to write " << m_FileName); } @@ -1418,7 +1418,7 @@ void GDALImageIO::Write(const void* buffer) GDALCreationOptionsType creationOptions = m_CreationOptions; GDALDataset* hOutputDS = driver->CreateCopy( realFileName.c_str(), m_Dataset->GetDataSet(), FALSE, otb::ogr::StringListConverter(creationOptions).to_ogr(), - NULL, NULL ); + ITK_NULLPTR, ITK_NULLPTR ); if(!hOutputDS) { itkExceptionMacro(<< "Error while writing image (GDAL format) '" @@ -1781,7 +1781,7 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer) std::string tag = svalue.substr(0, equalityPos); std::string value = svalue.substr(equalityPos + 1); otbMsgDevMacro(<< "Metadata: " << tag << "=" << value); - dataset->SetMetadataItem(tag.c_str(), value.c_str(), NULL); + dataset->SetMetadataItem(tag.c_str(), value.c_str(), ITK_NULLPTR); } } @@ -1852,7 +1852,7 @@ std::string GDALImageIO::FilenameToGdalDriverShortName(const std::string& name) else if ( extension == ".j2k" || extension == ".jp2" || extension == ".jpx") { // Try different JPEG2000 drivers - GDALDriver *driver = NULL; + GDALDriver *driver = ITK_NULLPTR; driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName("JP2OpenJPEG"); if (driver) { diff --git a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx index c61bb67a4b..40393537b9 100644 --- a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx @@ -72,10 +72,10 @@ GDAL_COMPRESSION_NAMES[ GDAL_COMPRESSION_COUNT ] = std::string GetConfigOption( const char * key ) { - const char * value = CPLGetConfigOption( key, NULL ); + const char * value = CPLGetConfigOption( key, ITK_NULLPTR ); return - value==NULL + value==ITK_NULLPTR ? std::string() : std::string( value ); } @@ -516,7 +516,7 @@ GDALOverviewsBuilder static_cast< int >( m_NbResolutions - 1 ), &ovwlist.front(), 0, // All bands - NULL, // All bands + ITK_NULLPTR, // All bands ( GDALProgressFunc )otb_UpdateGDALProgress, this ); diff --git a/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx b/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx index 6cc3890ac2..212d75c607 100644 --- a/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx +++ b/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx @@ -31,7 +31,7 @@ OGRIOHelper { OGRPoint * ogrPoint = (OGRPoint *) ogrGeometry; - if (ogrPoint == NULL) + if (ogrPoint == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert OGRGeometry to OGRPoint"); } @@ -60,7 +60,7 @@ OGRIOHelper { OGRLineString * ogrLine = (OGRLineString *) ogrGeometry; - if (ogrLine == NULL) + if (ogrLine == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert OGRGeometry to OGRLine"); } @@ -102,7 +102,7 @@ OGRIOHelper { OGRPolygon * ogrPolygon = (OGRPolygon *) ogrGeometry; - if (ogrPolygon == NULL) + if (ogrPolygon == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert OGRGeometry to OGRPolygon"); } @@ -187,7 +187,7 @@ void OGRIOHelper unsigned int counter = 0; itk::TimeProbe chrono; - while ((feature = layer->GetNextFeature()) != NULL) + while ((feature = layer->GetNextFeature()) != ITK_NULLPTR) { chrono.Start(); @@ -197,7 +197,7 @@ void OGRIOHelper /** Temporary geometry container */ OGRGeometry * geometry = feature->GetGeometryRef(); - if (geometry == NULL) + if (geometry == ITK_NULLPTR) { OGRFeature::DestroyFeature(feature); chrono.Stop(); @@ -674,7 +674,7 @@ unsigned int OGRIOHelper kwl); // Create the field once - if (ogrCurrentLayer != NULL && !fieldsAddedToOGRLayer) + if (ogrCurrentLayer != ITK_NULLPTR && !fieldsAddedToOGRLayer) { // Take into account the fields stored in the // vectordatakeywordlist @@ -710,8 +710,8 @@ unsigned int OGRIOHelper } case DOCUMENT: { - ogrCurrentLayer = m_DataSource->CreateLayer(dataNode->GetNodeId(), oSRS, wkbUnknown, NULL); - if (ogrCurrentLayer == NULL) + ogrCurrentLayer = m_DataSource->CreateLayer(dataNode->GetNodeId(), oSRS, wkbUnknown, ITK_NULLPTR); + if (ogrCurrentLayer == ITK_NULLPTR) { //itkExceptionMacro(<<"Failed to create layer "<<dataNode->GetNodeId()); std::cout << "Failed to create layer " << dataNode->GetNodeId() << std::endl; @@ -742,7 +742,7 @@ unsigned int OGRIOHelper } //Save it in the structure - if (ogrCollection == NULL) + if (ogrCollection == ITK_NULLPTR) { OGRFeature *ogrFeature; ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); @@ -800,7 +800,7 @@ unsigned int OGRIOHelper } //Save it in the structure - if (ogrCollection == NULL) + if (ogrCollection == ITK_NULLPTR) { OGRFeature *ogrFeature; ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); @@ -885,7 +885,7 @@ unsigned int OGRIOHelper } //Save it in the structure - if (ogrCollection == NULL) + if (ogrCollection == ITK_NULLPTR) { OGRFeature *ogrFeature; ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); @@ -918,7 +918,7 @@ unsigned int OGRIOHelper } case FEATURE_MULTIPOINT: { - if (ogrCollection != NULL) + if (ogrCollection != ITK_NULLPTR) { itkExceptionMacro(<< "Problem while creating multipoint."); } @@ -941,7 +941,7 @@ unsigned int OGRIOHelper } case FEATURE_MULTILINE: { - if (ogrCollection != NULL) + if (ogrCollection != ITK_NULLPTR) { itkExceptionMacro(<< "Problem while creating multiline."); } @@ -966,7 +966,7 @@ unsigned int OGRIOHelper } case FEATURE_MULTIPOLYGON: { - if (ogrCollection != NULL) + if (ogrCollection != ITK_NULLPTR) { itkExceptionMacro(<< "Problem while creating multipolygon."); } @@ -989,7 +989,7 @@ unsigned int OGRIOHelper } case FEATURE_COLLECTION: { - if (ogrCollection != NULL) + if (ogrCollection != ITK_NULLPTR) { itkExceptionMacro(<< "Problem while creating collection."); } @@ -1031,7 +1031,7 @@ std::vector<OGRLayer*> OGRIOHelper { // Create the in memory datasource if NULL - if (inMemoryDataSource == NULL) + if (inMemoryDataSource == ITK_NULLPTR) { const char * driverName = "Memory"; ogr::version_proxy::GDALDriverType * ogrDriver = ogr::version_proxy::GetDriverByName(driverName); @@ -1057,7 +1057,7 @@ std::vector<OGRLayer*> OGRIOHelper kwl); // Create the field once - if (ogrCurrentLayer != NULL && !fieldsAddedToOGRLayer) + if (ogrCurrentLayer != ITK_NULLPTR && !fieldsAddedToOGRLayer) { // Take into account the fields stored in the // vectordatakeywordlist @@ -1088,8 +1088,8 @@ std::vector<OGRLayer*> OGRIOHelper case DOCUMENT: { ogrCurrentLayer = inMemoryDataSource->CreateLayer(dataNode->GetNodeId(), oSRS, - wkbUnknown, NULL); - if (ogrCurrentLayer == NULL) + wkbUnknown, ITK_NULLPTR); + if (ogrCurrentLayer == ITK_NULLPTR) { std::cout << "Failed to create layer " << dataNode->GetNodeId() << std::endl; } diff --git a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx index ec46d6e2f4..4bc2b52bbe 100644 --- a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx +++ b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx @@ -35,7 +35,7 @@ namespace otb OGRVectorDataIO ::OGRVectorDataIO() : - m_DataSource(NULL) + m_DataSource(ITK_NULLPTR) { // OGR factory registration OGRRegisterAll(); @@ -44,7 +44,7 @@ OGRVectorDataIO OGRVectorDataIO::~OGRVectorDataIO() { - if (m_DataSource != NULL) + if (m_DataSource != ITK_NULLPTR) { this->CloseInternalDataSource(); } @@ -56,7 +56,7 @@ OGRVectorDataIO::CanReadFile(const char* filename) const { otb::ogr::version_proxy::GDALDatasetType * poDS = ogr::version_proxy::Open(filename, true); - if (poDS == NULL) + if (poDS == ITK_NULLPTR) { std::cerr<<"Can not read file "<<filename<<" with GDALOpen"<<std::endl; return false; @@ -88,14 +88,14 @@ OGRVectorDataIO itkExceptionMacro(<<"Failed to dynamic cast to otb::VectorData (this should never happen)"); } - if (m_DataSource != NULL) + if (m_DataSource != ITK_NULLPTR) { this->CloseInternalDataSource(); } m_DataSource = ogr::version_proxy::Open(this->m_FileName.c_str(),true); - if (m_DataSource == NULL) + if (m_DataSource == ITK_NULLPTR) { itkExceptionMacro(<< "Failed to open data file " << this->m_FileName); } @@ -110,11 +110,11 @@ OGRVectorDataIO DataTreePointerType tree = data->GetDataTree(); DataNodePointerType root = tree->GetRoot()->Get(); - OGRSpatialReference * oSRS = NULL; + OGRSpatialReference * oSRS = ITK_NULLPTR; //We take the assumption that the spatial reference is common to all layers oSRS = m_DataSource->GetLayer(0)->GetSpatialRef(); - if (oSRS != NULL) + if (oSRS != ITK_NULLPTR) { char * projectionRefChar; oSRS->exportToWkt(&projectionRefChar); @@ -185,7 +185,7 @@ void OGRVectorDataIO::CloseInternalDataSource() { assert(m_DataSource != NULL && "m_DataSource cannot be NULL"); ogr::version_proxy::Close(m_DataSource); - m_DataSource = NULL; + m_DataSource = ITK_NULLPTR; } @@ -219,13 +219,13 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) ogr::version_proxy::GDALDriverType * ogrDriver = ogr::version_proxy::GetDriverByName(this->GetOGRDriverName(this->m_FileName).data()); - if (ogrDriver == NULL) + if (ogrDriver == ITK_NULLPTR) { itkExceptionMacro(<< "No OGR driver found to write file " << this->m_FileName); } // free an existing previous data source, if any - if (m_DataSource != NULL) + if (m_DataSource != ITK_NULLPTR) { ogr::version_proxy::Close(m_DataSource); } @@ -237,7 +237,7 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) m_DataSource = ogr::version_proxy::Create(ogrDriver,this->m_FileName.c_str()); // check the created data source - if (m_DataSource == NULL) + if (m_DataSource == ITK_NULLPTR) { itkExceptionMacro( << "Failed to create OGR data source for file " << this->m_FileName << @@ -259,7 +259,7 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) } //TODO georeference here from OGRSpatialReference http://www.gdal.org/ogr/classOGRDataSource.html - OGRSpatialReference * oSRS = NULL; + OGRSpatialReference * oSRS = ITK_NULLPTR; if (projectionInformationAvailable) { oSRS = static_cast<OGRSpatialReference *>(OSRNewSpatialReference(projectionRefWkt.c_str())); @@ -267,16 +267,16 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) // Retrieving root node DataTreeConstPointerType tree = data->GetDataTree(); - if (tree->GetRoot() == NULL) + if (tree->GetRoot() == ITK_NULLPTR) { itkExceptionMacro(<< "Data tree is empty: Root == NULL"); } DataNodePointerType root = tree->GetRoot()->Get(); unsigned int layerKept; - OGRLayer * ogrCurrentLayer = NULL; + OGRLayer * ogrCurrentLayer = ITK_NULLPTR; // OGRFeatureVectorType ogrFeatures; - OGRGeometryCollection * ogrCollection = NULL; + OGRGeometryCollection * ogrCollection = ITK_NULLPTR; // OGRGeometry * ogrCurrentGeometry = NULL; // Get the input tree root @@ -290,9 +290,9 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) (void)layerKept; // keep compiler happy otb::ogr::version_proxy::Close(m_DataSource); - m_DataSource = NULL; + m_DataSource = ITK_NULLPTR; - if (oSRS != NULL) + if (oSRS != ITK_NULLPTR) { OSRRelease(oSRS); } diff --git a/Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx b/Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx index e226828a02..76f079c347 100644 --- a/Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx +++ b/Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx @@ -462,7 +462,7 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt GDALAllRegister(); poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat); - if( poDriver == NULL ) + if( poDriver == ITK_NULLPTR ) { std::cout << "impossible to get the driver" <<std::endl; return false; @@ -481,14 +481,14 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt } GDALDataset *poDstDS; - char **papszOptions = NULL; + char **papszOptions = ITK_NULLPTR; // Create dataset poDstDS = poDriver->Create( filename.c_str(), 128, 128, 1, GDT_Byte, papszOptions ); OGRSpatialReference oSRS_GCP; - char *pszSRS_WKT_GCP = NULL; + char *pszSRS_WKT_GCP = ITK_NULLPTR; oSRS_GCP.SetWellKnownGeogCS( "WGS84" ); oSRS_GCP.exportToWkt( &pszSRS_WKT_GCP ); @@ -522,7 +522,7 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt // Set ProjectionRef OGRSpatialReference oSRS_ProjRef; - char *pszSRS_WKT_ProjRef = NULL; + char *pszSRS_WKT_ProjRef = ITK_NULLPTR; if (setProjectionRef || setProjectionRef_UTM) { oSRS_ProjRef.SetWellKnownGeogCS( "WGS84" ); @@ -595,7 +595,7 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt GDALDataset *poDataset; poDataset = (GDALDataset *) GDALOpen( filename.c_str(), GA_ReadOnly ); - if( poDataset == NULL ) + if( poDataset == ITK_NULLPTR ) return false; // Get some information from file diff --git a/Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx b/Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx index 8fc75af28c..e2638847a3 100644 --- a/Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx +++ b/Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx @@ -54,7 +54,7 @@ int otbGDALReadPxlComplexGeneric(int argc, char * argv[]) GDALAllRegister(); poDataset = (GDALDataset *) GDALOpen( argv[1], GA_ReadOnly ); - if( poDataset == NULL ) + if( poDataset == ITK_NULLPTR ) return EXIT_FAILURE; // Get some information from file @@ -86,7 +86,7 @@ int otbGDALReadPxlComplexGeneric(int argc, char * argv[]) loadBuffer, // pData sizeX, sizeY, pxlTypeInFile, - nbBand, NULL, + nbBand, ITK_NULLPTR, pixelOffset, lineOffset, bandOffset); // Check if gdal call succeed if (lCrGdal == CE_Failure) diff --git a/Modules/IO/IOJPEG2000/src/otbJPEG2000ImageIO.cxx b/Modules/IO/IOJPEG2000/src/otbJPEG2000ImageIO.cxx index e98c1a7e3e..e1d79be76d 100644 --- a/Modules/IO/IOJPEG2000/src/otbJPEG2000ImageIO.cxx +++ b/Modules/IO/IOJPEG2000/src/otbJPEG2000ImageIO.cxx @@ -175,7 +175,7 @@ public: if (m_JP2Metadata.pszProjection) return m_JP2Metadata.pszProjection; else - return NULL; + return ITK_NULLPTR; }; /** Get the GML box from file*/ @@ -183,7 +183,7 @@ public: if (m_JP2Metadata.papszGMLMetadata) return m_JP2Metadata.papszGMLMetadata; else - return NULL; + return ITK_NULLPTR; }; // Get the origin from GML box (use tinyxml to parse the GML box) @@ -428,9 +428,9 @@ boost::shared_ptr<opj_image_t> JPEG2000InternalReader::DecodeTile(unsigned int t // Set default event mgr // catch events using our callbacks and give a local context - opj_set_info_handler(codec.get(), info_callback,00); - opj_set_warning_handler(codec.get(), warning_callback,00); - opj_set_error_handler(codec.get(), error_callback,00); + opj_set_info_handler(codec.get(), info_callback,ITK_NULLPTR); + opj_set_warning_handler(codec.get(), warning_callback,ITK_NULLPTR); + opj_set_error_handler(codec.get(), error_callback,ITK_NULLPTR); // Setup the decoder decoding parameters using user parameters if (!opj_setup_decoder(codec.get(), ¶meters)) @@ -441,7 +441,7 @@ boost::shared_ptr<opj_image_t> JPEG2000InternalReader::DecodeTile(unsigned int t // Read the main header of the codestream and if necessary the JP2 // boxes - opj_image_t * unsafeOpjImgPtr = NULL; + opj_image_t * unsafeOpjImgPtr = ITK_NULLPTR; if (!opj_read_header(stream.get(), codec.get(),&unsafeOpjImgPtr)) { @@ -512,9 +512,9 @@ int JPEG2000InternalReader::Initialize() // Set default event mgr // catch events using our callbacks and give a local context - opj_set_info_handler(codec.get(), info_callback,00); - opj_set_warning_handler(codec.get(), warning_callback,00); - opj_set_error_handler(codec.get(), error_callback,00); + opj_set_info_handler(codec.get(), info_callback,ITK_NULLPTR); + opj_set_warning_handler(codec.get(), warning_callback,ITK_NULLPTR); + opj_set_error_handler(codec.get(), error_callback,ITK_NULLPTR); // Setup the decoder decoding parameters using user parameters if (!opj_setup_decoder(codec.get(), ¶meters)) @@ -526,7 +526,7 @@ int JPEG2000InternalReader::Initialize() // Read the main header of the codestream and if necessary the JP2 // boxes - opj_image_t * unsafeOpjImgPtr = NULL; + opj_image_t * unsafeOpjImgPtr = ITK_NULLPTR; if (!opj_read_header(stream.get(), codec.get(),&unsafeOpjImgPtr)) { @@ -829,7 +829,7 @@ JPEG2000ImageIO::~JPEG2000ImageIO() bool JPEG2000ImageIO::CanReadFile(const char* filename) { - if (filename == NULL) + if (filename == ITK_NULLPTR) { itkDebugMacro(<< "No filename specified."); return false; @@ -931,7 +931,7 @@ void JPEG2000ImageIO::Read(void* buffer) chrono.Start(); // Check if conversion succeed - if (buffer == NULL) + if (buffer == ITK_NULLPTR) { itkExceptionMacro(<< "JPEG2000ImageIO : Bad alloc"); return; @@ -1369,7 +1369,7 @@ void JPEG2000ImageIO::ReadImageInformation() otbMsgDevMacro(<< "JPEG2000 file has GMLMetadata!"); std::string key; - for (int cpt = 0; papszGMLMetadata[cpt] != NULL; ++cpt) + for (int cpt = 0; papszGMLMetadata[cpt] != ITK_NULLPTR; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::MetadataKey << cpt; @@ -1384,14 +1384,14 @@ void JPEG2000ImageIO::ReadImageInformation() /* ProjectionRef*/ if (lJP2MetadataReader.GetProjectionRef() && !std::string(lJP2MetadataReader.GetProjectionRef()).empty() ) { - OGRSpatialReferenceH pSR = OSRNewSpatialReference(NULL); + OGRSpatialReferenceH pSR = OSRNewSpatialReference(ITK_NULLPTR); - const char * pszProjection = NULL; + const char * pszProjection = ITK_NULLPTR; pszProjection = lJP2MetadataReader.GetProjectionRef(); if (OSRImportFromWkt(pSR, (char **) (&pszProjection)) == OGRERR_NONE) { - char * pszPrettyWkt = NULL; + char * pszPrettyWkt = ITK_NULLPTR; OSRExportToPrettyWkt(pSR, &pszPrettyWkt, FALSE); itk::EncapsulateMetaData<std::string> (dict, MetaDataKey::ProjectionRefKey, @@ -1405,10 +1405,10 @@ void JPEG2000ImageIO::ReadImageInformation() static_cast<std::string>(lJP2MetadataReader.GetProjectionRef())); } - if (pSR != NULL) + if (pSR != ITK_NULLPTR) { OSRRelease(pSR); - pSR = NULL; + pSR = ITK_NULLPTR; } } else diff --git a/Modules/IO/IOKML/include/otbKMLVectorDataIO.h b/Modules/IO/IOKML/include/otbKMLVectorDataIO.h index ddbed80312..971da85557 100644 --- a/Modules/IO/IOKML/include/otbKMLVectorDataIO.h +++ b/Modules/IO/IOKML/include/otbKMLVectorDataIO.h @@ -99,7 +99,7 @@ public: bool CanWriteFile(const char*) const ITK_OVERRIDE; /** Writes the data to disk from the data structure provided */ - void Write(const itk::DataObject* data, char ** papszOptions = NULL) ITK_OVERRIDE; + void Write(const itk::DataObject* data, char ** papszOptions = ITK_NULLPTR) ITK_OVERRIDE; protected: /** Constructor.*/ diff --git a/Modules/IO/IOKML/src/otbKMLVectorDataIO.cxx b/Modules/IO/IOKML/src/otbKMLVectorDataIO.cxx index abc2e04901..68f6a9811b 100644 --- a/Modules/IO/IOKML/src/otbKMLVectorDataIO.cxx +++ b/Modules/IO/IOKML/src/otbKMLVectorDataIO.cxx @@ -102,7 +102,7 @@ KMLVectorDataIO::PrintIndented(const std::string& item, int depth) void KMLVectorDataIO::WalkFeature(const kmldom::FeaturePtr& feature, DataNodePointerType father) { - DataNodePointerType node = NULL; + DataNodePointerType node = ITK_NULLPTR; if (!feature) return; @@ -127,7 +127,7 @@ void KMLVectorDataIO::WalkContainer(const kmldom::ContainerPtr& container, DataNodePointerType father) { - DataNodePointerType node = NULL; + DataNodePointerType node = ITK_NULLPTR; for (size_t i = 0; i < container->get_feature_array_size(); ++i) { @@ -201,7 +201,7 @@ KMLVectorDataIO::WalkGeometry(const kmldom::GeometryPtr& geometry, DataNodePoint { // Creation of a node - DataNodePointerType node = NULL; + DataNodePointerType node = ITK_NULLPTR; if (!geometry) { @@ -268,7 +268,7 @@ KMLVectorDataIO ::ConvertGeometryToPointNode(const kmldom::GeometryPtr& geometry) { - if (geometry == NULL) + if (geometry == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert kmldom::GeometryPtr to PointNode"); } @@ -300,7 +300,7 @@ KMLVectorDataIO ::ConvertGeometryToLineStringNode(const kmldom::GeometryPtr& geometry) { - if (geometry == NULL) + if (geometry == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert kmldom::GeometryPtr to LineNode"); } @@ -336,7 +336,7 @@ KMLVectorDataIO ::ConvertGeometryToLinearRingNode(const kmldom::GeometryPtr& geometry) { - if (geometry == NULL) + if (geometry == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert kmldom::GeometryPtr to LineNode"); } @@ -372,7 +372,7 @@ KMLVectorDataIO ::ConvertGeometryToPolygonNode(const kmldom::GeometryPtr& geometry) { - if (geometry == NULL) + if (geometry == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Failed to convert kmldom::GeometryPtr to LineNode"); } @@ -554,7 +554,7 @@ void KMLVectorDataIO::Write(const itk::DataObject* datag, char ** itkNotUsed(pap //Create the factory kmldom::KmlFactory* factory = kmldom::KmlFactory::GetFactory(); - if (factory == NULL) + if (factory == ITK_NULLPTR) { itkExceptionMacro(<< "Impossible to create the KML Factory to write file " << this->m_FileName); } @@ -570,9 +570,9 @@ void KMLVectorDataIO::Write(const itk::DataObject* datag, char ** itkNotUsed(pap TreeIteratorType it(tree); it.GoToBegin(); - kmldom::DocumentPtr currentDocument = NULL; - kmldom::FolderPtr currentFolder = NULL; - kmldom::MultiGeometryPtr currentMultiGeometry = NULL; + kmldom::DocumentPtr currentDocument = ITK_NULLPTR; + kmldom::FolderPtr currentFolder = ITK_NULLPTR; + kmldom::MultiGeometryPtr currentMultiGeometry = ITK_NULLPTR; InternalTreeNodeType * inputRoot = const_cast<InternalTreeNodeType *>(tree->GetRoot()); ProcessNodeWrite(inputRoot, factory, kml, currentDocument, currentFolder, currentMultiGeometry); @@ -671,7 +671,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, kmldom::PointPtr point = factory->CreatePoint(); point->set_coordinates(coordinates); - if (currentMultiGeometry != NULL) + if (currentMultiGeometry != ITK_NULLPTR) { currentMultiGeometry->add_geometry(point); } @@ -680,7 +680,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); placemark->set_geometry(point); - if (currentFolder != NULL) + if (currentFolder != ITK_NULLPTR) { currentFolder->add_feature(placemark); } @@ -718,7 +718,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, ++vIt; } - if (currentMultiGeometry != NULL) + if (currentMultiGeometry != ITK_NULLPTR) { currentMultiGeometry->add_geometry(line); } @@ -726,7 +726,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, { kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); placemark->set_geometry(line); - if (currentFolder != NULL) + if (currentFolder != ITK_NULLPTR) { currentFolder->add_feature(placemark); } @@ -837,7 +837,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, innerboundaryis->clear_linearring(); } - if (currentMultiGeometry != NULL) + if (currentMultiGeometry != ITK_NULLPTR) { currentMultiGeometry->add_geometry(polygon); } @@ -845,7 +845,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, { kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); placemark->set_geometry(polygon); - if (currentFolder != NULL) + if (currentFolder != ITK_NULLPTR) { currentFolder->add_feature(placemark); } @@ -863,7 +863,7 @@ void KMLVectorDataIO::ProcessNodeWrite(InternalTreeNodeType * source, currentMultiGeometry = multi; kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); placemark->set_geometry(multi); - if (currentFolder != NULL) + if (currentFolder != ITK_NULLPTR) { currentFolder->add_feature(placemark); } diff --git a/Modules/IO/IOLUM/src/otbLUMImageIO.cxx b/Modules/IO/IOLUM/src/otbLUMImageIO.cxx index 1e4378c0b1..451c73a12f 100644 --- a/Modules/IO/IOLUM/src/otbLUMImageIO.cxx +++ b/Modules/IO/IOLUM/src/otbLUMImageIO.cxx @@ -412,7 +412,7 @@ void LUMImageIO::WriteImageInformation() m_File.write(value, headerLength); } delete[] value; - value = NULL; + value = ITK_NULLPTR; //Set m_TypeLum if (0) {} otbSetTypeLumMacro(CHAR, "08BI", "08LI") @@ -464,7 +464,7 @@ int LUMImageIO::CaiGetTypeLum(const char * type_code, taille = -1; int nbbits = -1; ind = 0; - pch0 = NULL; + pch0 = ITK_NULLPTR; std::string str_type_code(type_code); while ((trouve == -1) && (ind < m_CaiLumTyp.size())) @@ -499,17 +499,17 @@ int LUMImageIO::CaiGetTypeLum(const char * type_code, pch0 = const_cast<char *>(strstr(type_code, "U")); if (taille == 1) { - if (pch0 == NULL) sprintf(cod_pix, "OCT"); + if (pch0 == ITK_NULLPTR) sprintf(cod_pix, "OCT"); else sprintf(cod_pix, "UOCT"); } else if (taille == 2) { - if (pch0 == NULL) sprintf(cod_pix, "I2"); + if (pch0 == ITK_NULLPTR) sprintf(cod_pix, "I2"); else sprintf(cod_pix, "UI2"); } else if (taille == 4) { - if (pch0 == NULL) sprintf(cod_pix, "I4"); + if (pch0 == ITK_NULLPTR) sprintf(cod_pix, "I4"); else sprintf(cod_pix, "UI4"); } else taille = -1; diff --git a/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx b/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx index 7ac218c33b..b5112efe57 100644 --- a/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx +++ b/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx @@ -60,9 +60,9 @@ MSTARImageIO::MSTARImageIO() m_BytePerPixel = 0; - MSTARfp = NULL; /* Input FILE ptr to MSTAR image file */ - HDRfp = NULL; /* Output FILE ptr to MSTAR header file */ - RAWfp = NULL; + MSTARfp = ITK_NULLPTR; /* Input FILE ptr to MSTAR image file */ + HDRfp = ITK_NULLPTR; /* Output FILE ptr to MSTAR header file */ + RAWfp = ITK_NULLPTR; i = 0; j = 0; @@ -83,13 +83,13 @@ MSTARImageIO::MSTARImageIO() littleushortval = 0; littlefloatval = 0.; - MSTARname = NULL; /* Input MSTAR filename */ + MSTARname = ITK_NULLPTR; /* Input MSTAR filename */ - tptr = NULL; /* Temp buffer ptr */ - phdr = NULL; /* Ptr to buffer to hold Phoenix header */ + tptr = ITK_NULLPTR; /* Temp buffer ptr */ + phdr = ITK_NULLPTR; /* Ptr to buffer to hold Phoenix header */ - FSCENEdata = NULL; /* Ptr to Fullscene data buffer */ - CHIPdata = NULL; /* Ptr to CHIp data buffer */ + FSCENEdata = ITK_NULLPTR; /* Ptr to Fullscene data buffer */ + CHIPdata = ITK_NULLPTR; /* Ptr to CHIp data buffer */ @@ -98,10 +98,10 @@ MSTARImageIO::MSTARImageIO() /** Destructor */ MSTARImageIO::~MSTARImageIO() { - if (phdr != NULL) + if (phdr != ITK_NULLPTR) { free(phdr); - phdr = NULL; + phdr = ITK_NULLPTR; } } @@ -117,7 +117,7 @@ bool MSTARImageIO::CanReadFile(const char* filename) MSTARname = filename; MSTARfp = fopen(MSTARname, "rb"); - if (MSTARfp == NULL) + if (MSTARfp == ITK_NULLPTR) { otbMsgDevMacro(<< "\nError: Unable to open [" << MSTARname << "] for reading!\n"); return false; @@ -133,18 +133,18 @@ bool MSTARImageIO::CanReadFile(const char* filename) { otbMsgDevMacro(<< "\nError: Unable in reading [" << MSTARname << "] header... Only read ["<< returnVal <<" of 1024 bytes !\n"); fclose(MSTARfp); - MSTARfp = NULL; + MSTARfp = ITK_NULLPTR; return false; } rewind(MSTARfp); /* Extract Phoenix Summary header length */ tptr = (char *) strstr(tbuff, "PhoenixHeaderLength= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { // fprintf(stderr,"Can not determine Phoenix header length!\n"); fclose(MSTARfp); - MSTARfp = NULL; + MSTARfp = ITK_NULLPTR; return false; } else @@ -154,11 +154,11 @@ bool MSTARImageIO::CanReadFile(const char* filename) /* Check for and extract native header length */ tptr = (char *) strstr(tbuff, "native_header_length= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { // fprintf(stderr,"Can not determine native header length!\n"); fclose(MSTARfp); - MSTARfp = NULL; + MSTARfp = ITK_NULLPTR; return false; } else @@ -168,7 +168,7 @@ bool MSTARImageIO::CanReadFile(const char* filename) /* Extract MSTAR column width */ tptr = (char *) strstr(tbuff, "NumberOfColumns= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { otbMsgDevMacro(<< "Error: Can not determine MSTAR image width"); fclose(MSTARfp); @@ -182,11 +182,11 @@ bool MSTARImageIO::CanReadFile(const char* filename) /* Extract MSTAR row height */ tptr = (char *) strstr(tbuff, "NumberOfRows= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { otbMsgDevMacro(<< "Error: Can not determine MSTAR image height!"); fclose(MSTARfp); - MSTARfp = NULL; + MSTARfp = ITK_NULLPTR; return false; } else @@ -237,7 +237,7 @@ bool MSTARImageIO::CanReadFile(const char* filename) // free(phdr); fclose(MSTARfp); - MSTARfp = NULL; + MSTARfp = ITK_NULLPTR; otbMsgDevMacro(<< "Can read MSTAR"); return bool(true); } @@ -267,7 +267,7 @@ void MSTARImageIO::Read(void* buffer) { MSTARfp = fopen(MSTARname, "rb"); - if (MSTARfp == NULL) + if (MSTARfp == ITK_NULLPTR) { itkExceptionMacro(<< "Error: Unable to open file for reading!\n\n " << m_FileName.c_str() << ")."); } @@ -287,7 +287,7 @@ void MSTARImageIO::Read(void* buffer) /* Extract Phoenix Summary header length */ tptr = (char *) strstr(tbuff, "PhoenixHeaderLength= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine Phoenix header length!"); @@ -299,7 +299,7 @@ void MSTARImageIO::Read(void* buffer) /* Check for and extract native header length */ tptr = (char *) strstr(tbuff, "native_header_length= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Can not determine native header length!\n"); @@ -311,7 +311,7 @@ void MSTARImageIO::Read(void* buffer) /* Extract MSTAR column width */ tptr = (char *) strstr(tbuff, "NumberOfColumns= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine MSTAR image width"); @@ -324,7 +324,7 @@ void MSTARImageIO::Read(void* buffer) /* Extract MSTAR row height */ tptr = (char *) strstr(tbuff, "NumberOfRows= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine MSTAR image height!"); @@ -431,7 +431,7 @@ void MSTARImageIO::Read(void* buffer) bytesPerImage = totchunks * sizeof(float); CHIPdata = (float *) malloc(bytesPerImage); - if (CHIPdata == (float *) NULL) + if (CHIPdata == (float *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro("Error: Unable to malloc CHIP memory!\n"); @@ -476,7 +476,7 @@ void MSTARImageIO::Read(void* buffer) case FSCENE_IMAGE: bytesPerImage = nchunks * sizeof(short); FSCENEdata = (unsigned short *) malloc(bytesPerImage); - if (FSCENEdata == (unsigned short *) NULL) + if (FSCENEdata == (unsigned short *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Unable to malloc fullscene memory!\n"); @@ -587,7 +587,7 @@ void MSTARImageIO::ReadImageInformation() MSTARname = m_FileName.c_str(); MSTARfp = fopen(MSTARname, "rb"); - if (MSTARfp == NULL) + if (MSTARfp == ITK_NULLPTR) { itkExceptionMacro(<< "Error: Unable to open file for reading!\n\n " << m_FileName.c_str()); } @@ -607,7 +607,7 @@ void MSTARImageIO::ReadImageInformation() /* Extract Phoenix Summary header length */ tptr = (char *) strstr(tbuff, "PhoenixHeaderLength= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine Phoenix header length!"); @@ -619,7 +619,7 @@ void MSTARImageIO::ReadImageInformation() /* Check for and extract native header length */ tptr = (char *) strstr(tbuff, "native_header_length= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Can not determine native header length!\n"); @@ -631,7 +631,7 @@ void MSTARImageIO::ReadImageInformation() /* Extract MSTAR column width */ tptr = (char *) strstr(tbuff, "NumberOfColumns= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine MSTAR image width"); @@ -644,7 +644,7 @@ void MSTARImageIO::ReadImageInformation() /* Extract MSTAR row height */ tptr = (char *) strstr(tbuff, "NumberOfRows= "); - if (tptr == (char *) NULL) + if (tptr == (char *) ITK_NULLPTR) { fclose(MSTARfp); itkExceptionMacro(<< "Error: Can not determine MSTAR image height!"); diff --git a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx index 0235765429..b4766e4ff3 100644 --- a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx +++ b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx @@ -230,7 +230,7 @@ void ONERAImageIO::Read(void* buffer) } delete[] value; - value = NULL; + value = ITK_NULLPTR; } @@ -514,7 +514,7 @@ void ONERAImageIO::Write(const void* buffer) } delete[] tempmemory; - tempmemory = NULL; + tempmemory = ITK_NULLPTR; } // To be consistent with the behavior of GDALImageIO diff --git a/Modules/IO/IORAD/src/otbRADImageIO.cxx b/Modules/IO/IORAD/src/otbRADImageIO.cxx index acea472769..98fcf67ea9 100644 --- a/Modules/IO/IORAD/src/otbRADImageIO.cxx +++ b/Modules/IO/IORAD/src/otbRADImageIO.cxx @@ -61,7 +61,7 @@ RADImageIO::RADImageIO() // (consistency between ImageIO, see Mantis #942) m_Origin[0] = 0.5; m_Origin[1] = 0.5; - m_ChannelsFile = NULL; + m_ChannelsFile = ITK_NULLPTR; m_FlagWriteImageInformation = true; this->AddSupportedWriteExtension(".rad"); @@ -79,7 +79,7 @@ RADImageIO::~RADImageIO() { m_HeaderFile.close(); } - if (m_ChannelsFile != NULL) + if (m_ChannelsFile != ITK_NULLPTR) { for (unsigned int numChannel = 0; numChannel < m_NbOfChannels; ++numChannel) { @@ -158,7 +158,7 @@ void RADImageIO::Read(void* buffer) step = step * (unsigned long) (this->GetComponentSize()); char * value = new char[numberOfBytesToBeRead]; - if (value == NULL) + if (value == ITK_NULLPTR) { itkExceptionMacro(<< "RADImageIO::Read(): Bad alloc"); return; @@ -220,7 +220,7 @@ void RADImageIO::Read(void* buffer) } delete[] value; - value = NULL; + value = ITK_NULLPTR; } @@ -544,7 +544,7 @@ void RADImageIO::Write(const void* buffer) const char * p = static_cast<const char *>(buffer); char* value = new char[numberOfBytesToBeWrite]; - if (value == NULL) + if (value == ITK_NULLPTR) { itkExceptionMacro(<< "RADImageIO::Write : Bad Alloc"); return; diff --git a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx b/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx index 38205436c1..41d6044df7 100644 --- a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx +++ b/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx @@ -105,7 +105,7 @@ TileMapImageIO::~TileMapImageIO() bool TileMapImageIO::CanReadFile(const char* file) { // First check the extension - if (file == NULL) + if (file == ITK_NULLPTR) { itkDebugMacro(<< "No filename specified."); return false; @@ -146,7 +146,7 @@ void TileMapImageIO::PrintSelf(std::ostream& os, itk::Indent indent) const void TileMapImageIO::Read(void* buffer) { unsigned char * p = static_cast<unsigned char *>(buffer); - if (p == NULL) + if (p == ITK_NULLPTR) { itkExceptionMacro(<< "Memory allocation error"); return; @@ -353,7 +353,7 @@ void TileMapImageIO::GenerateBuffer(unsigned char *p) void TileMapImageIO::ReadTile(const std::string& filename, void * buffer) { otbMsgDevMacro(<< "Retrieving " << filename); - unsigned char * bufferCacheFault = NULL; + unsigned char * bufferCacheFault = ITK_NULLPTR; otb::ImageIOBase::Pointer imageIO; imageIO = otb::GDALImageIO::New(); @@ -529,7 +529,7 @@ void TileMapImageIO::ReadImageInformation() bool TileMapImageIO::CanWriteFile(const char* name) { // First if filename is provided - if (name == NULL) + if (name == ITK_NULLPTR) { itkDebugMacro(<< "No filename specified."); return false; @@ -554,7 +554,7 @@ void TileMapImageIO::Write(const void* buffer) { const unsigned char * p = static_cast<const unsigned char *>(buffer); - if (p == NULL) + if (p == ITK_NULLPTR) { itkExceptionMacro(<< "Memory allocation error"); return; diff --git a/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.txx b/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.txx index 2bf86d544e..cf7bf35347 100644 --- a/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.txx +++ b/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.txx @@ -179,7 +179,7 @@ StatisticsXMLFileReader<TMeasurementVector> { // Iterate through the tree to get all the stats for( TiXmlElement* currentStat = root->FirstChildElement(); - currentStat != NULL; + currentStat != ITK_NULLPTR; currentStat = currentStat->NextSiblingElement() ) { InputDataType currentStatisticVector; @@ -193,7 +193,7 @@ StatisticsXMLFileReader<TMeasurementVector> std::vector<double> tempMeasurementVector; for( TiXmlElement* sample = currentStat->FirstChildElement("StatisticVector"); - sample != NULL; + sample != ITK_NULLPTR; sample = sample->NextSiblingElement() ) { // Get the current value of the statistic vector @@ -220,24 +220,24 @@ StatisticsXMLFileReader<TMeasurementVector> { // Iterate through the tree to get all the stats for( TiXmlElement* currentStat = root->FirstChildElement(); - currentStat != NULL; + currentStat != ITK_NULLPTR; currentStat = currentStat->NextSiblingElement() ) { GenericMapType currentMap; std::string currentName(currentStat->Attribute("name")); for( TiXmlElement* sample = currentStat->FirstChildElement("StatisticMap"); - sample != NULL; + sample != ITK_NULLPTR; sample = sample->NextSiblingElement() ) { // Get the current pair of the statistic map const char *c_key = sample->Attribute("key"); const char *c_value = sample->Attribute("value"); - if (c_key == NULL) + if (c_key == ITK_NULLPTR) { itkExceptionMacro("'key' attribute not found in StatisticMap !"); } - if (c_value == NULL) + if (c_value == ITK_NULLPTR) { itkExceptionMacro("'value' attribute not found in StatisticMap !"); } diff --git a/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx b/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx index b3f7e16a11..9f669178e2 100644 --- a/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx +++ b/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx @@ -81,7 +81,7 @@ StatisticsXMLFileWriter<TMeasurementVector> TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); doc.LinkEndChild( decl ); - TiXmlElement * root = NULL; + TiXmlElement * root = ITK_NULLPTR; if (m_MeasurementVectorContainer.size()) { root = new TiXmlElement( "FeatureStatistics"); @@ -110,7 +110,7 @@ StatisticsXMLFileWriter<TMeasurementVector> } // Iterate on map containers - TiXmlElement * mapRoot = NULL; + TiXmlElement * mapRoot = ITK_NULLPTR; if (m_GenericMapContainer.size()) { mapRoot = new TiXmlElement( "GeneralStatistics"); diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.txx b/Modules/IO/ImageIO/include/otbImageFileWriter.txx index 49de27982d..0798c41ac8 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.txx +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.txx @@ -256,7 +256,7 @@ ImageFileWriter<TInputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType*>(this->ProcessObject::GetInput(0)); @@ -803,7 +803,7 @@ ImageFileWriter<TInputImage> { this->m_FilenameHelper->SetExtendedFileName(extendedFileName); m_FileName = this->m_FilenameHelper->GetSimpleFileName(); - m_ImageIO = NULL; + m_ImageIO = ITK_NULLPTR; this->Modified(); } diff --git a/Modules/IO/ImageIO/include/otbScalarBufferToImageFileWriter.txx b/Modules/IO/ImageIO/include/otbScalarBufferToImageFileWriter.txx index 2c788496d3..ecde179800 100644 --- a/Modules/IO/ImageIO/include/otbScalarBufferToImageFileWriter.txx +++ b/Modules/IO/ImageIO/include/otbScalarBufferToImageFileWriter.txx @@ -27,7 +27,7 @@ namespace otb { template<class TBufferType, class TOutputPixelType> ScalarBufferToImageFileWriter<TBufferType, TOutputPixelType> -::ScalarBufferToImageFileWriter() : m_Buffer(NULL), m_NumberOfChannels(0), m_InverseXSpacing(false) +::ScalarBufferToImageFileWriter() : m_Buffer(ITK_NULLPTR), m_NumberOfChannels(0), m_InverseXSpacing(false) { m_Writer = WriterType::New(); m_ImageSize.Fill(0); diff --git a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx index 82967f8c1a..ab57012270 100644 --- a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx +++ b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx @@ -82,7 +82,7 @@ ImageIOFactory::CreateImageIO(const char* path, FileModeType mode) } } - return 0; + return ITK_NULLPTR; } void diff --git a/Modules/IO/ImageIO/test/otbImageIOFactoryNew.cxx b/Modules/IO/ImageIO/test/otbImageIOFactoryNew.cxx index 28eb252d3c..7c1eec765c 100644 --- a/Modules/IO/ImageIO/test/otbImageIOFactoryNew.cxx +++ b/Modules/IO/ImageIO/test/otbImageIOFactoryNew.cxx @@ -25,6 +25,6 @@ int otbImageIOFactoryNew(int itkNotUsed(argc), char * itkNotUsed(argv) []) { otb::ImageIOFactory *lImageIOFactory; - lImageIOFactory = NULL; - return lImageIOFactory != NULL; //to avoid unused variable warning + lImageIOFactory = ITK_NULLPTR; + return lImageIOFactory != ITK_NULLPTR; //to avoid unused variable warning } diff --git a/Modules/IO/ImageIO/test/otbScalarBufferToImageFileWriterTest.cxx b/Modules/IO/ImageIO/test/otbScalarBufferToImageFileWriterTest.cxx index 1961cd4e43..9c7ff8bff3 100644 --- a/Modules/IO/ImageIO/test/otbScalarBufferToImageFileWriterTest.cxx +++ b/Modules/IO/ImageIO/test/otbScalarBufferToImageFileWriterTest.cxx @@ -57,7 +57,7 @@ int otbScalarBufferToImageFileWriterTest(int itkNotUsed(argc), char* argv[]) filter->Update(); delete[] tab; - tab = NULL; + tab = ITK_NULLPTR; return EXIT_SUCCESS; } diff --git a/Modules/IO/KMZWriter/include/otbKmzProductWriter.txx b/Modules/IO/KMZWriter/include/otbKmzProductWriter.txx index 8cbca3b1dc..be2875927d 100644 --- a/Modules/IO/KMZWriter/include/otbKmzProductWriter.txx +++ b/Modules/IO/KMZWriter/include/otbKmzProductWriter.txx @@ -47,7 +47,7 @@ KmzProductWriter<TInputImage> { // Reset the boost::intrusive_ptr<KmzFile> : // TODO : when upgrading boost > 1.42 use method release(). - m_KmzFile = NULL; + m_KmzFile = ITK_NULLPTR; } /** @@ -84,7 +84,7 @@ KmzProductWriter<TInputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage * > @@ -270,7 +270,7 @@ KmzProductWriter<TInputImage> // Build wgs ref to compute long/lat OGRSpatialReference oSRS; oSRS.SetWellKnownGeogCS("WGS84"); - char * wgsRef = NULL; + char * wgsRef = ITK_NULLPTR; oSRS.exportToWkt(&wgsRef); // Update image base information diff --git a/Modules/IO/TestKernel/include/otbTestHelper.h b/Modules/IO/TestKernel/include/otbTestHelper.h index a6a615db84..f7efa67a88 100644 --- a/Modules/IO/TestKernel/include/otbTestHelper.h +++ b/Modules/IO/TestKernel/include/otbTestHelper.h @@ -141,8 +141,8 @@ private: OGRLayer * test_poLayer, const char *test_pszWHERE, OGRGeometry *test_poSpatialFilter, int& nbdiff) const; - static void DumpOGRFeature(FILE* fileid, OGRFeature* feature, char** papszOptions = NULL); - static void DumpOGRGeometry(FILE* fileid, OGRGeometry* geometry, const char * pszPrefix, char** papszOptions = NULL); + static void DumpOGRFeature(FILE* fileid, OGRFeature* feature, char** papszOptions = ITK_NULLPTR); + static void DumpOGRGeometry(FILE* fileid, OGRGeometry* geometry, const char * pszPrefix, char** papszOptions = ITK_NULLPTR); double m_ToleranceDiffValue; double m_Epsilon; diff --git a/Modules/IO/TestKernel/src/otbTestDriver.cxx b/Modules/IO/TestKernel/src/otbTestDriver.cxx index 4fbeeb755b..8e96ad7184 100644 --- a/Modules/IO/TestKernel/src/otbTestDriver.cxx +++ b/Modules/IO/TestKernel/src/otbTestDriver.cxx @@ -176,7 +176,7 @@ int main(int ac, char* av[]) { argv[i + 1] = remainingArgs[i]; } - argv[remainingArgs.size() + 1] = NULL; + argv[remainingArgs.size() + 1] = ITK_NULLPTR; /** Call to the otbTestMain */ return otbTestMain(static_cast<int>(remainingArgs.size()), argv); @@ -194,7 +194,7 @@ int Execute(int argc, char * argv[]) itksysProcess_SetPipeShared(process, itksysProcess_Pipe_STDOUT, true); itksysProcess_SetPipeShared(process, itksysProcess_Pipe_STDERR, true); itksysProcess_Execute(process); - itksysProcess_WaitForExit(process, NULL); + itksysProcess_WaitForExit(process, ITK_NULLPTR); int retCode = itksysProcess_GetExitValue(process); return retCode; } diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index a10623362f..6dae89b62f 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -1076,31 +1076,31 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b /* -------------------------------------------------------------------- */ /* Open data source. */ /* -------------------------------------------------------------------- */ - otb::ogr::version_proxy::GDALDatasetType *ref_poDS = NULL; - otb::ogr::version_proxy::GDALDriverType * ref_poDriver = NULL; + otb::ogr::version_proxy::GDALDatasetType *ref_poDS = ITK_NULLPTR; + otb::ogr::version_proxy::GDALDriverType * ref_poDriver = ITK_NULLPTR; //OGRGeometry * ref_poSpatialFilter = NULL; - otb::ogr::version_proxy::GDALDatasetType *test_poDS = NULL; - otb::ogr::version_proxy::GDALDriverType * test_poDriver = NULL; + otb::ogr::version_proxy::GDALDatasetType *test_poDS = ITK_NULLPTR; + otb::ogr::version_proxy::GDALDriverType * test_poDriver = ITK_NULLPTR; //OGRGeometry * test_poSpatialFilter = NULL; ref_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, false); - if (ref_poDS == NULL && !bReadOnly) + if (ref_poDS == ITK_NULLPTR && !bReadOnly) { ref_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, true); bReadOnly = TRUE; - if (ref_poDS != NULL && m_ReportErrors) + if (ref_poDS != ITK_NULLPTR && m_ReportErrors) { std::cout << "Had to open REF data source read-only."<<std::endl; } } test_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, bReadOnly); - if (test_poDS == NULL && !bReadOnly) + if (test_poDS == ITK_NULLPTR && !bReadOnly) { test_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, bReadOnly); bReadOnly = TRUE; - if (test_poDS != NULL && m_ReportErrors) + if (test_poDS != ITK_NULLPTR && m_ReportErrors) { std::cout << "Had to open TEST data source read-only."<<std::endl; } @@ -1108,7 +1108,7 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b /* -------------------------------------------------------------------- */ /* Report failure */ /* -------------------------------------------------------------------- */ - if (ref_poDS == NULL) + if (ref_poDS == ITK_NULLPTR) { if (m_ReportErrors) @@ -1127,7 +1127,7 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b ref_poDriver = ref_poDS->GetDriver(); CPLAssert(ref_poDriver != NULL); - if (test_poDS == NULL) + if (test_poDS == ITK_NULLPTR) { if (m_ReportErrors) { @@ -1183,14 +1183,14 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b OGRLayer *ref_poLayer = ref_poDS->GetLayer(iLayer); OGRLayer *test_poLayer = test_poDS->GetLayer(iLayer); - if (ref_poLayer == NULL) + if (ref_poLayer == ITK_NULLPTR) { if (m_ReportErrors) std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << " for REF data source" << std::endl; return (1); } - if (test_poLayer == NULL) + if (test_poLayer == ITK_NULLPTR) { if (m_ReportErrors) std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << @@ -1199,20 +1199,20 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b } //Check Layer inforamtion - ogrReportOnLayer(ref_poLayer, NULL, NULL, test_poLayer, NULL, NULL, nbdiff); + ogrReportOnLayer(ref_poLayer, ITK_NULLPTR, ITK_NULLPTR, test_poLayer, ITK_NULLPTR, ITK_NULLPTR, nbdiff); //If no difference, check the feature if (nbdiff == 0) { - OGRFeature * ref_poFeature = NULL; - OGRFeature * test_poFeature = NULL; + OGRFeature * ref_poFeature = ITK_NULLPTR; + OGRFeature * test_poFeature = ITK_NULLPTR; std::string basefilename(test_pszDataSource); int nbFeature(0); std::stringstream oss2; oss2.str(""); oss2 << iLayer; - while ((ref_poFeature = ref_poLayer->GetNextFeature()) != NULL) + while ((ref_poFeature = ref_poLayer->GetNextFeature()) != ITK_NULLPTR) { test_poFeature = test_poLayer->GetNextFeature(); std::stringstream oss; @@ -1223,9 +1223,9 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b + "_ref.txt"; std::string test_filename = basefilename + "_temporary_layer_" + oss2.str() + "_feature_" + oss.str() + "_test.txt"; - FILE *ref_f(NULL); + FILE *ref_f(ITK_NULLPTR); ref_f = fopen(ref_filename.c_str(), "w"); - if (ref_f == NULL) + if (ref_f == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Impossible to create ASCII file <" << ref_filename << ">."); } @@ -1233,9 +1233,9 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b OGRFeature::DestroyFeature( ref_poFeature ); fclose(ref_f); - FILE *test_f(NULL); + FILE *test_f(ITK_NULLPTR); test_f = fopen(test_filename.c_str(), "w"); - if (test_f == NULL) + if (test_f == ITK_NULLPTR) { itkGenericExceptionMacro(<< "Impossible to create ASCII file <" << test_filename << ">."); } @@ -1268,7 +1268,7 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOptions) { - if (fpOut == NULL) fpOut = stdout; + if (fpOut == ITK_NULLPTR) fpOut = stdout; if(!feature) { @@ -1280,7 +1280,7 @@ void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOp const char* pszDisplayFields = CSLFetchNameValue(papszOptions, "DISPLAY_FIELDS"); - if (pszDisplayFields == NULL || CSLTestBoolean(pszDisplayFields)) + if (pszDisplayFields == ITK_NULLPTR || CSLTestBoolean(pszDisplayFields)) { for (int iField = 0; iField < feature->GetFieldCount(); iField++) { @@ -1296,21 +1296,21 @@ void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOp } } - if (feature->GetStyleString() != NULL) + if (feature->GetStyleString() != ITK_NULLPTR) { const char* pszDisplayStyle = CSLFetchNameValue(papszOptions, "DISPLAY_STYLE"); - if (pszDisplayStyle == NULL || CSLTestBoolean(pszDisplayStyle)) + if (pszDisplayStyle == ITK_NULLPTR || CSLTestBoolean(pszDisplayStyle)) { fprintf(fpOut, " Style = %s\n", feature->GetStyleString()); } } - if (feature->GetGeometryRef() != NULL) + if (feature->GetGeometryRef() != ITK_NULLPTR) { const char* pszDisplayGeometry = CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); - if (!(pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "NO"))) + if (!(pszDisplayGeometry != ITK_NULLPTR && EQUAL(pszDisplayGeometry, "NO"))) { DumpOGRGeometry(fpOut, feature->GetGeometryRef(), " ", papszOptions); } @@ -1321,15 +1321,15 @@ void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOp void TestHelper::DumpOGRGeometry(FILE* fp, OGRGeometry* geometry, const char * pszPrefix, char** papszOptions) { - char *pszWkt = NULL; + char *pszWkt = ITK_NULLPTR; - if (pszPrefix == NULL) pszPrefix = ""; + if (pszPrefix == ITK_NULLPTR) pszPrefix = ""; - if (fp == NULL) fp = stdout; + if (fp == ITK_NULLPTR) fp = stdout; const char* pszDisplayGeometry = CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); - if (pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "SUMMARY")) + if (pszDisplayGeometry != ITK_NULLPTR && EQUAL(pszDisplayGeometry, "SUMMARY")) { OGRLineString * poLine; OGRPolygon * poPoly; @@ -1398,7 +1398,7 @@ void TestHelper::DumpOGRGeometry(FILE* fp, OGRGeometry* geometry, const char * p break; } } - else if (pszDisplayGeometry == NULL || CSLTestBoolean(pszDisplayGeometry) || + else if (pszDisplayGeometry == ITK_NULLPTR || CSLTestBoolean(pszDisplayGeometry) || EQUAL(pszDisplayGeometry, "WKT")) { if (geometry->exportToWkt(&pszWkt) == OGRERR_NONE) @@ -1856,13 +1856,13 @@ void TestHelper::ogrReportOnLayer(OGRLayer * ref_poLayer, /* -------------------------------------------------------------------- */ otbCheckStringValue("pszWHERE", ref_pszWHERE, test_pszWHERE, nbdiff, m_ReportErrors); - if (ref_pszWHERE != NULL) ref_poLayer->SetAttributeFilter(ref_pszWHERE); + if (ref_pszWHERE != ITK_NULLPTR) ref_poLayer->SetAttributeFilter(ref_pszWHERE); - if (ref_poSpatialFilter != NULL) ref_poLayer->SetSpatialFilter(ref_poSpatialFilter); + if (ref_poSpatialFilter != ITK_NULLPTR) ref_poLayer->SetSpatialFilter(ref_poSpatialFilter); - if (test_pszWHERE != NULL) test_poLayer->SetAttributeFilter(test_pszWHERE); + if (test_pszWHERE != ITK_NULLPTR) test_poLayer->SetAttributeFilter(test_pszWHERE); - if (test_poSpatialFilter != NULL) test_poLayer->SetSpatialFilter(test_poSpatialFilter); + if (test_poSpatialFilter != ITK_NULLPTR) test_poLayer->SetSpatialFilter(test_poSpatialFilter); /* -------------------------------------------------------------------- */ /* Report various overall information. */ @@ -1893,12 +1893,12 @@ void TestHelper::ogrReportOnLayer(OGRLayer * ref_poLayer, char *ref_pszWKT; char *test_pszWKT; - if (ref_poLayer->GetSpatialRef() == NULL) ref_pszWKT = CPLStrdup("(unknown)"); + if (ref_poLayer->GetSpatialRef() == ITK_NULLPTR) ref_pszWKT = CPLStrdup("(unknown)"); else { ref_poLayer->GetSpatialRef()->exportToPrettyWkt(&ref_pszWKT); } - if (test_poLayer->GetSpatialRef() == NULL) test_pszWKT = CPLStrdup("(unknown)"); + if (test_poLayer->GetSpatialRef() == ITK_NULLPTR) test_pszWKT = CPLStrdup("(unknown)"); else { test_poLayer->GetSpatialRef()->exportToPrettyWkt(&test_pszWKT); diff --git a/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.txx b/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.txx index 318a055c33..88b92507cb 100644 --- a/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.txx +++ b/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.txx @@ -37,7 +37,7 @@ namespace otb template <class TOutputVectorData> VectorDataFileReader<TOutputVectorData> ::VectorDataFileReader() : - m_VectorDataIO(NULL), + m_VectorDataIO(ITK_NULLPTR), m_UserSpecifiedVectorDataIO(false), m_FileName("") { diff --git a/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.txx b/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.txx index 486de4260e..ee9d9935ad 100644 --- a/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.txx +++ b/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.txx @@ -34,7 +34,7 @@ template <class TInputVectorData> VectorDataFileWriter<TInputVectorData> ::VectorDataFileWriter() : m_FileName(""), - m_VectorDataIO(0), + m_VectorDataIO(ITK_NULLPTR), m_UserSpecifiedVectorDataIO(false), m_FactorySpecifiedVectorDataIO(false) { @@ -67,7 +67,7 @@ VectorDataFileWriter<TInputVectorData> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TInputVectorData*> @@ -94,7 +94,7 @@ VectorDataFileWriter<TInputVectorData> itkDebugMacro(<< "Writing a vector data file"); // Make sure input is available - if (input == 0) + if (input == ITK_NULLPTR) { itkExceptionMacro(<< "No input to writer!"); } diff --git a/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx b/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx index 3ce568ab00..82993d2789 100644 --- a/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx +++ b/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx @@ -74,7 +74,7 @@ VectorDataIOFactory } } - return 0; + return ITK_NULLPTR; } void diff --git a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.txx b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.txx index af6a06d643..f05b56e404 100644 --- a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.txx +++ b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.txx @@ -59,7 +59,7 @@ DSFusionOfClassifiersImageFilter<TInputImage, TOutputImage, TMaskImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/DempsterShafer/include/otbJointMassOfBeliefFilter.txx b/Modules/Learning/DempsterShafer/include/otbJointMassOfBeliefFilter.txx index 6446d23850..d45ccde5b2 100644 --- a/Modules/Learning/DempsterShafer/include/otbJointMassOfBeliefFilter.txx +++ b/Modules/Learning/DempsterShafer/include/otbJointMassOfBeliefFilter.txx @@ -83,7 +83,7 @@ JointMassOfBeliefFilter<TMassFunction> { if(this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<MassFunctionType *>(this->itk::ProcessObject::GetOutput(0)); } diff --git a/Modules/Learning/LearningBase/include/otbGaussianModelComponent.txx b/Modules/Learning/LearningBase/include/otbGaussianModelComponent.txx index f823ea30a3..d4ab209ef3 100644 --- a/Modules/Learning/LearningBase/include/otbGaussianModelComponent.txx +++ b/Modules/Learning/LearningBase/include/otbGaussianModelComponent.txx @@ -35,8 +35,8 @@ template<class TSample> GaussianModelComponent<TSample> ::GaussianModelComponent() { - m_CovarianceEstimator = 0; - m_GaussianMembershipFunction = 0; + m_CovarianceEstimator = ITK_NULLPTR; + m_GaussianMembershipFunction = ITK_NULLPTR; } template<class TSample> diff --git a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.txx b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.txx index 861aefe4ff..9a4a3146b6 100644 --- a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.txx +++ b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.txx @@ -52,7 +52,7 @@ KMeansImageClassificationFilter<TInputImage, TOutputImage, VMaxSampleDimension, { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/LearningBase/include/otbSEMClassifier.txx b/Modules/Learning/LearningBase/include/otbSEMClassifier.txx index bf5674f7be..28ae59d6db 100644 --- a/Modules/Learning/LearningBase/include/otbSEMClassifier.txx +++ b/Modules/Learning/LearningBase/include/otbSEMClassifier.txx @@ -42,15 +42,15 @@ SEMClassifier<TInputImage, TOutputImage> m_TerminationCode = NOT_CONVERGED; m_ExternalLabels = 0; m_ComponentDeclared = 0; - m_Sample = 0; + m_Sample = ITK_NULLPTR; m_NbSamples = 0; - m_SampleList = 0; + m_SampleList = ITK_NULLPTR; m_NbChange = 0; m_TerminationThreshold = 1E-5; m_Neighborhood = 1; - m_OutputImage = 0; - m_Output = 0; + m_OutputImage = ITK_NULLPTR; + m_Output = ITK_NULLPTR; } @@ -164,7 +164,7 @@ SEMClassifier<TInputImage, TOutputImage> typename TInputImage::SizeType size = imgLabels->GetBufferedRegion().GetSize(); int theSize = (int) size[0] * size[1]; - if (m_Sample == NULL) + if (m_Sample == ITK_NULLPTR) { m_ClassLabels.resize(theSize); diff --git a/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h b/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h index 0b28f16634..1b8a953a65 100644 --- a/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h +++ b/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h @@ -74,8 +74,8 @@ public: if ((nClasses != this->m_NumberOfClasses) || (m_EnergiesInvalid == true)) { this->m_NumberOfClasses = nClasses; - if (m_Energy != NULL) free(m_Energy); - if (m_RepartitionFunction != NULL) free(m_RepartitionFunction); + if (m_Energy != ITK_NULLPTR) free(m_Energy); + if (m_RepartitionFunction != ITK_NULLPTR) free(m_RepartitionFunction); m_Energy = (double *) calloc(this->m_NumberOfClasses, sizeof(double)); m_RepartitionFunction = (double *) calloc(this->m_NumberOfClasses, sizeof(double)); this->Modified(); @@ -156,8 +156,8 @@ public: protected: // The constructor and destructor. MRFSamplerRandomMAP() : - m_RepartitionFunction(NULL), - m_Energy(NULL), + m_RepartitionFunction(ITK_NULLPTR), + m_Energy(ITK_NULLPTR), m_EnergiesInvalid(true) { m_Generator = RandomGeneratorType::GetInstance(); @@ -165,8 +165,8 @@ protected: } ~MRFSamplerRandomMAP() ITK_OVERRIDE { - if (m_Energy != NULL) free(m_Energy); - if (m_RepartitionFunction != NULL) free(m_RepartitionFunction); + if (m_Energy != ITK_NULLPTR) free(m_Energy); + if (m_RepartitionFunction != ITK_NULLPTR) free(m_RepartitionFunction); } private: diff --git a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.txx b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.txx index 91d9354f0c..804a4df1aa 100644 --- a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.txx +++ b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.txx @@ -79,7 +79,7 @@ MarkovRandomFieldFilter<TInputImage, TClassifiedImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TrainingImageType *> (this->itk::ProcessObject::GetInput(1)); @@ -318,7 +318,7 @@ MarkovRandomFieldFilter<TInputImage, TClassifiedImage> - 2 * m_InputImageNeighborhoodRadius[i]); } - srand((unsigned) time(0)); + srand((unsigned) time(ITK_NULLPTR)); if (!m_EnergyRegularization) { diff --git a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.txx b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.txx index d2f1a05fb7..36dfa8b430 100644 --- a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.txx +++ b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.txx @@ -52,7 +52,7 @@ SOMImageClassificationFilter<TInputImage, TOutputImage, TSOMMap, TMaskImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMImageClassificationFilter.txx b/Modules/Learning/SVMLearning/include/otbSVMImageClassificationFilter.txx index e81146ad62..7c1d5e2717 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMImageClassificationFilter.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMImageClassificationFilter.txx @@ -52,7 +52,7 @@ SVMImageClassificationFilter<TInputImage, TOutputImage, TMaskImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMImageClassificationWithRuleFilter.txx b/Modules/Learning/SVMLearning/include/otbSVMImageClassificationWithRuleFilter.txx index 72cc653cb5..a682561743 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMImageClassificationWithRuleFilter.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMImageClassificationWithRuleFilter.txx @@ -40,7 +40,7 @@ SVMImageClassificationWithRuleFilter<TInputImage, TOutputImage, TMaskImage> { Superclass::GenerateOutputInformation(); - if (this->GetModel() == NULL) + if (this->GetModel() == ITK_NULLPTR) { itkGenericExceptionMacro(<< "No model for classification"); } @@ -60,7 +60,7 @@ SVMImageClassificationWithRuleFilter<TInputImage, TOutputImage, TMaskImage> { Superclass::AllocateOutputs(); - if (this->GetModel() == NULL) + if (this->GetModel() == ITK_NULLPTR) { itkGenericExceptionMacro(<< "No model for classification"); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMImageModelEstimator.txx b/Modules/Learning/SVMLearning/include/otbSVMImageModelEstimator.txx index c92d5034ae..082138ca37 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMImageModelEstimator.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMImageModelEstimator.txx @@ -75,7 +75,7 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -87,7 +87,7 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<TTrainingImage *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMModel.h b/Modules/Learning/SVMLearning/include/otbSVMModel.h index 482f306659..030abc9df4 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMModel.h +++ b/Modules/Learning/SVMLearning/include/otbSVMModel.h @@ -324,13 +324,13 @@ public: double * GetRho(void) const { if (m_Model) return m_Model->rho; - return NULL; + return ITK_NULLPTR; } /** Return the support vectors */ svm_node ** GetSupportVectors(void) { if (m_Model) return m_Model->SV; - return NULL; + return ITK_NULLPTR; } /** Set the support vectors and changes the l number of support vectors accordind to sv.*/ void SetSupportVectors(svm_node ** sv, int nbOfSupportVector); @@ -339,7 +339,7 @@ public: double ** GetAlpha(void) { if (m_Model) return m_Model->sv_coef; - return NULL; + return ITK_NULLPTR; } /** Set the alphas values (SV Coef) */ void SetAlpha(double ** alpha, int nbOfSupportVector); @@ -348,14 +348,14 @@ public: int * GetLabels() { if (m_Model) return m_Model->label; - return NULL; + return ITK_NULLPTR; } /** Get the number of SV per classes */ int * GetNumberOfSVPerClasse() { if (m_Model) return m_Model->nSV; - return NULL; + return ITK_NULLPTR; } struct svm_problem& GetProblem() diff --git a/Modules/Learning/SVMLearning/include/otbSVMModel.txx b/Modules/Learning/SVMLearning/include/otbSVMModel.txx index 324d67f94a..a0b5abb580 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMModel.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMModel.txx @@ -43,10 +43,10 @@ SVMModel<TValue, TLabel>::SVMModel() this->DoProbabilityEstimates(false); m_Parameters.nr_weight = 0; - m_Parameters.weight_label = NULL; - m_Parameters.weight = NULL; + m_Parameters.weight_label = ITK_NULLPTR; + m_Parameters.weight = ITK_NULLPTR; - m_Model = NULL; + m_Model = ITK_NULLPTR; this->Initialize(); } @@ -83,8 +83,8 @@ SVMModel<TValue, TLabel>::Initialize() // Intialize problem m_Problem.l = 0; - m_Problem.y = NULL; - m_Problem.x = NULL; + m_Problem.y = ITK_NULLPTR; + m_Problem.x = ITK_NULLPTR; m_ProblemUpToDate = false; } @@ -111,7 +111,7 @@ SVMModel<TValue, TLabel>::DeleteModel() { svm_free_and_destroy_model(&m_Model); } - m_Model = NULL; + m_Model = ITK_NULLPTR; } template <class TValue, class TLabel> @@ -122,7 +122,7 @@ SVMModel<TValue, TLabel>::DeleteProblem() if (m_Problem.y) { delete[] m_Problem.y; - m_Problem.y = NULL; + m_Problem.y = ITK_NULLPTR; } if (m_Problem.x) @@ -135,7 +135,7 @@ SVMModel<TValue, TLabel>::DeleteProblem() } } delete[] m_Problem.x; - m_Problem.x = NULL; + m_Problem.x = ITK_NULLPTR; } m_Problem.l = 0; m_ProblemUpToDate = false; @@ -358,7 +358,7 @@ SVMModel<TValue, TLabel>::EvaluateLabel(const MeasurementType& measure) const int nr_class = svm_get_nr_class(m_Model); // Allocate space for labels - double *prob_estimates = NULL; + double *prob_estimates = ITK_NULLPTR; // Eventually allocate space for probabilities if (predict_probability) @@ -532,7 +532,7 @@ SVMModel<TValue, TLabel>::LoadModel(const char* model_file_name) { this->DeleteModel(); m_Model = svm_load_model(model_file_name); - if (m_Model == 0) + if (m_Model == ITK_NULLPTR) { itkExceptionMacro(<< "Problem while loading SVM model " << std::string(model_file_name)); @@ -563,10 +563,10 @@ SVMModel<TValue, TLabel>::SetSupportVectors(svm_node ** sv, int nbOfSupportVecto for (int n = 0; n < m_Model->l; ++n) { - m_Model->SV[n] = NULL; + m_Model->SV[n] = ITK_NULLPTR; } delete[] (m_Model->SV); - m_Model->SV = NULL; + m_Model->SV = ITK_NULLPTR; m_Model->SV = new struct svm_node*[m_Model->l]; diff --git a/Modules/Learning/SVMLearning/include/otbSVMModelEstimator.txx b/Modules/Learning/SVMLearning/include/otbSVMModelEstimator.txx index df7ec69f58..6e1ffe113b 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMModelEstimator.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMModelEstimator.txx @@ -52,7 +52,7 @@ SVMModelEstimator<InputPixelType, LabelPixelType> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<ModelType *>(this->itk::ProcessObject::GetOutput(0)); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMPointSetModelEstimator.txx b/Modules/Learning/SVMLearning/include/otbSVMPointSetModelEstimator.txx index 4734e9ed85..e4e3e6b0c0 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMPointSetModelEstimator.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMPointSetModelEstimator.txx @@ -74,7 +74,7 @@ SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TInputPointSet *>(this->itk::ProcessObject::GetInput(0)); } @@ -86,7 +86,7 @@ SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<TTrainingPointSet *>(this->itk::ProcessObject::GetInput(1)); } diff --git a/Modules/Learning/SVMLearning/include/otbSVMSampleListModelEstimator.txx b/Modules/Learning/SVMLearning/include/otbSVMSampleListModelEstimator.txx index d85122ec1c..a379ab5ddd 100644 --- a/Modules/Learning/SVMLearning/include/otbSVMSampleListModelEstimator.txx +++ b/Modules/Learning/SVMLearning/include/otbSVMSampleListModelEstimator.txx @@ -79,7 +79,7 @@ SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementF { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputSampleListType* > @@ -98,7 +98,7 @@ SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementF { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TrainingSampleListType* > diff --git a/Modules/Learning/SVMLearning/test/otbSVMImageModelEstimatorModelAccessor.cxx b/Modules/Learning/SVMLearning/test/otbSVMImageModelEstimatorModelAccessor.cxx index 7bfa58be34..b8804b12b3 100644 --- a/Modules/Learning/SVMLearning/test/otbSVMImageModelEstimatorModelAccessor.cxx +++ b/Modules/Learning/SVMLearning/test/otbSVMImageModelEstimatorModelAccessor.cxx @@ -82,13 +82,13 @@ int otbSVMImageModelEstimatorModelAccessor(int itkNotUsed(argc), char* argv[]) f << " - GetSupportVectors() [nb support vector][]" << std::endl; svm_node ** SVs = ptrModel->GetSupportVectors(); - if (SVs == NULL) + if (SVs == ITK_NULLPTR) { itkGenericExceptionMacro(<< "SVs NULL"); } for (unsigned int i = 0; i < nbSupportVector; ++i) { - if (SVs[i] == NULL) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); + if (SVs[i] == ITK_NULLPTR) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); f << std::endl; f << " SV[" << i << "]:"; const svm_node *p = SVs[i]; @@ -115,7 +115,7 @@ int otbSVMImageModelEstimatorModelAccessor(int itkNotUsed(argc), char* argv[]) f << " - GetRho() [nr_class*(nr_class-1)/2]" << std::endl; unsigned int taille = nbClass * (nbClass - 1) / 2; double * rhos = ptrModel->GetRho(); - if (rhos == NULL) + if (rhos == ITK_NULLPTR) { itkGenericExceptionMacro(<< "rhos NULL"); } @@ -128,13 +128,13 @@ int otbSVMImageModelEstimatorModelAccessor(int itkNotUsed(argc), char* argv[]) f << std::endl; f << " - GetAlpha() [nb class-1][nb support vector]" << std::endl; double ** alphas = ptrModel->GetAlpha(); - if (alphas == NULL) + if (alphas == ITK_NULLPTR) { itkGenericExceptionMacro(<< "alphas NULL"); } for (unsigned int i = 0; i < nbClass - 1; ++i) { - if (alphas[i] == NULL) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); + if (alphas[i] == ITK_NULLPTR) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); f << " "; for (unsigned int j = 0; j < nbSupportVector; ++j) { diff --git a/Modules/Learning/SVMLearning/test/otbSVMModelAccessor.cxx b/Modules/Learning/SVMLearning/test/otbSVMModelAccessor.cxx index 4549a9c732..5523f78969 100644 --- a/Modules/Learning/SVMLearning/test/otbSVMModelAccessor.cxx +++ b/Modules/Learning/SVMLearning/test/otbSVMModelAccessor.cxx @@ -48,13 +48,13 @@ int otbSVMModelAccessor(int itkNotUsed(argc), char* argv[]) f << " - GetSupportVectors() [nb support vector][]" << std::endl; svm_node ** SVs = ptrModel->GetSupportVectors(); - if (SVs == NULL) + if (SVs == ITK_NULLPTR) { itkGenericExceptionMacro(<< "SVs NULL"); } for (unsigned int i = 0; i < nbSupportVector; ++i) { - if (SVs[i] == NULL) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); + if (SVs[i] == ITK_NULLPTR) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); f << std::endl; f << " SV[" << i << "]:"; const svm_node *p = SVs[i]; @@ -69,7 +69,7 @@ int otbSVMModelAccessor(int itkNotUsed(argc), char* argv[]) f << " - GetRho() [nr_class*(nr_class-1)/2]" << std::endl; unsigned int taille = nbClass * (nbClass - 1) / 2; double * rhos = ptrModel->GetRho(); - if (rhos == NULL) + if (rhos == ITK_NULLPTR) { itkGenericExceptionMacro(<< "rhos NULL"); } @@ -82,13 +82,13 @@ int otbSVMModelAccessor(int itkNotUsed(argc), char* argv[]) f << std::endl; f << " - GetAlpha() [nb class-1][nb support vector]" << std::endl; double ** alphas = ptrModel->GetAlpha(); - if (alphas == NULL) + if (alphas == ITK_NULLPTR) { itkGenericExceptionMacro(<< "alphas NULL"); } for (unsigned int i = 0; i < nbClass - 1; ++i) { - if (alphas[i] == NULL) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); + if (alphas[i] == ITK_NULLPTR) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); f << " "; for (unsigned int j = 0; j < nbSupportVector; ++j) { diff --git a/Modules/Learning/Sampling/include/otbOGRDataToClassStatisticsFilter.txx b/Modules/Learning/Sampling/include/otbOGRDataToClassStatisticsFilter.txx index 0fee32a39d..2ebd0fdd50 100644 --- a/Modules/Learning/Sampling/include/otbOGRDataToClassStatisticsFilter.txx +++ b/Modules/Learning/Sampling/include/otbOGRDataToClassStatisticsFilter.txx @@ -52,7 +52,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const otb::ogr::DataSource *>(this->itk::ProcessObject::GetInput(1)); } @@ -72,7 +72,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -83,7 +83,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> ::Synthetize(void) { otb::ogr::DataSource* vectors = const_cast<otb::ogr::DataSource*>(this->GetOGRData()); - vectors->GetLayer(m_LayerIndex).SetSpatialFilter(NULL); + vectors->GetLayer(m_LayerIndex).SetSpatialFilter(ITK_NULLPTR); ClassCountMapType &classCount = this->GetClassCountOutput()->Get(); PolygonSizeMapType &polygonSize = this->GetPolygonSizeOutput()->Get(); @@ -129,7 +129,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const ClassCountObjectType *>(this->itk::ProcessObject::GetOutput(1)); } @@ -141,7 +141,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<ClassCountObjectType *>(this->itk::ProcessObject::GetOutput(1)); } @@ -153,7 +153,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const PolygonSizeObjectType *>(this->itk::ProcessObject::GetOutput(2)); } @@ -165,7 +165,7 @@ PersistentOGRDataToClassStatisticsFilter<TInputImage,TMaskImage> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<PolygonSizeObjectType *>(this->itk::ProcessObject::GetOutput(2)); } diff --git a/Modules/Learning/Sampling/include/otbPolygonClassStatisticsAccumulator.txx b/Modules/Learning/Sampling/include/otbPolygonClassStatisticsAccumulator.txx index def2370b43..dd5ce69797 100644 --- a/Modules/Learning/Sampling/include/otbPolygonClassStatisticsAccumulator.txx +++ b/Modules/Learning/Sampling/include/otbPolygonClassStatisticsAccumulator.txx @@ -71,7 +71,7 @@ PolygonClassStatisticsAccumulator case wkbPoint25D: { OGRPoint* castPoint = dynamic_cast<OGRPoint*>(geom); - if (castPoint == NULL) + if (castPoint == ITK_NULLPTR) { // Wrong Type ! break; diff --git a/Modules/Learning/Supervised/include/otbBoostMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbBoostMachineLearningModel.txx index dfd656a223..8d20ca5f7f 100644 --- a/Modules/Learning/Supervised/include/otbBoostMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbBoostMachineLearningModel.txx @@ -61,7 +61,7 @@ BoostMachineLearningModel<TInputValue,TOutputValue> cv::Mat labels; otb::ListSampleToMat<TargetListSampleType>(this->GetTargetListSample(),labels); - CvBoostParams params = CvBoostParams(m_BoostType, m_WeakCount, m_WeightTrimRate, m_MaxDepth, false, 0); + CvBoostParams params = CvBoostParams(m_BoostType, m_WeakCount, m_WeightTrimRate, m_MaxDepth, false, ITK_NULLPTR); params.split_criteria = m_SplitCrit; //train the Boost model @@ -92,7 +92,7 @@ BoostMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { (*quality) = static_cast<ConfidenceValueType>( m_BoostModel->predict(sample,missing,cv::Range::all(),false,true)); @@ -107,7 +107,7 @@ BoostMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_BoostModel->save(filename.c_str(), 0); + m_BoostModel->save(filename.c_str(), ITK_NULLPTR); else m_BoostModel->save(filename.c_str(), name.c_str()); } @@ -118,7 +118,7 @@ BoostMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_BoostModel->load(filename.c_str(), 0); + m_BoostModel->load(filename.c_str(), ITK_NULLPTR); else m_BoostModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/Learning/Supervised/include/otbDecisionTreeMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbDecisionTreeMachineLearningModel.txx index ddaf2e871f..07ce3a1129 100644 --- a/Modules/Learning/Supervised/include/otbDecisionTreeMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbDecisionTreeMachineLearningModel.txx @@ -64,7 +64,7 @@ DecisionTreeMachineLearningModel<TInputValue,TOutputValue> cv::Mat labels; otb::ListSampleToMat<TargetListSampleType>(this->GetTargetListSample(),labels); - float * priors = m_Priors.empty() ? 0 : &m_Priors.front(); + float * priors = m_Priors.empty() ? ITK_NULLPTR : &m_Priors.front(); CvDTreeParams params = CvDTreeParams(m_MaxDepth, m_MinSampleCount, m_RegressionAccuracy, m_UseSurrogates, m_MaxCategories, m_CVFolds, m_Use1seRule, m_TruncatePrunedTree, priors); @@ -96,7 +96,7 @@ DecisionTreeMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { if (!this->m_ConfidenceIndex) { @@ -113,7 +113,7 @@ DecisionTreeMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_DTreeModel->save(filename.c_str(), 0); + m_DTreeModel->save(filename.c_str(), ITK_NULLPTR); else m_DTreeModel->save(filename.c_str(), name.c_str()); } @@ -124,7 +124,7 @@ DecisionTreeMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_DTreeModel->load(filename.c_str(), 0); + m_DTreeModel->load(filename.c_str(), ITK_NULLPTR); else m_DTreeModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/Learning/Supervised/include/otbGradientBoostedTreeMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbGradientBoostedTreeMachineLearningModel.txx index 49451c7be6..53e6931575 100644 --- a/Modules/Learning/Supervised/include/otbGradientBoostedTreeMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbGradientBoostedTreeMachineLearningModel.txx @@ -92,7 +92,7 @@ GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { if (!this->m_ConfidenceIndex) { @@ -109,7 +109,7 @@ GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_GBTreeModel->save(filename.c_str(), 0); + m_GBTreeModel->save(filename.c_str(), ITK_NULLPTR); else m_GBTreeModel->save(filename.c_str(), name.c_str()); } @@ -120,7 +120,7 @@ GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_GBTreeModel->load(filename.c_str(), 0); + m_GBTreeModel->load(filename.c_str(), ITK_NULLPTR); else m_GBTreeModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/Learning/Supervised/include/otbImageClassificationFilter.txx b/Modules/Learning/Supervised/include/otbImageClassificationFilter.txx index 95c00b5a1b..72614862a9 100644 --- a/Modules/Learning/Supervised/include/otbImageClassificationFilter.txx +++ b/Modules/Learning/Supervised/include/otbImageClassificationFilter.txx @@ -57,7 +57,7 @@ ImageClassificationFilter<TInputImage, TOutputImage, TMaskImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const MaskImageType *>(this->itk::ProcessObject::GetInput(1)); } @@ -70,7 +70,7 @@ ImageClassificationFilter<TInputImage, TOutputImage, TMaskImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<ConfidenceImageType *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Learning/Supervised/include/otbKNearestNeighborsMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbKNearestNeighborsMachineLearningModel.txx index 83b55bb7a2..2a6705d1aa 100644 --- a/Modules/Learning/Supervised/include/otbKNearestNeighborsMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbKNearestNeighborsMachineLearningModel.txx @@ -93,10 +93,10 @@ KNearestNeighborsMachineLearningModel<TInputValue,TTargetValue> float result; cv::Mat nearest(1,m_K,CV_32FC1); - result = m_KNearestModel->find_nearest(sample, m_K,0,0,&nearest,0); + result = m_KNearestModel->find_nearest(sample, m_K,ITK_NULLPTR,ITK_NULLPTR,&nearest,ITK_NULLPTR); // compute quality if asked (only happens in classification mode) - if (quality != NULL) + if (quality != ITK_NULLPTR) { assert(!this->m_RegressionMode); unsigned int accuracy = 0; diff --git a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx index 443f355717..70da67ed4e 100644 --- a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx @@ -79,7 +79,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue> target = m_SVMestimator->GetModel()->EvaluateLabel(mfunctor(input)); - if (quality != NULL) + if (quality != ITK_NULLPTR) { if (!this->m_ConfidenceIndex) { diff --git a/Modules/Learning/Supervised/include/otbMachineLearningModel.h b/Modules/Learning/Supervised/include/otbMachineLearningModel.h index dea22a6177..3bc693cbc4 100644 --- a/Modules/Learning/Supervised/include/otbMachineLearningModel.h +++ b/Modules/Learning/Supervised/include/otbMachineLearningModel.h @@ -100,7 +100,7 @@ public: virtual void Train() =0; /** Predict values using the model */ - virtual TargetSampleType Predict(const InputSampleType& input, ConfidenceValueType *quality = NULL) const = 0; + virtual TargetSampleType Predict(const InputSampleType& input, ConfidenceValueType *quality = ITK_NULLPTR) const = 0; /** Classify all samples in InputListSample and fill TargetListSample with the associated label */ void PredictAll(); diff --git a/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.txx b/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.txx index 7fe0d4301e..627c30b58e 100644 --- a/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.txx +++ b/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.txx @@ -81,7 +81,7 @@ for(typename std::list<MachineLearningModelTypePointer>::iterator k = possibleMa } } - return 0; + return ITK_NULLPTR; } template <class TInputValue, class TOutputValue> diff --git a/Modules/Learning/Supervised/include/otbNeuralNetworkMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbNeuralNetworkMachineLearningModel.txx index 7be83ac990..508118a7b9 100644 --- a/Modules/Learning/Supervised/include/otbNeuralNetworkMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbNeuralNetworkMachineLearningModel.txx @@ -40,7 +40,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::NeuralNetworkMachi m_TermCriteriaType(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS), m_MaxIter(1000), m_Epsilon(0.01), - m_CvMatOfLabels(0) + m_CvMatOfLabels(ITK_NULLPTR) { this->m_ConfidenceIndex = true; this->m_IsRegressionSupported = true; @@ -74,7 +74,7 @@ void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::LabelsToMat(c cv::Mat & output) { unsigned int nbSamples = 0; - if (labels != NULL) + if (labels != ITK_NULLPTR) { nbSamples = labels->Size(); } @@ -244,7 +244,7 @@ typename NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::TargetSam } } - if (quality != NULL) + if (quality != ITK_NULLPTR) { (*quality) = static_cast<ConfidenceValueType>(maxResponse) - static_cast<ConfidenceValueType>(secondResponse); } @@ -260,8 +260,8 @@ void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::Save(const st if ( !name.empty() ) lname = name.c_str(); - CvFileStorage* fs = 0; - fs = cvOpenFileStorage(filename.c_str(), 0, CV_STORAGE_WRITE); + CvFileStorage* fs = ITK_NULLPTR; + fs = cvOpenFileStorage(filename.c_str(), ITK_NULLPTR, CV_STORAGE_WRITE); if ( !fs ) { itkExceptionMacro("Could not open the file " << filename << " for writing"); @@ -277,7 +277,7 @@ template<class TInputValue, class TOutputValue> void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::Load(const std::string & filename, const std::string & name) { - const char* lname = 0; + const char* lname = ITK_NULLPTR; if ( !name.empty() ) lname = name.c_str(); diff --git a/Modules/Learning/Supervised/include/otbNormalBayesMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbNormalBayesMachineLearningModel.txx index cb10272f71..b4ef2c2955 100644 --- a/Modules/Learning/Supervised/include/otbNormalBayesMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbNormalBayesMachineLearningModel.txx @@ -76,7 +76,7 @@ NormalBayesMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { if (!this->HasConfidenceIndex()) { @@ -93,7 +93,7 @@ NormalBayesMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_NormalBayesModel->save(filename.c_str(), 0); + m_NormalBayesModel->save(filename.c_str(), ITK_NULLPTR); else m_NormalBayesModel->save(filename.c_str(), name.c_str()); } @@ -104,7 +104,7 @@ NormalBayesMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_NormalBayesModel->load(filename.c_str(), 0); + m_NormalBayesModel->load(filename.c_str(), ITK_NULLPTR); else m_NormalBayesModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/Learning/Supervised/include/otbOpenCVUtils.h b/Modules/Learning/Supervised/include/otbOpenCVUtils.h index 2a7720a42b..01ee23f57c 100644 --- a/Modules/Learning/Supervised/include/otbOpenCVUtils.h +++ b/Modules/Learning/Supervised/include/otbOpenCVUtils.h @@ -66,7 +66,7 @@ namespace otb unsigned int sampleIdx = 0; // Check for valid listSample - if(listSample != NULL && listSample->Size() > 0) + if(listSample != ITK_NULLPTR && listSample->Size() > 0) { // Retrieve samples count unsigned int sampleCount = listSample->Size(); diff --git a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.txx index be24152a23..cb95be8e75 100644 --- a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.txx @@ -79,7 +79,7 @@ RandomForestsMachineLearningModel<TInputValue,TOutputValue> //Define random forests paramneters //FIXME do this in the constructor? - float * priors = m_Priors.empty() ? 0 : &m_Priors.front(); + float * priors = m_Priors.empty() ? ITK_NULLPTR : &m_Priors.front(); CvRTParams params = CvRTParams(m_MaxDepth, // max depth m_MinSampleCount, // min sample count @@ -124,7 +124,7 @@ RandomForestsMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { if(m_ComputeMargin) (*quality) = m_RFModel->predict_margin(sample); @@ -141,7 +141,7 @@ RandomForestsMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_RFModel->save(filename.c_str(), 0); + m_RFModel->save(filename.c_str(), ITK_NULLPTR); else m_RFModel->save(filename.c_str(), name.c_str()); } @@ -152,7 +152,7 @@ RandomForestsMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_RFModel->load(filename.c_str(), 0); + m_RFModel->load(filename.c_str(), ITK_NULLPTR); else m_RFModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/Learning/Supervised/include/otbSVMMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbSVMMachineLearningModel.txx index df4aace3d2..57006ce0d7 100644 --- a/Modules/Learning/Supervised/include/otbSVMMachineLearningModel.txx +++ b/Modules/Learning/Supervised/include/otbSVMMachineLearningModel.txx @@ -84,7 +84,7 @@ SVMMachineLearningModel<TInputValue,TOutputValue> // Set up SVM's parameters CvTermCriteria term_crit = cvTermCriteria(m_TermCriteriaType, m_MaxIter, m_Epsilon); - CvSVMParams params( m_SVMType, m_KernelType, m_Degree, m_Gamma, m_Coef0, m_C, m_Nu, m_P, NULL , term_crit ); + CvSVMParams params( m_SVMType, m_KernelType, m_Degree, m_Gamma, m_Coef0, m_C, m_Nu, m_P, ITK_NULLPTR , term_crit ); // Train the SVM if (!m_ParameterOptimization) @@ -131,7 +131,7 @@ SVMMachineLearningModel<TInputValue,TOutputValue> target[0] = static_cast<TOutputValue>(result); - if (quality != NULL) + if (quality != ITK_NULLPTR) { (*quality) = m_SVMModel->predict(sample,true); } @@ -145,7 +145,7 @@ SVMMachineLearningModel<TInputValue,TOutputValue> ::Save(const std::string & filename, const std::string & name) { if (name == "") - m_SVMModel->save(filename.c_str(), 0); + m_SVMModel->save(filename.c_str(), ITK_NULLPTR); else m_SVMModel->save(filename.c_str(), name.c_str()); } @@ -156,7 +156,7 @@ SVMMachineLearningModel<TInputValue,TOutputValue> ::Load(const std::string & filename, const std::string & name) { if (name == "") - m_SVMModel->load(filename.c_str(), 0); + m_SVMModel->load(filename.c_str(), ITK_NULLPTR); else m_SVMModel->load(filename.c_str(), name.c_str()); } diff --git a/Modules/OBIA/RCC8/include/otbImageListToRCC8GraphFilter.txx b/Modules/OBIA/RCC8/include/otbImageListToRCC8GraphFilter.txx index 2a93c2adb6..823c6f8ce4 100644 --- a/Modules/OBIA/RCC8/include/otbImageListToRCC8GraphFilter.txx +++ b/Modules/OBIA/RCC8/include/otbImageListToRCC8GraphFilter.txx @@ -56,7 +56,7 @@ ImageListToRCC8GraphFilter<TInputImage, TOutputGraph> if (this->GetNumberOfInputs() < 1) { // exit - return 0; + return ITK_NULLPTR; } // else return the first input return static_cast<InputImageListType *> diff --git a/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.txx b/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.txx index a2819f97b8..0a23937ce7 100644 --- a/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.txx +++ b/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.txx @@ -59,7 +59,7 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TPolygonList *> diff --git a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.txx b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.txx index af908a965b..abbf30b885 100644 --- a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.txx +++ b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.txx @@ -92,7 +92,7 @@ RCC8GraphFileWriter<TInputGraph> itkDebugMacro(<< "Writing a RCC8Graph file"); // Make sure input is available - if (input == 0) + if (input == ITK_NULLPTR) { itkExceptionMacro(<< "No input to writer!"); } diff --git a/Modules/OBIA/RCC8/include/otbRCC8GraphSource.txx b/Modules/OBIA/RCC8/include/otbRCC8GraphSource.txx index a3ea3d0519..4768504d6f 100644 --- a/Modules/OBIA/RCC8/include/otbRCC8GraphSource.txx +++ b/Modules/OBIA/RCC8/include/otbRCC8GraphSource.txx @@ -43,7 +43,7 @@ RCC8GraphSource<TOutputGraph> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputGraphType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.txx b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.txx index f17f85d3f7..5ca4677363 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.txx +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.txx @@ -84,7 +84,7 @@ void ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage> ::UpdateAtmosphericRadiativeTerms() { - if (this->GetInput() == NULL) + if (this->GetInput() == ITK_NULLPTR) { itkExceptionMacro(<< "Input must be set before updating the atmospheric radiative terms"); } @@ -161,7 +161,7 @@ ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage> ::UpdateFunctors() { - if (this->GetInput() == NULL) + if (this->GetInput() == ITK_NULLPTR) { itkExceptionMacro(<< "Input must be set before updating the functors"); } diff --git a/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.txx b/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.txx index fc1be89537..b91d7f59e6 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.txx +++ b/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.txx @@ -79,7 +79,7 @@ void SurfaceAdjacencyEffectCorrectionSchemeFilter<TInputImage, TOutputImage> ::UpdateAtmosphericRadiativeTerms() { - if (this->GetInput() == NULL) + if (this->GetInput() == ITK_NULLPTR) { itkExceptionMacro(<< "Input must be set before updating the atmospheric radiative terms"); } diff --git a/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx b/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx index e212a8989b..4d77bab074 100644 --- a/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx +++ b/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx @@ -101,7 +101,7 @@ AeronetFileReader { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<AeronetData *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx b/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx index 78f6a2f070..44cbd60b4f 100644 --- a/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx +++ b/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx @@ -98,7 +98,7 @@ SIXSTraits::ComputeAtmosphericParameters( otb_6s_integer iinf = static_cast<otb_6s_integer>((wlinf - (float) .25) / SIXSStepOfWavelengthSpectralBandValues + (float) 1.5); otb_6s_integer cpt = iinf - 1; - otb_6s_doublereal * s(NULL); + otb_6s_doublereal * s(ITK_NULLPTR); s = new otb_6s_doublereal[S_6S_SIZE]; memset(s, 0, S_6S_SIZE * sizeof(otb_6s_doublereal)); const ValuesVectorType& FilterFunctionValues6S = WavelengthSpectralBand->GetFilterFunctionValues6S(); @@ -128,7 +128,7 @@ SIXSTraits::ComputeAtmosphericParameters( &tdif_up_aer); otbMsgDevMacro(<< "Done call 6S main function!"); delete[] s; - s = NULL; + s = ITK_NULLPTR; } catch (std::bad_alloc& err) { diff --git a/Modules/Radiometry/OpticalCalibration/src/otbSpectralSensitivityReader.cxx b/Modules/Radiometry/OpticalCalibration/src/otbSpectralSensitivityReader.cxx index 403bbe6587..a61a70717c 100644 --- a/Modules/Radiometry/OpticalCalibration/src/otbSpectralSensitivityReader.cxx +++ b/Modules/Radiometry/OpticalCalibration/src/otbSpectralSensitivityReader.cxx @@ -50,7 +50,7 @@ SpectralSensitivityReader { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<WavelengthSpectralBandVectorType *> (this->ProcessObject::GetOutput(0)); } @@ -61,7 +61,7 @@ SpectralSensitivityReader { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const WavelengthSpectralBandVectorType *> (this->ProcessObject::GetOutput(0)); } diff --git a/Modules/Radiometry/OpticalCalibration/test/otbSIXSTraitsTest.cxx b/Modules/Radiometry/OpticalCalibration/test/otbSIXSTraitsTest.cxx index 1e45bbf7f0..84db26dec3 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbSIXSTraitsTest.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbSIXSTraitsTest.cxx @@ -20,7 +20,7 @@ int otbSIXSTraitsTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - otb::SIXSTraits *var(NULL); + otb::SIXSTraits *var(ITK_NULLPTR); var = new otb::SIXSTraits(); delete var; return EXIT_SUCCESS; diff --git a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx index 7484c17a81..3105b757c3 100644 --- a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx +++ b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx @@ -81,7 +81,7 @@ ReduceSpectralResponse<TSpectralResponse , TRSR> if(m_ReflectanceMode) { - if (solarIrradiance == 0) + if (solarIrradiance == ITK_NULLPTR) { itkExceptionMacro(<<"Error occurs getting solar irradiance. Solar irradiance is mandatory using the reflectance mode."); } diff --git a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.txx b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.txx index 8ead55df91..0f0aa8160a 100644 --- a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.txx +++ b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.txx @@ -46,7 +46,7 @@ void SurfaceReflectanceToReflectanceFilter<TInputImage, TOutputImage> ::UpdateAtmosphericRadiativeTerms() { - if (this->GetInput() == NULL) + if (this->GetInput() == ITK_NULLPTR) { itkExceptionMacro(<< "Input must be set before updating the atmospheric radiative terms"); } diff --git a/Modules/Radiometry/Simulation/src/otbProspectModel.cxx b/Modules/Radiometry/Simulation/src/otbProspectModel.cxx index 71edbf4d3a..ea1525bf74 100644 --- a/Modules/Radiometry/Simulation/src/otbProspectModel.cxx +++ b/Modules/Radiometry/Simulation/src/otbProspectModel.cxx @@ -64,7 +64,7 @@ ProspectModel if(this->GetNumberOfInputs() != 1) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<LeafParametersType *>(this->itk::ProcessObject::GetInput(0)); } @@ -85,7 +85,7 @@ ProspectModel if(this->GetNumberOfOutputs() < 2) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(0)); } @@ -98,7 +98,7 @@ ProspectModel if(this->GetNumberOfOutputs() < 2) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Radiometry/Simulation/src/otbSailModel.cxx b/Modules/Radiometry/Simulation/src/otbSailModel.cxx index 2d6b66fae2..94fb477e82 100644 --- a/Modules/Radiometry/Simulation/src/otbSailModel.cxx +++ b/Modules/Radiometry/Simulation/src/otbSailModel.cxx @@ -69,7 +69,7 @@ SailModel if(this->GetNumberOfInputs() != 2) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetInput(0)); } @@ -89,7 +89,7 @@ SailModel if(this->GetNumberOfInputs() != 2) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetInput(1)); } @@ -110,7 +110,7 @@ SailModel if(this->GetNumberOfOutputs() < 4) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(0)); } @@ -123,7 +123,7 @@ SailModel if(this->GetNumberOfOutputs() < 4) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(1)); } @@ -136,7 +136,7 @@ SailModel if(this->GetNumberOfOutputs() < 4) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(2)); } @@ -149,7 +149,7 @@ SailModel if(this->GetNumberOfOutputs() < 4) { //exit - return 0; + return ITK_NULLPTR; } return static_cast<SpectralResponseType *>(this->itk::ProcessObject::GetOutput(3)); } diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapEstimationMethod.txx b/Modules/Registration/DisparityMap/include/otbDisparityMapEstimationMethod.txx index 91e84ea592..ffd6e10d24 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapEstimationMethod.txx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapEstimationMethod.txx @@ -39,10 +39,10 @@ DisparityMapEstimationMethod<TFixedImage, TMovingImage, TPointSet> //this->SetNumberOfRequiredOutputs(1); // this->SetReleaseDataFlag(false); this->SetReleaseDataBeforeUpdateFlag(false); - m_Transform = 0; // has to be provided by the user. - m_Interpolator = 0; // has to be provided by the user. - m_Metric = 0; // has to be provided by the user. - m_Optimizer = 0; // has to be provided by the user. + m_Transform = ITK_NULLPTR; // has to be provided by the user. + m_Interpolator = ITK_NULLPTR; // has to be provided by the user. + m_Metric = ITK_NULLPTR; // has to be provided by the user. + m_Optimizer = ITK_NULLPTR; // has to be provided by the user. m_WinSize.Fill(15); m_ExploSize.Fill(10); m_InitialTransformParameters = ParametersType(1); diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.txx b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.txx index e0de95814d..d924888bbc 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.txx @@ -61,7 +61,7 @@ DisparityMapMedianFilter<TInputImage, TOutputImage, TMask> { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMask *>(this->itk::ProcessObject::GetInput(1)); } @@ -73,7 +73,7 @@ DisparityMapMedianFilter<TInputImage, TOutputImage, TMask> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TMask *>(this->itk::ProcessObject::GetOutput(1)); } @@ -86,7 +86,7 @@ DisparityMapMedianFilter<TInputImage, TOutputImage, TMask> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputImage *>(this->itk::ProcessObject::GetOutput(2)); } @@ -98,7 +98,7 @@ DisparityMapMedianFilter<TInputImage, TOutputImage, TMask> { if (this->GetNumberOfOutputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<TMask *>(this->itk::ProcessObject::GetOutput(3)); } diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.txx b/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.txx index 80a2b6fdee..1278d5c34c 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.txx @@ -103,7 +103,7 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag { if(this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -116,7 +116,7 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag { if(this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -129,7 +129,7 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag { if(this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -142,7 +142,7 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag { if(this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -155,7 +155,7 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag { if(this->GetNumberOfInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(4)); } diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.txx b/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.txx index cb729c9ec5..900addc643 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.txx @@ -131,7 +131,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -144,7 +144,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -157,7 +157,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -170,7 +170,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -183,7 +183,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(4)); } @@ -196,7 +196,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<6) { - return 0; + return ITK_NULLPTR; } return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(5)); } @@ -209,7 +209,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfInputs()<7) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(6)); } @@ -235,7 +235,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri { if(this->GetNumberOfOutputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputDEMImage *>(this->itk::ProcessObject::GetOutput(0)); } @@ -688,7 +688,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri typename TEpipolarGridImage::RegionType gridRegion = leftGrid->GetLargestPossibleRegion(); - TOutputDEMImage * tmpDEM = NULL; + TOutputDEMImage * tmpDEM = ITK_NULLPTR; typename TOutputDEMImage::RegionType outputRequestedRegion = outputDEM->GetRequestedRegion(); typename TDisparityImage::RegionType disparityRegion; diff --git a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.txx b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.txx index 734f07ac43..caa46b902f 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.txx @@ -102,7 +102,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -114,7 +114,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -126,7 +126,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TGridImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -138,7 +138,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TGridImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -150,7 +150,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(4)); } @@ -162,7 +162,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfInputs()<6) { - return 0; + return ITK_NULLPTR; } return static_cast<const TSensorImage *>(this->itk::ProcessObject::GetInput(5)); } @@ -174,7 +174,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfOutputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<TDisparityImage *>(this->itk::ProcessObject::GetOutput(0)); } @@ -186,7 +186,7 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TDisparityImage *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Registration/DisparityMap/include/otbFineRegistrationImageFilter.txx b/Modules/Registration/DisparityMap/include/otbFineRegistrationImageFilter.txx index 48c457f24a..1eb1d442f6 100644 --- a/Modules/Registration/DisparityMap/include/otbFineRegistrationImageFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbFineRegistrationImageFilter.txx @@ -66,7 +66,7 @@ FineRegistrationImageFilter<TInputImage, T0utputCorrelation, TOutputDisplacement // Default offset m_InitialOffset.Fill(0); - m_Transform = NULL; + m_Transform = ITK_NULLPTR; } template <class TInputImage, class T0utputCorrelation, class TOutputDisplacementField> @@ -94,7 +94,7 @@ FineRegistrationImageFilter<TInputImage, T0utputCorrelation, TOutputDisplacement { if (this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -106,7 +106,7 @@ FineRegistrationImageFilter<TInputImage, T0utputCorrelation, TOutputDisplacement { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -118,7 +118,7 @@ FineRegistrationImageFilter<TInputImage, T0utputCorrelation, TOutputDisplacement { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputDisplacementField *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.txx b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.txx index ca14ed47d5..b41b60447c 100644 --- a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.txx @@ -119,7 +119,7 @@ MultiDisparityMapTo3DFilter<TDisparityImage,TOutputImage,TMaskImage,TResidueImag { if ((3 * (index + 1)) > this->GetNumberOfRequiredInputs()) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(3 * index)); } @@ -132,7 +132,7 @@ MultiDisparityMapTo3DFilter<TDisparityImage,TOutputImage,TMaskImage,TResidueImag { if ((3 * (index + 1)) > this->GetNumberOfRequiredInputs()) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(3 * index + 1)); } @@ -145,7 +145,7 @@ MultiDisparityMapTo3DFilter<TDisparityImage,TOutputImage,TMaskImage,TResidueImag { if ((3 * (index + 1)) > this->GetNumberOfRequiredInputs()) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(3 * index + 2)); } diff --git a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.txx b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.txx index 0563fc7fff..4648acbbad 100644 --- a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.txx +++ b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.txx @@ -50,8 +50,8 @@ NCCRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField> m_TimeStep = 1.0; m_DenominatorThreshold = 1e-9; m_IntensityDifferenceThreshold = 0.001; - this->SetMovingImage(NULL); - this->SetFixedImage(NULL); + this->SetMovingImage(ITK_NULLPTR); + this->SetFixedImage(ITK_NULLPTR); m_FixedImageSpacing.Fill(1.0); m_FixedImageOrigin.Fill(0.0); m_FixedImageGradientCalculator = GradientCalculatorType::New(); diff --git a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.txx b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.txx index cf0c92ad81..5199a2c546 100644 --- a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.txx @@ -129,7 +129,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -143,7 +143,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -157,7 +157,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -171,7 +171,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -185,7 +185,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TOutputMetricImage *>(this->itk::ProcessObject::GetOutput(0)); } @@ -199,7 +199,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputMetricImage *>(this->itk::ProcessObject::GetOutput(0)); } @@ -214,7 +214,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TOutputDisparityImage *>(this->itk::ProcessObject::GetOutput(1)); } @@ -228,7 +228,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputDisparityImage *>(this->itk::ProcessObject::GetOutput(1)); } @@ -242,7 +242,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TOutputDisparityImage *>(this->itk::ProcessObject::GetOutput(2)); } @@ -256,7 +256,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputDisparityImage *>(this->itk::ProcessObject::GetOutput(2)); } @@ -292,7 +292,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TOutputDisparityImage *>(this->itk::ProcessObject::GetInput(4)); } @@ -306,7 +306,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfInputs()<6) { - return 0; + return ITK_NULLPTR; } return static_cast<const TOutputDisparityImage *>(this->itk::ProcessObject::GetInput(5)); } diff --git a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.txx b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.txx index 617b9e7aae..2a787e1d5f 100644 --- a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.txx +++ b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.txx @@ -152,7 +152,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfIndexedInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -166,7 +166,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfIndexedInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -180,7 +180,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfIndexedInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -194,7 +194,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfIndexedInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -208,7 +208,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfIndexedInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(4)); } @@ -222,7 +222,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if(this->GetNumberOfIndexedInputs()<6) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(5)); } @@ -250,7 +250,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<TDisparityImage *>(this->itk::ProcessObject::GetOutput(0)); } @@ -278,7 +278,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TDisparityImage *>(this->itk::ProcessObject::GetOutput(1)); } @@ -306,7 +306,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputMetricImage *>(this->itk::ProcessObject::GetOutput(2)); } diff --git a/Modules/Registration/DisplacementField/include/otbPointSetWithTransformToDisplacementFieldGenerator.txx b/Modules/Registration/DisplacementField/include/otbPointSetWithTransformToDisplacementFieldGenerator.txx index 92deb82347..5fb36334df 100644 --- a/Modules/Registration/DisplacementField/include/otbPointSetWithTransformToDisplacementFieldGenerator.txx +++ b/Modules/Registration/DisplacementField/include/otbPointSetWithTransformToDisplacementFieldGenerator.txx @@ -31,7 +31,7 @@ template <class TPointSet, class TDisplacementField> PointSetWithTransformToDisplacementFieldGenerator<TPointSet, TDisplacementField> ::PointSetWithTransformToDisplacementFieldGenerator() { - m_Transform = 0; // has to be provided by the user + m_Transform = ITK_NULLPTR; // has to be provided by the user } /** * PrintSelf Method diff --git a/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.txx b/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.txx index 69a3db5c85..9a06a33519 100644 --- a/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.txx +++ b/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.txx @@ -97,7 +97,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -109,7 +109,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMask *>(this->itk::ProcessObject::GetInput(2)); } @@ -121,7 +121,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TImage *>(this->itk::ProcessObject::GetInput(3)); } @@ -133,7 +133,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfInputs()<5) { - return 0; + return ITK_NULLPTR; } return static_cast<const TMask *>(this->itk::ProcessObject::GetInput(4)); } @@ -145,7 +145,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TMask *>(this->itk::ProcessObject::GetOutput(1)); } @@ -157,7 +157,7 @@ AdhesionCorrectionFilter<TImage, TMask> { if (this->GetNumberOfOutputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<TImage *>(this->itk::ProcessObject::GetOutput(2)); } diff --git a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.txx b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.txx index 0f68fdc88c..3175bbd02d 100644 --- a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.txx +++ b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.txx @@ -87,7 +87,7 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> { if (this->GetNumberOfInputs()<1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -99,7 +99,7 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> { if (this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -111,7 +111,7 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> { if (this->GetNumberOfInputs()<3) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(2)); } @@ -123,7 +123,7 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> { if (this->GetNumberOfInputs()<4) { - return 0; + return ITK_NULLPTR; } return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(3)); } diff --git a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.txx b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.txx index 58ddda9229..262c74d7ed 100644 --- a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.txx +++ b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.txx @@ -104,7 +104,7 @@ Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::Get3DMapInput(unsi { if ((2 * (index + 1)) > this->GetNumberOfInputs()) { - return NULL; + return ITK_NULLPTR; } return static_cast<const T3DImage *> (this->itk::ProcessObject::GetInput(2 * index)); } @@ -115,7 +115,7 @@ Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::GetMaskInput(unsig { if ((2 * (index + 1)) > this->GetNumberOfInputs()) { - return NULL; + return ITK_NULLPTR; } return static_cast<const TMaskImage *> (this->itk::ProcessObject::GetInput(2 * index + 1)); } @@ -137,7 +137,7 @@ Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::GetDEMOutput() { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputDEMImage *> (this->itk::ProcessObject::GetOutput(0)); } @@ -567,8 +567,8 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::ThreadedGener InputInternalPixelType maxLat = std::max(regionLat1, regionLat2); */ - TOutputDEMImage * tmpDEM = NULL; - AccumulatorImageType *tmpAcc = NULL; + TOutputDEMImage * tmpDEM = ITK_NULLPTR; + AccumulatorImageType *tmpAcc = ITK_NULLPTR; typename TOutputDEMImage::RegionType outputRequestedRegion = outputPtr->GetRequestedRegion(); typename T3DImage::RegionType splitRegion; diff --git a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.txx b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.txx index 01ecbc0812..581783af36 100644 --- a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.txx +++ b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.txx @@ -84,7 +84,7 @@ StereoSensorModelToElevationFilter<TInputImage, TOutputHeight> { if(this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(0)); } @@ -96,7 +96,7 @@ StereoSensorModelToElevationFilter<TInputImage, TOutputHeight> { if(this->GetNumberOfInputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(1)); } @@ -108,7 +108,7 @@ StereoSensorModelToElevationFilter<TInputImage, TOutputHeight> { if(this->GetNumberOfOutputs()<2) { - return 0; + return ITK_NULLPTR; } return static_cast<TOutputHeight *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.txx b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.txx index 0c4c07c791..f5f210a1f1 100644 --- a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.txx +++ b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.txx @@ -78,7 +78,7 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->itk::ProcessObject::GetOutput(0)); } @@ -104,7 +104,7 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Registration/Stereo/test/otbMulti3DMapToDEMFilter.cxx b/Modules/Registration/Stereo/test/otbMulti3DMapToDEMFilter.cxx index a06c79db28..585ba0b90c 100644 --- a/Modules/Registration/Stereo/test/otbMulti3DMapToDEMFilter.cxx +++ b/Modules/Registration/Stereo/test/otbMulti3DMapToDEMFilter.cxx @@ -124,8 +124,8 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[]) multiFilter->SetOutputSpacing(spacing); VectorImageType::PointType origin; - origin[0] = strtod(argv[argc-7], NULL); - origin[1] = strtod(argv[argc-6], NULL); + origin[0] = strtod(argv[argc-7], ITK_NULLPTR); + origin[1] = strtod(argv[argc-6], ITK_NULLPTR); multiFilter->SetOutputOrigin(origin); std::string projectionRef=otb::GeoInformationConversion::ToWKT( atoi(argv[argc-1])); @@ -380,8 +380,8 @@ spacing[1] = atof(argv[argc-1]); multiFilter->SetOutputSpacing(spacing); VectorImageType::PointType origin; -origin[0] = strtod(argv[argc-6], NULL); -origin[1] = strtod(argv[argc-5], NULL); +origin[0] = strtod(argv[argc-6], ITK_NULLPTR); +origin[1] = strtod(argv[argc-5], ITK_NULLPTR); multiFilter->SetOutputOrigin(origin); diff --git a/Modules/Segmentation/CCOBIA/test/otbConnectedComponentMuParserFunctorTest.cxx b/Modules/Segmentation/CCOBIA/test/otbConnectedComponentMuParserFunctorTest.cxx index d8634f59a2..e49652a2c9 100644 --- a/Modules/Segmentation/CCOBIA/test/otbConnectedComponentMuParserFunctorTest.cxx +++ b/Modules/Segmentation/CCOBIA/test/otbConnectedComponentMuParserFunctorTest.cxx @@ -45,7 +45,7 @@ int otbConnectedComponentMuParserFunctorTest(int argc, char *argv[]) } else { - maskFilename = NULL; + maskFilename = ITK_NULLPTR; } typedef float InputPixelType; @@ -74,7 +74,7 @@ int otbConnectedComponentMuParserFunctorTest(int argc, char *argv[]) filter->SetInput(reader->GetOutput()); - if(NULL != maskFilename) + if(ITK_NULLPTR != maskFilename) { maskReader = MaskReaderType::New(); maskReader->SetFileName(maskFilename); diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.txx b/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.txx index 07cedbc9b6..808293e743 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.txx @@ -90,7 +90,7 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputLabelImageType *>(this->itk::ProcessObject::GetOutput(0)); } @@ -114,7 +114,7 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputClusteredImageType *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.txx b/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.txx index 1ad390d878..082e4eaebc 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.txx @@ -91,7 +91,7 @@ LabelImageRegionPruningFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe { if (this->GetNumberOfOutputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputLabelImageType *>(this->itk::ProcessObject::GetOutput(0)); } @@ -115,7 +115,7 @@ LabelImageRegionPruningFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputClusteredImageType *>(this->itk::ProcessObject::GetOutput(1)); } diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageToOGRDataSourceFilter.txx b/Modules/Segmentation/Conversion/include/otbLabelImageToOGRDataSourceFilter.txx index d6673f0980..3a8c9bec74 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageToOGRDataSourceFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageToOGRDataSourceFilter.txx @@ -78,7 +78,7 @@ LabelImageToOGRDataSourceFilter<TInputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(0)); @@ -100,7 +100,7 @@ LabelImageToOGRDataSourceFilter<TInputImage> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(1)); @@ -204,14 +204,14 @@ LabelImageToOGRDataSourceFilter<TInputImage> //Create the output layer for GDALPolygonize(). ogr::DataSource::Pointer ogrDS = ogr::DataSource::New(); - OGRLayerType outputLayer = ogrDS->CreateLayer("layer",NULL,wkbPolygon); + OGRLayerType outputLayer = ogrDS->CreateLayer("layer",ITK_NULLPTR,wkbPolygon); OGRFieldDefn field(m_FieldName.c_str(),OFTInteger); outputLayer.CreateField(field, true); //Call GDALPolygonize() char ** options; - options = NULL; + options = ITK_NULLPTR; char * option[1]; if (m_Use8Connected == true) { @@ -271,12 +271,12 @@ LabelImageToOGRDataSourceFilter<TInputImage> } maskDataset->SetGeoTransform(geoTransform); - GDALPolygonize(dataset->GetRasterBand(1), maskDataset->GetRasterBand(1), &outputLayer.ogr(), 0, options, NULL, NULL); + GDALPolygonize(dataset->GetRasterBand(1), maskDataset->GetRasterBand(1), &outputLayer.ogr(), 0, options, ITK_NULLPTR, ITK_NULLPTR); GDALClose(maskDataset); } else { - GDALPolygonize(dataset->GetRasterBand(1), NULL, &outputLayer.ogr(), 0, options, NULL, NULL); + GDALPolygonize(dataset->GetRasterBand(1), ITK_NULLPTR, &outputLayer.ogr(), 0, options, ITK_NULLPTR, ITK_NULLPTR); } this->SetNthOutput(0,ogrDS); diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageToVectorDataFilter.txx b/Modules/Segmentation/Conversion/include/otbLabelImageToVectorDataFilter.txx index 493127e115..d27f06596a 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageToVectorDataFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageToVectorDataFilter.txx @@ -59,7 +59,7 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(0)); @@ -81,7 +81,7 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision> { if (this->GetNumberOfInputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(1)); @@ -184,14 +184,14 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision> //Create the output layer for GDALPolygonize(). ogr::DataSource::Pointer ogrDS = ogr::DataSource::New(); - OGRLayerType outputLayer = ogrDS->CreateLayer("layer",NULL,wkbPolygon); + OGRLayerType outputLayer = ogrDS->CreateLayer("layer",ITK_NULLPTR,wkbPolygon); OGRFieldDefn field(m_FieldName.c_str(),OFTInteger); outputLayer.CreateField(field, true); //Call GDALPolygonize() char ** options; - options = NULL; + options = ITK_NULLPTR; char * option[1]; if (m_Use8Connected == true) { @@ -251,12 +251,12 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision> } maskDataset->SetGeoTransform(geoTransform); - GDALPolygonize(dataset->GetRasterBand(1), maskDataset->GetRasterBand(1), &outputLayer.ogr(), 0, options, NULL, NULL); + GDALPolygonize(dataset->GetRasterBand(1), maskDataset->GetRasterBand(1), &outputLayer.ogr(), 0, options, ITK_NULLPTR, ITK_NULLPTR); GDALClose(maskDataset); } else { - GDALPolygonize(dataset->GetRasterBand(1), NULL, &outputLayer.ogr(), 0, options, NULL, NULL); + GDALPolygonize(dataset->GetRasterBand(1), ITK_NULLPTR, &outputLayer.ogr(), 0, options, ITK_NULLPTR, ITK_NULLPTR); } diff --git a/Modules/Segmentation/Conversion/include/otbLabelMapToVectorDataFilter.txx b/Modules/Segmentation/Conversion/include/otbLabelMapToVectorDataFilter.txx index 046971179d..358d3c58ab 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelMapToVectorDataFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbLabelMapToVectorDataFilter.txx @@ -56,7 +56,7 @@ LabelMapToVectorDataFilter<TLabelMap, TVectorData, TFieldsFunctor> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TLabelMap *> diff --git a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.txx b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.txx index 69b8e325f4..4106b2faed 100644 --- a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.txx @@ -235,7 +235,7 @@ OGRDataSourceToLabelImageFilter<TOutputImage>::GenerateData() GDALSetGeoTransform(dataset,const_cast<double*>(geoTransform.GetDataPointer())); // Burn the geometries into the dataset - if (dataset != NULL) + if (dataset != ITK_NULLPTR) { std::vector<std::string> options; @@ -250,9 +250,9 @@ OGRDataSourceToLabelImageFilter<TOutputImage>::GenerateData() &m_BandsToBurn[0], m_SrcDataSetLayers.size(), &(m_SrcDataSetLayers[0]), - NULL, NULL, &foreground[0], + ITK_NULLPTR, ITK_NULLPTR, &foreground[0], ogr::StringListConverter(options).to_ogr(), - NULL, NULL ); + ITK_NULLPTR, ITK_NULLPTR ); // release the dataset GDALClose( dataset ); } diff --git a/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx b/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx index 94c0ac94fa..39ce2c2814 100644 --- a/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx @@ -33,7 +33,7 @@ namespace otb template<class TImage> PersistentImageToOGRLayerFilter<TImage> -::PersistentImageToOGRLayerFilter() : m_OGRLayer(NULL, false) +::PersistentImageToOGRLayerFilter() : m_OGRLayer(ITK_NULLPTR, false) { m_StreamSize.Fill(0); } diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h index 0e330f01d0..bd0187cb43 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h @@ -138,7 +138,7 @@ protected: RasterizeVectorDataFilter(); ~RasterizeVectorDataFilter() ITK_OVERRIDE { - if (m_OGRDataSourcePointer != NULL) + if (m_OGRDataSourcePointer != ITK_NULLPTR) { ogr::version_proxy::Close(m_OGRDataSourcePointer); } diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.txx b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.txx index 425710d516..7bcab2be19 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.txx @@ -25,7 +25,7 @@ namespace otb template<class TVectorData, class TInputImage, class TOutputImage> RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage> ::RasterizeVectorDataFilter() - : m_OGRDataSourcePointer(0) + : m_OGRDataSourcePointer(ITK_NULLPTR) { this->SetNumberOfRequiredInputs(1); } @@ -64,7 +64,7 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage> // Get the projection ref of the current VectorData std::string projectionRefWkt = vd->GetProjectionRef(); bool projectionInformationAvailable = !projectionRefWkt.empty(); - OGRSpatialReference * oSRS = NULL; + OGRSpatialReference * oSRS = ITK_NULLPTR; if (projectionInformationAvailable) { @@ -83,14 +83,14 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage> // Iterative method to build the layers from a VectorData OGRRegisterAll(); - OGRLayer * ogrCurrentLayer = NULL; + OGRLayer * ogrCurrentLayer = ITK_NULLPTR; std::vector<OGRLayer *> ogrLayerVector; otb::OGRIOHelper::Pointer IOConversion = otb::OGRIOHelper::New(); // The method ConvertDataTreeNodeToOGRLayers create the // OGRDataSource but don t release it. Destruction is done in the // desctructor - m_OGRDataSourcePointer = NULL; + m_OGRDataSourcePointer = ITK_NULLPTR; ogrLayerVector = IOConversion->ConvertDataTreeNodeToOGRLayers(inputRoot, m_OGRDataSourcePointer, ogrCurrentLayer, @@ -103,7 +103,7 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage> } // Destroy the oSRS - if (oSRS != NULL) + if (oSRS != ITK_NULLPTR) { OSRRelease(oSRS); } @@ -184,15 +184,15 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage>::GenerateData( GDALSetGeoTransform(dataset,const_cast<double*>(geoTransform.GetDataPointer())); // Burn the geometries into the dataset - if (dataset != NULL) + if (dataset != ITK_NULLPTR) { GDALRasterizeLayers( dataset, m_BandsToBurn.size(), &(m_BandsToBurn[0]), m_SrcDataSetLayers.size(), &(m_SrcDataSetLayers[0]), - NULL, NULL, &(m_FullBurnValues[0]), - NULL, - GDALDummyProgress, NULL ); + ITK_NULLPTR, ITK_NULLPTR, &(m_FullBurnValues[0]), + ITK_NULLPTR, + GDALDummyProgress, ITK_NULLPTR ); // release the dataset GDALClose( dataset ); diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h index e06e5da6b9..ac5f4d6895 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h @@ -132,7 +132,7 @@ protected: OGR_G_DestroyGeometry(m_SrcDataSetGeometries[idx]); } - if (m_OGRDataSourcePointer != NULL) + if (m_OGRDataSourcePointer != ITK_NULLPTR) { ogr::version_proxy::Close(m_OGRDataSourcePointer); } diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx index 105b2e8d07..80de3b44e9 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx @@ -32,7 +32,7 @@ namespace otb template<class TVectorData, class TOutputImage> VectorDataToLabelImageFilter<TVectorData, TOutputImage> ::VectorDataToLabelImageFilter() - : m_OGRDataSourcePointer(0), + : m_OGRDataSourcePointer(ITK_NULLPTR), m_BurnAttribute("FID") { this->SetNumberOfRequiredInputs(1); @@ -165,7 +165,7 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> // Get the projection ref of the current VectorData std::string projectionRefWkt = vd->GetProjectionRef(); bool projectionInformationAvailable = !projectionRefWkt.empty(); - OGRSpatialReference * oSRS = NULL; + OGRSpatialReference * oSRS = ITK_NULLPTR; if (projectionInformationAvailable) { @@ -183,14 +183,14 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> InternalTreeNodeType * inputRoot = const_cast<InternalTreeNodeType *>(tree->GetRoot()); // Iterative method to build the layers from a VectorData - OGRLayer * ogrCurrentLayer = NULL; + OGRLayer * ogrCurrentLayer = ITK_NULLPTR; std::vector<OGRLayer *> ogrLayerVector; otb::OGRIOHelper::Pointer IOConversion = otb::OGRIOHelper::New(); // The method ConvertDataTreeNodeToOGRLayers create the // OGRDataSource but don t release it. Destruction is done in the // desctructor - m_OGRDataSourcePointer = NULL; + m_OGRDataSourcePointer = ITK_NULLPTR; ogrLayerVector = IOConversion->ConvertDataTreeNodeToOGRLayers(inputRoot, m_OGRDataSourcePointer, ogrCurrentLayer, @@ -210,10 +210,10 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> // Get the geometries of the layer OGRFeatureH hFeat; OGR_L_ResetReading( (OGRLayerH)(ogrLayerVector[idx2]) ); - while( ( hFeat = OGR_L_GetNextFeature( (OGRLayerH)(ogrLayerVector[idx2]) )) != NULL ) + while( ( hFeat = OGR_L_GetNextFeature( (OGRLayerH)(ogrLayerVector[idx2]) )) != ITK_NULLPTR ) { OGRGeometryH hGeom; - if( OGR_F_GetGeometryRef( hFeat ) == NULL ) + if( OGR_F_GetGeometryRef( hFeat ) == ITK_NULLPTR ) { OGR_F_Destroy( hFeat ); continue; @@ -241,7 +241,7 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> } // Destroy the oSRS - if (oSRS != NULL) + if (oSRS != ITK_NULLPTR) { OSRRelease(oSRS); } @@ -309,15 +309,15 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>::GenerateData() GDALSetGeoTransform(dataset,const_cast<double*>(geoTransform.GetDataPointer())); // Burn the geometries into the dataset - if (dataset != NULL) + if (dataset != ITK_NULLPTR) { GDALRasterizeGeometries( dataset, m_BandsToBurn.size(), &(m_BandsToBurn[0]), m_SrcDataSetGeometries.size(), &(m_SrcDataSetGeometries[0]), - NULL, NULL, &(m_FullBurnValues[0]), - NULL, - GDALDummyProgress, NULL ); + ITK_NULLPTR, ITK_NULLPTR, &(m_FullBurnValues[0]), + ITK_NULLPTR, + GDALDummyProgress, ITK_NULLPTR ); // release the dataset GDALClose( dataset ); diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.txx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.txx index 21fa5200d1..e7d1ac88d9 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.txx @@ -224,7 +224,7 @@ VectorDataToLabelMapWithAttributesFilter<TVectorData, TLabelMap> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const TVectorData *> diff --git a/Modules/Segmentation/MorphologicalProfiles/include/otbGeodesicMorphologyDecompositionImageFilter.txx b/Modules/Segmentation/MorphologicalProfiles/include/otbGeodesicMorphologyDecompositionImageFilter.txx index e830f7e5fa..bb910c8192 100644 --- a/Modules/Segmentation/MorphologicalProfiles/include/otbGeodesicMorphologyDecompositionImageFilter.txx +++ b/Modules/Segmentation/MorphologicalProfiles/include/otbGeodesicMorphologyDecompositionImageFilter.txx @@ -100,7 +100,7 @@ GeodesicMorphologyDecompositionImageFilter<TInputImage, TOutputImage, TStructuri { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *> (this->itk::ProcessObject::GetOutput(1)); @@ -116,7 +116,7 @@ GeodesicMorphologyDecompositionImageFilter<TInputImage, TOutputImage, TStructuri { if (this->GetNumberOfOutputs() < 3) { - return 0; + return ITK_NULLPTR; } return static_cast<OutputImageType *> (this->itk::ProcessObject::GetOutput(2)); diff --git a/Modules/Segmentation/MorphologicalProfiles/include/otbProfileDerivativeToMultiScaleCharacteristicsFilter.txx b/Modules/Segmentation/MorphologicalProfiles/include/otbProfileDerivativeToMultiScaleCharacteristicsFilter.txx index ea6dfc405b..841bc57c78 100644 --- a/Modules/Segmentation/MorphologicalProfiles/include/otbProfileDerivativeToMultiScaleCharacteristicsFilter.txx +++ b/Modules/Segmentation/MorphologicalProfiles/include/otbProfileDerivativeToMultiScaleCharacteristicsFilter.txx @@ -43,7 +43,7 @@ ProfileDerivativeToMultiScaleCharacteristicsFilter<TInputImage, TOutputImage, TL { if (this->GetNumberOfOutputs() < 2) { - return 0; + return ITK_NULLPTR; } return static_cast<LabeledImageType *> (this->itk::ProcessObject::GetOutput(1)); diff --git a/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx b/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx index d9073ed4cd..4e8b88b096 100644 --- a/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx +++ b/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx @@ -31,7 +31,7 @@ namespace otb template<class TImage> OGRLayerStreamStitchingFilter<TImage> -::OGRLayerStreamStitchingFilter() : m_Radius(2), m_OGRLayer(NULL, false) +::OGRLayerStreamStitchingFilter() : m_Radius(2), m_OGRLayer(ITK_NULLPTR, false) { m_StreamSize.Fill(0); } @@ -52,7 +52,7 @@ OGRLayerStreamStitchingFilter<TInputImage> { if (this->GetNumberOfInputs() < 1) { - return 0; + return ITK_NULLPTR; } return static_cast<const InputImageType *>(this->Superclass::GetInput(0)); diff --git a/Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx b/Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx index ce622a15a8..a18726e4d9 100644 --- a/Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx +++ b/Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx @@ -85,7 +85,7 @@ int otbOGRLayerStreamStitchingFilter(int argc, char * argv[]) //REPACK the layer to remove features marked as deleted in the Shapefile. std::string sql("REPACK "); sql = sql + layerName; - ogrDS->ExecuteSQL(sql , NULL, NULL); + ogrDS->ExecuteSQL(sql , ITK_NULLPTR, ITK_NULLPTR); return EXIT_SUCCESS; } diff --git a/Modules/ThirdParty/ITK/include/otbWarpImageFilter.txx b/Modules/ThirdParty/ITK/include/otbWarpImageFilter.txx index 14341e4168..4cbfd2d363 100644 --- a/Modules/ThirdParty/ITK/include/otbWarpImageFilter.txx +++ b/Modules/ThirdParty/ITK/include/otbWarpImageFilter.txx @@ -205,7 +205,7 @@ WarpImageFilter<TInputImage,TOutputImage,TDisplacementField> ::AfterThreadedGenerateData() { // Disconnect input image from interpolator - m_Interpolator->SetInputImage( NULL ); + m_Interpolator->SetInputImage( ITK_NULLPTR ); } diff --git a/Modules/ThirdParty/MuParserX/src/mpCompat.h.in b/Modules/ThirdParty/MuParserX/src/mpCompat.h.in index e9c2feee92..0df5b70b1c 100644 --- a/Modules/ThirdParty/MuParserX/src/mpCompat.h.in +++ b/Modules/ThirdParty/MuParserX/src/mpCompat.h.in @@ -27,7 +27,7 @@ #endif #if @OTB_MUPARSERX_HIDE_NULLPTR@ -#define nullptr NULL +#define ITK_NULLPTR NULL #endif #endif diff --git a/Modules/Visualization/Ice/include/otbGlImageActor.h b/Modules/Visualization/Ice/include/otbGlImageActor.h index ad5e125f54..618185de68 100644 --- a/Modules/Visualization/Ice/include/otbGlImageActor.h +++ b/Modules/Visualization/Ice/include/otbGlImageActor.h @@ -226,7 +226,7 @@ protected: m_RedIdx(1), m_GreenIdx(2), m_BlueIdx(3), - m_RescaleFilter(NULL) + m_RescaleFilter(ITK_NULLPTR) { m_UL.Fill(0); m_UR.Fill(0); diff --git a/Modules/Visualization/Ice/include/otbGlView.h b/Modules/Visualization/Ice/include/otbGlView.h index 7c479ecaf8..af90769098 100644 --- a/Modules/Visualization/Ice/include/otbGlView.h +++ b/Modules/Visualization/Ice/include/otbGlView.h @@ -325,7 +325,7 @@ GlView const otb::GeoInterface * geo = dynamic_cast< const GeoInterface * >( actor.GetPointer() ); - if( geo==NULL ) + if( geo==ITK_NULLPTR ) return false; @@ -619,7 +619,7 @@ GlView const GeoInterface * geo = dynamic_cast< const GeoInterface * >( actor.GetPointer() ); - if( geo==NULL ) + if( geo==ITK_NULLPTR ) return false; // Get viewport current center and spacing. diff --git a/Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx b/Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx index 6cc5b293cc..d0265c5fe6 100644 --- a/Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx +++ b/Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx @@ -56,7 +56,7 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std:: const char * source_cstr = source.c_str(); - glShaderSource(shader, 1, &source_cstr,NULL); + glShaderSource(shader, 1, &source_cstr,ITK_NULLPTR); glCompileShader(shader); GLint compiled; @@ -75,7 +75,7 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std:: delete [] logs; // For safety! - logs = NULL; + logs = ITK_NULLPTR; // Shader must be destroyed here! glDeleteShader( shader ); diff --git a/Modules/Visualization/Ice/src/otbGlVectorActor.cxx b/Modules/Visualization/Ice/src/otbGlVectorActor.cxx index d16f27579b..d707d63846 100644 --- a/Modules/Visualization/Ice/src/otbGlVectorActor.cxx +++ b/Modules/Visualization/Ice/src/otbGlVectorActor.cxx @@ -207,8 +207,8 @@ void GlVectorActor::SetCurrentLayer(const std::string & layername) m_CurrentLayer = m_OGRDataSource->GetLayerChecked(layername).GetName(); // Clear transforms - m_VectorToViewportTransform = NULL; - m_ViewportToVectorTransform = NULL; + m_VectorToViewportTransform = ITK_NULLPTR; + m_ViewportToVectorTransform = ITK_NULLPTR; // Clear features m_InternalFeatures.clear(); @@ -368,7 +368,7 @@ void GlVectorActor::UpdateData() { std::ostringstream oss; oss<<"SELECT * FROM "<<m_CurrentLayer<<" WHERE OGR_GEOM_AREA>"<<100*areaOfScreenPixel; - filtered = m_OGRDataSource->ExecuteSQL(oss.str(), &spatialFilter,NULL); + filtered = m_OGRDataSource->ExecuteSQL(oss.str(), &spatialFilter,ITK_NULLPTR); } m_InternalFeatures.clear(); @@ -424,7 +424,7 @@ void GeometryRender(const OGRPolygon * in, GLUtesselator * tesselator, bool fill gluTessProperty(tesselator, GLU_TESS_BOUNDARY_ONLY, !fill); // Begin a new polygon - gluTessBeginPolygon(tesselator, NULL); + gluTessBeginPolygon(tesselator, ITK_NULLPTR); // Render the outer boundary gluTessBeginContour(tesselator); @@ -470,7 +470,7 @@ void GeometryRender(const OGRPolygon * in, GLUtesselator * tesselator, bool fill gluTessProperty(tesselator, GLU_TESS_BOUNDARY_ONLY, true); // Begin a new polygon - gluTessBeginPolygon(tesselator, NULL); + gluTessBeginPolygon(tesselator, ITK_NULLPTR); // Render the outer boundary gluTessBeginContour(tesselator); diff --git a/Modules/Visualization/Ice/src/otbGlVersionChecker.cxx b/Modules/Visualization/Ice/src/otbGlVersionChecker.cxx index 5ed75842ef..ceca0f503c 100644 --- a/Modules/Visualization/Ice/src/otbGlVersionChecker.cxx +++ b/Modules/Visualization/Ice/src/otbGlVersionChecker.cxx @@ -39,7 +39,7 @@ GlVersionChecker { const GLubyte * glVersionStr = glGetString( GL_VERSION ); - if( glVersionStr==NULL ) + if( glVersionStr==ITK_NULLPTR ) { std::ostringstream oss; @@ -60,7 +60,7 @@ GlVersionChecker { const GLubyte * slVersionStr = glGetString( GL_SHADING_LANGUAGE_VERSION ); - if( slVersionStr==NULL ) + if( slVersionStr==ITK_NULLPTR ) { std::ostringstream oss; @@ -85,7 +85,7 @@ GlVersionChecker // If OpenGL version is at least 2.0, get (and return) GLSL version // (before checking against OpenGL required version). if( GlVersionChecker::VerCmp( glVersion, "2.0" )<0 ) - glslVersion = NULL; + glslVersion = ITK_NULLPTR; else glslVersion = GlVersionChecker::GLSLVersion(); @@ -113,7 +113,7 @@ GlVersionChecker { // // Special case: empty strings returns 0.0.0 and true. - if( version==NULL || strlen( version )==0 ) + if( version==ITK_NULLPTR || strlen( version )==0 ) { major = 0; minor = 0; @@ -142,7 +142,7 @@ GlVersionChecker const char * minorStr = strchr( version, '.' ); - if( minorStr==NULL ) + if( minorStr==ITK_NULLPTR ) return false; minor = atoi( ++minorStr ); @@ -156,7 +156,7 @@ GlVersionChecker // In this case, it is Ok to return because version of the form // Major.minor are handled. - if( releaseStr==NULL ) + if( releaseStr==ITK_NULLPTR ) return true; release = atoi( ++releaseStr ); diff --git a/Modules/Visualization/Ice/src/otbGlView.cxx b/Modules/Visualization/Ice/src/otbGlView.cxx index cb4a287d90..185684a247 100644 --- a/Modules/Visualization/Ice/src/otbGlView.cxx +++ b/Modules/Visualization/Ice/src/otbGlView.cxx @@ -461,7 +461,7 @@ GlView } delete[] glBuffer; - glBuffer = NULL; + glBuffer = ITK_NULLPTR; // // Setup import RGBA-image filter. diff --git a/Modules/Visualization/Ice/src/otbStandardShader.cxx b/Modules/Visualization/Ice/src/otbStandardShader.cxx index b82b769954..66e4817f56 100644 --- a/Modules/Visualization/Ice/src/otbStandardShader.cxx +++ b/Modules/Visualization/Ice/src/otbStandardShader.cxx @@ -46,8 +46,8 @@ StandardShader::~StandardShader() std::string StandardShader::GetSource() const { - const char * glVersion = NULL; - const char * glslVersion = NULL; + const char * glVersion = ITK_NULLPTR; + const char * glslVersion = ITK_NULLPTR; if(!otb::GlVersionChecker::CheckGLCapabilities( glVersion, glslVersion)) { itkExceptionMacro(<<" Required GL and GLSL versions were not found (GL version is "<<glVersion<<", should be at least "<<otb::GlVersionChecker::REQUIRED_GL_VERSION<<", GLSL version is "<<glslVersion<<", should be at least "<<otb::GlVersionChecker::REQUIRED_GLSL_VERSION<<")"); diff --git a/Modules/Visualization/IceViewer/src/otbIce.cxx b/Modules/Visualization/IceViewer/src/otbIce.cxx index 6d3ec67a94..e43df3d85d 100644 --- a/Modules/Visualization/IceViewer/src/otbIce.cxx +++ b/Modules/Visualization/IceViewer/src/otbIce.cxx @@ -39,13 +39,13 @@ int main(int argc, char * argv[]) otb::DEMHandler::Pointer demHandler = otb::DEMHandler::Instance(); - if(demdir != NULL) + if(demdir != ITK_NULLPTR) { std::cout<<"Configuring DEM directory: "<<demdir<<std::endl; demHandler->OpenDEMDirectory(demdir); } - if(geoidfile != NULL) + if(geoidfile != ITK_NULLPTR) { std::cout<<"Configuring geoid file: "<<geoidfile<<std::endl; demHandler->OpenGeoidFile(geoidfile); diff --git a/Modules/Visualization/IceViewer/src/otbIceViewer.cxx b/Modules/Visualization/IceViewer/src/otbIceViewer.cxx index 3782d2705e..7f38e909ba 100644 --- a/Modules/Visualization/IceViewer/src/otbIceViewer.cxx +++ b/Modules/Visualization/IceViewer/src/otbIceViewer.cxx @@ -38,7 +38,7 @@ GlVectorActor::ColorType BuildColor(double r, double g, double b) } IceViewer::IceViewer() - : m_Window(NULL), + : m_Window(ITK_NULLPTR), m_View(), m_FastRendering(false), m_SelectedActor(""), @@ -71,7 +71,7 @@ IceViewer::IceViewer() IceViewer::~IceViewer() { - if(m_Window != NULL) + if(m_Window != ITK_NULLPTR) { glfwDestroyWindow(m_Window); } @@ -88,8 +88,8 @@ void IceViewer::AddImage(const std::string & fname, const std::string & key, con otb::GlImageActor::Pointer actor = otb::GlImageActor::New(); - const char * glVersion = NULL; - const char * glslVersion = NULL; + const char * glVersion = ITK_NULLPTR; + const char * glslVersion = ITK_NULLPTR; if( GlVersionChecker::CheckGLCapabilities( glVersion, glslVersion ) ) @@ -226,19 +226,19 @@ void IceViewer::Initialize(unsigned int w, unsigned int h, const std::string & n // Initialize glut (ugly workaround) int fake_argc = 1; char fake_name[] = "fake"; - char * fake_argv[] = {fake_name,NULL}; + char * fake_argv[] = {fake_name,ITK_NULLPTR}; glutInit(&fake_argc,fake_argv); // Set glfw errors callback glfwSetErrorCallback(error_callback); // Create the window - if(m_Window != NULL) + if(m_Window != ITK_NULLPTR) { glfwDestroyWindow(m_Window); } - m_Window = glfwCreateWindow(w, h,name.c_str(), NULL, NULL); + m_Window = glfwCreateWindow(w, h,name.c_str(), ITK_NULLPTR, ITK_NULLPTR); if (!m_Window) { itkExceptionMacro(<<"Could not create glfw window."); diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 3df1c1937b..a98e762721 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -178,7 +178,7 @@ void Application::UpdateParameters() { Parameter* param = GetParameterByKey(inXMLKey); InputProcessXMLParameter* inXMLParam = dynamic_cast<InputProcessXMLParameter*>(param); - if(inXMLParam!=NULL) + if(inXMLParam!=ITK_NULLPTR) { inXMLParam->Read(this); m_IsInXMLParsed = true; @@ -208,7 +208,7 @@ int Application::Execute() UseSpecificSeed = true; Parameter* param = GetParameterByKey(key); IntParameter* randParam = dynamic_cast<IntParameter*> (param); - if(randParam!=NULL) + if(randParam!=ITK_NULLPTR) { int seed = randParam->GetValue(); itk::Statistics::MersenneTwisterRandomVariateGenerator::GetInstance()->SetSeed(seed); @@ -247,7 +247,7 @@ int Application::ExecuteAndWriteOutput() { Parameter* param = GetParameterByKey(key); RAMParameter* ramParam = dynamic_cast<RAMParameter*>(param); - if(ramParam!=NULL) + if(ramParam!=ITK_NULLPTR) { ram = ramParam->GetValue(); useRAM = true; @@ -266,7 +266,7 @@ int Application::ExecuteAndWriteOutput() Parameter* param = GetParameterByKey(key); OutputImageParameter* outputParam = dynamic_cast<OutputImageParameter*>(param); - if(outputParam!=NULL) + if(outputParam!=ITK_NULLPTR) { outputParam->InitializeWriters(); if (useRAM) @@ -284,7 +284,7 @@ int Application::ExecuteAndWriteOutput() { Parameter* param = GetParameterByKey(key); OutputVectorDataParameter* outputParam = dynamic_cast<OutputVectorDataParameter*>(param); - if(outputParam!=NULL) + if(outputParam!=ITK_NULLPTR) { outputParam->InitializeWriters(); std::ostringstream progressId; @@ -299,7 +299,7 @@ int Application::ExecuteAndWriteOutput() Parameter* param = GetParameterByKey(key); ComplexOutputImageParameter* outputParam = dynamic_cast<ComplexOutputImageParameter*>(param); - if(outputParam!=NULL) + if(outputParam!=ITK_NULLPTR) { outputParam->InitializeWriters(); if (useRAM) @@ -319,7 +319,7 @@ int Application::ExecuteAndWriteOutput() { Parameter* param = GetParameterByKey(key); OutputProcessXMLParameter* outXMLParam = dynamic_cast<OutputProcessXMLParameter*>(param); - if(outXMLParam!=NULL) + if(outXMLParam!=ITK_NULLPTR) { outXMLParam->Write(this); } @@ -1140,7 +1140,7 @@ std::vector<std::string> Application::GetParameterStringList(std::string paramet FloatVectorImageType* Application::GetParameterImage(std::string parameter) { - FloatVectorImageType::Pointer ret = NULL; + FloatVectorImageType::Pointer ret = ITK_NULLPTR; Parameter* param = GetParameterByKey(parameter); if (dynamic_cast<InputImageParameter*> (param)) @@ -1158,7 +1158,7 @@ FloatVectorImageType* Application::GetParameterImage(std::string parameter) FloatVectorImageListType* Application::GetParameterImageList(std::string parameter) { - FloatVectorImageListType::Pointer ret=NULL; + FloatVectorImageListType::Pointer ret=ITK_NULLPTR; Parameter* param = GetParameterByKey(parameter); if (dynamic_cast<InputImageListParameter*>(param)) @@ -1176,7 +1176,7 @@ FloatVectorImageListType* Application::GetParameterImageList(std::string paramet ComplexFloatVectorImageType* Application::GetParameterComplexImage(std::string parameter) { - ComplexFloatVectorImageType::Pointer ret=NULL; + ComplexFloatVectorImageType::Pointer ret=ITK_NULLPTR; Parameter* param = GetParameterByKey(parameter); if (dynamic_cast<ComplexInputImageParameter*>(param)) @@ -1194,7 +1194,7 @@ ComplexFloatVectorImageType* Application::GetParameterComplexImage(std::string p VectorDataType* Application::GetParameterVectorData(std::string parameter) { - VectorDataType::Pointer ret=NULL; + VectorDataType::Pointer ret=ITK_NULLPTR; Parameter* param = GetParameterByKey(parameter); if (dynamic_cast<InputVectorDataParameter*>(param)) @@ -1211,7 +1211,7 @@ VectorDataType* Application::GetParameterVectorData(std::string parameter) VectorDataListType* Application::GetParameterVectorDataList(std::string parameter) { - VectorDataListType::Pointer ret=NULL; + VectorDataListType::Pointer ret=ITK_NULLPTR; Parameter* param = GetParameterByKey(parameter); if (dynamic_cast<InputVectorDataListParameter*>(param)) diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx index ea668936fe..aa2cb096c3 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx @@ -68,7 +68,7 @@ public: { if ((*it).first == app) { - (*it).first = NULL; + (*it).first = ITK_NULLPTR; } ++it; } @@ -82,13 +82,13 @@ public: AppHandleContainerType::iterator it; for (it = m_Container.begin() ; it != m_Container.end() ; ++it) { - if ((*it).first == NULL) + if ((*it).first == ITK_NULLPTR) { itk::DynamicLoader::CloseLibrary( static_cast<itk::LibHandle>((*it).second)); - (*it).second = NULL; + (*it).second = ITK_NULLPTR; } } - m_Container.remove(AppHandlePairType((Application*) NULL, (void*) NULL)); + m_Container.remove(AppHandlePairType((Application*) ITK_NULLPTR, (void*) ITK_NULLPTR)); } /** close all handles at program exit */ @@ -223,7 +223,7 @@ typedef itk::ObjectFactoryBase * ( *ITK_LOAD_FUNCTION )(); Application::Pointer ApplicationRegistry::CreateApplicationFaster(const std::string& name) { - ApplicationPointer appli = NULL; + ApplicationPointer appli = ITK_NULLPTR; std::string appExtension = itksys::DynamicLoader::LibExtension(); #ifdef __APPLE__ @@ -329,7 +329,7 @@ ApplicationRegistry::GetAvailableApplications(bool useFactory) { appSet.insert(name); } - appli = NULL; + appli = ITK_NULLPTR; } } } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx index 7f4bb8cfe3..63ad78e157 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx @@ -148,9 +148,9 @@ ComplexInputImageParameter::HasValue() const void ComplexInputImageParameter::ClearValue() { - m_Image = NULL; - m_Reader = NULL; - m_Caster = NULL; + m_Image = ITK_NULLPTR; + m_Reader = ITK_NULLPTR; + m_Caster = ITK_NULLPTR; m_FileName = ""; m_PreviousFileName=""; m_UseFilename = true; diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx index 2421c4fe81..5784d3a915 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx @@ -162,7 +162,7 @@ ComplexOutputImageParameter::GetWriter() type = 1; } - itk::ProcessObject* writer = 0; + itk::ProcessObject* writer = ITK_NULLPTR; switch ( GetComplexPixelType() ) { case ComplexImagePixelType_float: diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputFilenameListParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputFilenameListParameter.cxx index 226a412a2d..9169676cd0 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputFilenameListParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputFilenameListParameter.cxx @@ -81,7 +81,7 @@ InputFilenameListParameter::SetListFromFileName(const std::vector<std::string> & void InputFilenameListParameter::AddNullElement() { - m_FilenameList->PushBack(NULL); + m_FilenameList->PushBack(ITK_NULLPTR); SetActive(false); this->Modified(); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx index 1516830f43..ae1acf31b3 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx @@ -83,8 +83,8 @@ InputImageListParameter::SetListFromFileName(const std::vector<std::string> & fi void InputImageListParameter::AddNullElement() { - m_ReaderList->PushBack(NULL); - m_ImageList->PushBack(NULL); + m_ReaderList->PushBack(ITK_NULLPTR); + m_ImageList->PushBack(ITK_NULLPTR); SetActive(false); this->Modified(); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx index 98f7d9d843..5d15296a5c 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx @@ -104,9 +104,9 @@ InputImageParameter::HasValue() const void InputImageParameter::ClearValue() { - m_Image = NULL; - m_Reader = NULL; - m_Caster = NULL; + m_Image = ITK_NULLPTR; + m_Reader = ITK_NULLPTR; + m_Caster = ITK_NULLPTR; m_FileName = ""; m_PreviousFileName=""; m_UseFilename = true; diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx index be17bb948f..4f267cdda6 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx @@ -137,7 +137,7 @@ InputProcessXMLParameter::GetChildNodeTextOf(TiXmlElement *parentElement, std::s if(parentElement) { - TiXmlElement* childElement = 0; + TiXmlElement* childElement = ITK_NULLPTR; childElement = parentElement->FirstChildElement(key.c_str()); //same as childElement->GetText() does but that call is failing if there is @@ -251,7 +251,7 @@ InputProcessXMLParameter::Read(Application::Pointer this_) ParameterGroup::Pointer paramGroup = this_->GetParameterList(); // Iterate through the parameter list - for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != NULL; + for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != ITK_NULLPTR; n_Parameter = n_Parameter->NextSiblingElement() ) { std::string key,typeAsString, value, paramName; @@ -273,11 +273,11 @@ InputProcessXMLParameter::Read(Application::Pointer this_) param->SetUserValue(true); param->SetActive(true); - TiXmlElement* n_Values = NULL; + TiXmlElement* n_Values = ITK_NULLPTR; n_Values = n_Parameter->FirstChildElement("values"); if(n_Values) { - for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != NULL; + for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != ITK_NULLPTR; n_Value = n_Value->NextSiblingElement()) { values.push_back(n_Value->GetText()); @@ -292,7 +292,7 @@ InputProcessXMLParameter::Read(Application::Pointer this_) else if (type == ParameterType_OutputImage) { OutputImageParameter *paramDown = dynamic_cast<OutputImageParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) { paramDown->SetFileName(value); std::string pixTypeAsString = GetChildNodeTextOf(n_Parameter, "pixtype"); @@ -303,19 +303,19 @@ InputProcessXMLParameter::Read(Application::Pointer this_) else if (type == ParameterType_ComplexOutputImage) { ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) paramDown->SetFileName(value); } else if (type == ParameterType_Directory) { DirectoryParameter* paramDown = dynamic_cast<DirectoryParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) paramDown->SetValue(value); } else if (type == ParameterType_InputFilename) { InputFilenameParameter* paramDown = dynamic_cast<InputFilenameParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) paramDown->SetValue(value); } else if (type == ParameterType_InputImage) @@ -323,7 +323,7 @@ InputProcessXMLParameter::Read(Application::Pointer this_) if(itksys::SystemTools::FileExists(value.c_str())) { InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) { paramDown->SetFromFileName(value); if (!paramDown->SetFromFileName(value)) @@ -342,7 +342,7 @@ InputProcessXMLParameter::Read(Application::Pointer this_) if(itksys::SystemTools::FileExists(value.c_str())) { ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); - if(paramDown!=NULL) + if(paramDown!=ITK_NULLPTR) paramDown->SetFromFileName(value); } } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataListParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataListParameter.cxx index b6784a8ff6..b065d11a67 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataListParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataListParameter.cxx @@ -84,8 +84,8 @@ InputVectorDataListParameter::SetListFromFileName(const std::vector<std::string> void InputVectorDataListParameter::AddNullElement() { - m_ReaderList->PushBack(NULL); - m_VectorDataList->PushBack(NULL); + m_ReaderList->PushBack(ITK_NULLPTR); + m_VectorDataList->PushBack(ITK_NULLPTR); SetActive(false); this->Modified(); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataParameter.cxx index a2ed97c852..83705329c1 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputVectorDataParameter.cxx @@ -120,8 +120,8 @@ InputVectorDataParameter::HasValue() const void InputVectorDataParameter::ClearValue() { - m_VectorData = NULL; - m_Reader = NULL; + m_VectorData = ITK_NULLPTR; + m_Reader = ITK_NULLPTR; m_FileName = ""; } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx index ec02594f47..6ac918e80c 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx @@ -332,7 +332,7 @@ OutputImageParameter::GetWriter() // 1 : VectorImage // 2 : RGBAImage // 3 : RGBImage - itk::ProcessObject* writer = 0; + itk::ProcessObject* writer = ITK_NULLPTR; if (dynamic_cast<UInt8VectorImageType*> (m_Image.GetPointer()) || dynamic_cast<Int16VectorImageType*> (m_Image.GetPointer()) || dynamic_cast<UInt16VectorImageType*> (m_Image.GetPointer()) @@ -428,7 +428,7 @@ OutputImageParameter::GetWriter() break; } } - if (0 == writer) + if (ITK_NULLPTR == writer) { itkExceptionMacro("Unknown Writer type."); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx index b03401d297..faa67a7c8b 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx @@ -181,7 +181,7 @@ OutputProcessXMLParameter::Write(Application::Pointer app) { EmptyParameter* eParam = dynamic_cast<EmptyParameter *> (param); - if(eParam!=NULL) + if(eParam!=ITK_NULLPTR) { //Dont use app->HasUserValue which returns false always because of //EmptyParameter::HasValue() is false for EmptyParameter @@ -211,7 +211,7 @@ OutputProcessXMLParameter::Write(Application::Pointer app) { OutputImageParameter *imgParam = dynamic_cast<OutputImageParameter *>(param); - if(imgParam!=NULL) + if(imgParam!=ITK_NULLPTR) { value = imgParam->GetFileName(); ImagePixelType pixType = imgParam->GetPixelType(); diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx index e172ad37c8..2ccd5b153c 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx @@ -173,7 +173,7 @@ const std::string defaultXMLFileName = std::string(GetName()) + ".xml"; tmpParam->SetActive(false); AddParameter(tmpParam); - tmpParam = NULL; + tmpParam = ITK_NULLPTR; /* AddParameter(ParameterType_OutputProcessXML, key, descr); SetParameterDescription(key, descr); @@ -193,7 +193,7 @@ void ParameterGroup::AddInXMLParameter() tmpParam->SetActive(false); AddParameter(tmpParam); - tmpParam = NULL; + tmpParam = ITK_NULLPTR; /* AddParameter(ParameterType_InputProcessXML, key, descr); SetParameterDescription(key, descr); diff --git a/Modules/Wrappers/CommandLine/src/otbApplicationLauncherCommandLine.cxx b/Modules/Wrappers/CommandLine/src/otbApplicationLauncherCommandLine.cxx index 20971d4032..77d4b95ff0 100644 --- a/Modules/Wrappers/CommandLine/src/otbApplicationLauncherCommandLine.cxx +++ b/Modules/Wrappers/CommandLine/src/otbApplicationLauncherCommandLine.cxx @@ -100,18 +100,18 @@ std::string PrepareExpressionFromXML(std::string filename) expression.append(moduleName); - for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != NULL; + for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != ITK_NULLPTR; n_Parameter = n_Parameter->NextSiblingElement() ) { std::string key="-"; key.append(GetChildNodeTextOf(n_Parameter, "key")); - TiXmlElement* n_Values = NULL; + TiXmlElement* n_Values = ITK_NULLPTR; n_Values = n_Parameter->FirstChildElement("values"); if(n_Values) { std::string values; - for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != NULL; + for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != ITK_NULLPTR; n_Value = n_Value->NextSiblingElement()) { values.append(n_Value->GetText()); @@ -197,19 +197,19 @@ std::vector<std::string> PrepareVectorExpressionFromXML(std::string filename) expression.push_back(CleanWord(moduleName)); - for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != NULL; + for( TiXmlElement* n_Parameter = n_AppNode->FirstChildElement("parameter"); n_Parameter != ITK_NULLPTR; n_Parameter = n_Parameter->NextSiblingElement() ) { std::string key="-"; key.append(GetChildNodeTextOf(n_Parameter, "key")); expression.push_back(CleanWord(key)); - TiXmlElement* n_Values = NULL; + TiXmlElement* n_Values = ITK_NULLPTR; n_Values = n_Parameter->FirstChildElement("values"); if(n_Values) { std::string values; - for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != NULL; + for(TiXmlElement* n_Value = n_Values->FirstChildElement("value"); n_Value != ITK_NULLPTR; n_Value = n_Value->NextSiblingElement()) { expression.push_back(CleanWord(n_Value->GetText())); @@ -315,7 +315,7 @@ const std::string GetChildNodeTextOf(TiXmlElement *parentElement, std::string ke if(parentElement) { - TiXmlElement* childElement = 0; + TiXmlElement* childElement = ITK_NULLPTR; childElement = parentElement->FirstChildElement(key.c_str()); //same as childElement->GetText() does but that call is failing if there is diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index 48b82b9a6f..eafc98e45f 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -54,7 +54,7 @@ namespace Wrapper CommandLineLauncher::CommandLineLauncher() : /*m_Expression(""),*/m_VExpression(), m_WatcherList(), m_ReportProgress(true), m_MaxKeySize(0) { - m_Application = NULL; + m_Application = ITK_NULLPTR; m_Parser = CommandLineParser::New(); m_LogOutput = itk::StdStreamLogOutput::New(); m_LogOutput->SetStream(std::cout); @@ -67,7 +67,7 @@ CommandLineLauncher::CommandLineLauncher() : CommandLineLauncher::CommandLineLauncher(const char *) /*: m_Expression(exp)*/ { - m_Application = NULL; + m_Application = ITK_NULLPTR; m_Parser = CommandLineParser::New(); } @@ -81,7 +81,7 @@ void CommandLineLauncher::DeleteWatcherList() for (unsigned int i = 0; i < m_WatcherList.size(); i++) { delete m_WatcherList[i]; - m_WatcherList[i] = NULL; + m_WatcherList[i] = ITK_NULLPTR; } m_WatcherList.clear(); } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetChoiceParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetChoiceParameter.cxx index e9761c669c..30ceffaf07 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetChoiceParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetChoiceParameter.cxx @@ -29,10 +29,10 @@ QtWidgetChoiceParameter::QtWidgetChoiceParameter( ChoiceParameter* param, QtWidgetModel* m ) : QtWidgetParameterBase(param, m), m_ChoiceParam(param), - m_ComboBox( NULL ), - m_StackWidget( NULL ), - m_VLayout( NULL ), - m_VLayoutGroup( NULL ), + m_ComboBox( ITK_NULLPTR ), + m_StackWidget( ITK_NULLPTR ), + m_VLayout( ITK_NULLPTR ), + m_VLayoutGroup( ITK_NULLPTR ), m_WidgetList() { } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputFilenameParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputFilenameParameter.cxx index d7d486b7a9..596adee725 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputFilenameParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputFilenameParameter.cxx @@ -26,9 +26,9 @@ namespace Wrapper QtWidgetInputFilenameParameter::QtWidgetInputFilenameParameter(InputFilenameParameter* param, QtWidgetModel* m) : QtWidgetParameterBase(param, m), m_FilenameParam(param), - m_HLayout( NULL ), - m_Input( NULL ), - m_Button( NULL ) + m_HLayout( ITK_NULLPTR ), + m_Input( ITK_NULLPTR ), + m_Button( ITK_NULLPTR ) { } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx index f3d52f9516..2ffc527bea 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx @@ -26,9 +26,9 @@ namespace Wrapper QtWidgetInputImageParameter::QtWidgetInputImageParameter(InputImageParameter* param, QtWidgetModel* m) : QtWidgetParameterBase(param, m), m_InputImageParam(param), - m_HLayout( NULL ), - m_Input( NULL ), - m_Button( NULL ) + m_HLayout( ITK_NULLPTR ), + m_Input( ITK_NULLPTR ), + m_Button( ITK_NULLPTR ) { } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputVectorDataParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputVectorDataParameter.cxx index 1fb3033ee7..a227ec5997 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputVectorDataParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputVectorDataParameter.cxx @@ -25,9 +25,9 @@ namespace Wrapper QtWidgetInputVectorDataParameter::QtWidgetInputVectorDataParameter(InputVectorDataParameter* param, QtWidgetModel* m) : QtWidgetParameterBase(param, m), m_InputVectorDataParam(param), - m_HLayout( NULL ), - m_Input( NULL ), - m_Button( NULL ) + m_HLayout( ITK_NULLPTR ), + m_Input( ITK_NULLPTR ), + m_Button( ITK_NULLPTR ) { } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx index 4fa6519fc8..c1b2dac7be 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx @@ -58,12 +58,12 @@ public: static bool CanCreate( Parameter* param ) { - return dynamic_cast<TParameterType *>(param) != 0; + return dynamic_cast<TParameterType *>(param) != ITK_NULLPTR; } static QtWidgetParameterBase* Create( Parameter* param, QtWidgetModel* model ) { - QtWidgetParameterBase* widget = 0; + QtWidgetParameterBase* widget = ITK_NULLPTR; TParameterType* specificParam = dynamic_cast<TParameterType *>(param); if (specificParam) @@ -85,7 +85,7 @@ QtWidgetParameterFactory::~QtWidgetParameterFactory() QtWidgetParameterBase* QtWidgetParameterFactory::CreateQtWidget( Parameter* param, QtWidgetModel* model ) { - QtWidgetParameterBase* widget = 0; + QtWidgetParameterBase* widget = ITK_NULLPTR; #define CREATEWIDGET( ParameterType, WidgetType ) \ else if ( QtWidgetParameterGenericFactory<ParameterType, WidgetType>::CanCreate(param) ) \ diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx index d6a20a385b..2f1ae5aa5b 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx @@ -56,7 +56,7 @@ void QtWidgetParameterGroup::DoCreateWidget() { Parameter* param = m_ParamList->GetParameterByIndex(i); - if (param != 0) + if (param != ITK_NULLPTR) { ParameterGroup* paramAsGroup = dynamic_cast<ParameterGroup*>(param); ChoiceParameter* paramAsChoice = dynamic_cast<ChoiceParameter*>(param); @@ -64,10 +64,10 @@ void QtWidgetParameterGroup::DoCreateWidget() InputProcessXMLParameter* paramAsOutXML = dynamic_cast<InputProcessXMLParameter*>(param); bool paramIsXML = false; - if(paramAsInXML != 0 || paramAsOutXML != 0) + if(paramAsInXML != ITK_NULLPTR || paramAsOutXML != ITK_NULLPTR) paramIsXML = true; - if (paramAsGroup == 0 && paramAsChoice == 0 && !paramIsXML) + if (paramAsGroup == ITK_NULLPTR && paramAsChoice == ITK_NULLPTR && !paramIsXML) { // Label (col 1) QWidget* label = new QtWidgetParameterLabel( param ); diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetProgressReport.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetProgressReport.cxx index 67c4e4787e..8d3fa58dd3 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetProgressReport.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetProgressReport.cxx @@ -96,7 +96,7 @@ void QtWidgetProgressReport::RemoveLayout() { // Remove the children of the layout (progress bar widgets) QLayoutItem *child; - while ((child = this->layout()->takeAt(0)) != 0) + while ((child = this->layout()->takeAt(0)) != ITK_NULLPTR) { delete child->widget(); delete child; diff --git a/Modules/Wrappers/SWIG/src/itkPyCommand.cxx b/Modules/Wrappers/SWIG/src/itkPyCommand.cxx index e7b17d9f23..e3f3916d3e 100644 --- a/Modules/Wrappers/SWIG/src/itkPyCommand.cxx +++ b/Modules/Wrappers/SWIG/src/itkPyCommand.cxx @@ -21,7 +21,7 @@ namespace itk PyCommand::PyCommand() { - this->obj = NULL; + this->obj = ITK_NULLPTR; } PyCommand::~PyCommand() @@ -30,7 +30,7 @@ PyCommand::~PyCommand() { Py_DECREF(this->obj); } - this->obj = NULL; + this->obj = ITK_NULLPTR; } void PyCommand::SetCommandCallable(PyObject *theObj) @@ -87,7 +87,7 @@ void PyCommand::PyExecute() { PyObject *result; - result = PyEval_CallObject(this->obj, (PyObject *)NULL); + result = PyEval_CallObject(this->obj, (PyObject *)ITK_NULLPTR); if (result) { -- GitLab