From 1d6909a287bb73b5ec7bf51ec56f7efcf2a869eb Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Mon, 27 Jun 2016 22:44:16 +0200 Subject: use CM_NULLPTR --- Source/CPack/IFW/cmCPackIFWGenerator.cxx | 16 +- Source/CPack/IFW/cmCPackIFWInstaller.cxx | 4 +- Source/CPack/IFW/cmCPackIFWPackage.cxx | 8 +- Source/CPack/IFW/cmCPackIFWRepository.cxx | 4 +- Source/CPack/cmCPackArchiveGenerator.cxx | 6 +- Source/CPack/cmCPackComponentGroup.h | 4 +- Source/CPack/cmCPackDebGenerator.cxx | 10 +- Source/CPack/cmCPackGenerator.cxx | 22 +-- Source/CPack/cmCPackGenerator.h | 2 +- Source/CPack/cmCPackGeneratorFactory.cxx | 4 +- Source/CPack/cmCPackLog.cxx | 8 +- Source/CPack/cmCPackNSISGenerator.cxx | 14 +- Source/CPack/cmCPackRPMGenerator.cxx | 4 +- Source/CPack/cpack.cxx | 12 +- Source/CTest/cmCTestBZR.cxx | 14 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 18 +-- Source/CTest/cmCTestBuildCommand.cxx | 16 +- Source/CTest/cmCTestBuildHandler.cxx | 23 +-- Source/CTest/cmCTestCVS.cxx | 5 +- Source/CTest/cmCTestCommand.h | 4 +- Source/CTest/cmCTestConfigureCommand.cxx | 17 ++- Source/CTest/cmCTestCoverageCommand.cxx | 2 +- Source/CTest/cmCTestCoverageHandler.cxx | 10 +- Source/CTest/cmCTestCurl.cxx | 2 +- Source/CTest/cmCTestGIT.cxx | 39 +++-- Source/CTest/cmCTestGenericHandler.cxx | 4 +- Source/CTest/cmCTestHG.cxx | 11 +- Source/CTest/cmCTestHandlerCommand.cxx | 4 +- Source/CTest/cmCTestLaunch.cxx | 12 +- Source/CTest/cmCTestMemCheckHandler.cxx | 18 +-- Source/CTest/cmCTestP4.cxx | 14 +- Source/CTest/cmCTestRunTest.cxx | 6 +- Source/CTest/cmCTestSVN.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 16 +- Source/CTest/cmCTestStartCommand.cxx | 6 +- Source/CTest/cmCTestSubmitCommand.cxx | 4 +- Source/CTest/cmCTestSubmitHandler.cxx | 14 +- Source/CTest/cmCTestSubmitHandler.h | 2 +- Source/CTest/cmCTestTestCommand.cxx | 2 +- Source/CTest/cmCTestTestHandler.cxx | 15 +- Source/CTest/cmCTestUpdateCommand.cxx | 4 +- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmCTestUploadCommand.cxx | 2 +- Source/CTest/cmCTestVC.cxx | 2 +- Source/CTest/cmCTestVC.h | 8 +- Source/CTest/cmParseMumpsCoverage.cxx | 4 +- Source/CTest/cmProcess.cxx | 4 +- Source/CursesDialog/ccmake.cxx | 27 ++-- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 6 +- Source/CursesDialog/cmCursesForm.cxx | 4 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 8 +- Source/CursesDialog/cmCursesMainForm.cxx | 34 ++--- Source/CursesDialog/cmCursesMainForm.h | 2 +- Source/CursesDialog/cmCursesStringWidget.cxx | 2 +- Source/CursesDialog/cmCursesWidget.cxx | 2 +- Source/cmAddCustomCommandCommand.cxx | 2 +- Source/cmAddCustomTargetCommand.cxx | 2 +- Source/cmArchiveWrite.cxx | 7 +- Source/cmArchiveWrite.h | 4 +- Source/cmBuildCommand.cxx | 4 +- Source/cmCPluginAPI.cxx | 22 +-- Source/cmCTest.cxx | 50 +++--- Source/cmCTest.h | 8 +- Source/cmCacheManager.cxx | 10 +- Source/cmCacheManager.h | 7 +- Source/cmCommand.h | 2 +- Source/cmCommandArgumentParserHelper.cxx | 10 +- Source/cmCommandArgumentsHelper.cxx | 28 ++-- Source/cmCommandArgumentsHelper.h | 10 +- Source/cmCommonTargetGenerator.cxx | 2 +- Source/cmComputeLinkDepends.cxx | 6 +- Source/cmComputeLinkDepends.h | 2 +- Source/cmComputeLinkInformation.cxx | 18 +-- Source/cmComputeLinkInformation.h | 5 +- Source/cmComputeTargetDepends.cxx | 4 +- Source/cmConditionEvaluator.cxx | 2 +- Source/cmCoreTryCompile.cxx | 2 +- Source/cmCryptoHash.cxx | 2 +- Source/cmCurl.h | 2 +- Source/cmCustomCommand.cxx | 4 +- Source/cmCustomCommandGenerator.cxx | 2 +- Source/cmDefinitions.cxx | 2 +- Source/cmDepends.cxx | 12 +- Source/cmDepends.h | 2 +- Source/cmDependsC.cxx | 10 +- Source/cmDependsFortran.cxx | 2 +- Source/cmDependsJavaParserHelper.cxx | 10 +- Source/cmDocumentation.cxx | 16 +- Source/cmDocumentation.h | 2 +- Source/cmDynamicLoader.cxx | 4 +- Source/cmELF.cxx | 20 +-- Source/cmExecProgramCommand.cxx | 8 +- Source/cmExecProgramCommand.h | 3 +- Source/cmExecuteProcessCommand.cxx | 6 +- Source/cmExportBuildFileGenerator.cxx | 4 +- Source/cmExportCommand.cxx | 6 +- Source/cmExportTryCompileFileGenerator.cxx | 3 +- Source/cmExprParserHelper.cxx | 2 +- Source/cmExtraCodeBlocksGenerator.cxx | 14 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmExtraEclipseCDT4Generator.h | 2 +- Source/cmExtraKateGenerator.cxx | 4 +- Source/cmExtraSublimeTextGenerator.cxx | 13 +- Source/cmFLTKWrapUICommand.cxx | 4 +- Source/cmFileCommand.cxx | 32 ++-- Source/cmFindCommon.cxx | 4 +- Source/cmFindPackageCommand.cxx | 4 +- Source/cmFortranParserImpl.cxx | 5 +- Source/cmGeneratorExpression.h | 12 +- Source/cmGeneratorExpressionDAGChecker.h | 2 +- Source/cmGeneratorExpressionEvaluationFile.cxx | 16 +- Source/cmGeneratorExpressionNode.cxx | 15 +- Source/cmGeneratorTarget.cxx | 137 +++++++++-------- Source/cmGeneratorTarget.h | 6 +- Source/cmGetCMakePropertyCommand.cxx | 2 +- Source/cmGetDirectoryPropertyCommand.cxx | 2 +- Source/cmGetPropertyCommand.cxx | 4 +- Source/cmGetSourceFilePropertyCommand.cxx | 2 +- Source/cmGetTargetPropertyCommand.cxx | 2 +- Source/cmGetTestPropertyCommand.cxx | 2 +- Source/cmGlobalGenerator.cxx | 54 +++---- Source/cmGlobalGenerator.h | 16 +- Source/cmGlobalGeneratorFactory.h | 2 +- Source/cmGlobalKdevelopGenerator.cxx | 20 +-- Source/cmGlobalNinjaGenerator.cxx | 20 +-- Source/cmGlobalNinjaGenerator.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 8 +- Source/cmGraphVizWriter.cxx | 14 +- Source/cmHexFileConverter.cxx | 12 +- Source/cmIncludeCommand.cxx | 2 +- Source/cmInstallCommand.cxx | 50 +++--- Source/cmInstallCommandArguments.cxx | 22 +-- Source/cmInstallDirectoryGenerator.cxx | 4 +- Source/cmInstallExportGenerator.cxx | 9 +- Source/cmInstallFilesGenerator.cxx | 6 +- Source/cmInstallGenerator.h | 13 +- Source/cmInstallScriptGenerator.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 6 +- Source/cmInstalledFile.cxx | 2 +- Source/cmLinkItem.h | 4 +- Source/cmLinkedTree.h | 2 +- Source/cmListFileCache.cxx | 6 +- Source/cmLoadCommandCommand.cxx | 10 +- Source/cmLocalGenerator.cxx | 34 ++--- Source/cmLocalGenerator.h | 8 +- Source/cmLocalNinjaGenerator.h | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 12 +- Source/cmLocalUnixMakefileGenerator3.h | 12 +- Source/cmLocale.h | 2 +- Source/cmMakefile.cxx | 59 ++++---- Source/cmMakefile.h | 35 +++-- Source/cmMakefileExecutableTargetGenerator.cxx | 10 +- Source/cmMakefileLibraryTargetGenerator.cxx | 8 +- Source/cmMakefileTargetGenerator.cxx | 56 +++---- Source/cmMakefileUtilityTargetGenerator.cxx | 2 +- Source/cmMarkAsAdvancedCommand.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- Source/cmNinjaTargetGenerator.cxx | 8 +- Source/cmOSXBundleGenerator.cxx | 2 +- Source/cmOrderDirectories.h | 3 +- Source/cmOutputConverter.cxx | 6 +- Source/cmOutputRequiredFilesCommand.cxx | 8 +- Source/cmPolicies.cxx | 12 +- Source/cmProcessTools.cxx | 14 +- Source/cmProcessTools.h | 4 +- Source/cmProperty.cxx | 2 +- Source/cmPropertyMap.cxx | 2 +- Source/cmQTWrapCPPCommand.cxx | 2 +- Source/cmQTWrapUICommand.cxx | 4 +- Source/cmQtAutoGeneratorInitializer.cxx | 12 +- Source/cmQtAutoGenerators.cxx | 12 +- Source/cmScriptGenerator.cxx | 4 +- Source/cmSearchPath.cxx | 10 +- Source/cmSearchPath.h | 6 +- Source/cmSetCommand.cxx | 4 +- Source/cmSetPropertyCommand.cxx | 10 +- Source/cmSiteNameCommand.cxx | 3 +- Source/cmSourceFile.cxx | 8 +- Source/cmSourceFile.h | 2 +- Source/cmSourceFileLocation.cxx | 2 +- Source/cmSourceGroup.cxx | 6 +- Source/cmSourceGroup.h | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmState.cxx | 16 +- Source/cmState.h | 2 +- Source/cmSystemTools.cxx | 27 ++-- Source/cmSystemTools.h | 40 ++--- Source/cmTarget.cxx | 168 ++++++++++----------- Source/cmTarget.h | 2 +- Source/cmTargetLinkLibrariesCommand.cxx | 4 +- Source/cmTestGenerator.cxx | 4 +- Source/cmTimestamp.cxx | 6 +- Source/cmTryRunCommand.cxx | 25 +-- Source/cmUnsetCommand.cxx | 2 +- Source/cmUtilitySourceCommand.cxx | 4 +- Source/cmVariableWatch.h | 11 +- Source/cmake.cxx | 21 +-- Source/cmake.h | 3 +- Source/cmakemain.cxx | 25 +-- Source/cmcmd.cxx | 39 +++-- Source/ctest.cxx | 11 +- 201 files changed, 1143 insertions(+), 1075 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index accba08..4a5eb90 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -101,8 +101,9 @@ int cmCPackIFWGenerator::PackageFiles() int retVal = 1; cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate repository" << std::endl); - bool res = cmSystemTools::RunSingleCommand( - ifwCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, + &output, &retVal, CM_NULLPTR, + this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl @@ -178,8 +179,9 @@ int cmCPackIFWGenerator::PackageFiles() std::string output; int retVal = 1; cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate package" << std::endl); - bool res = cmSystemTools::RunSingleCommand( - ifwCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, + &output, &retVal, CM_NULLPTR, + this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl @@ -526,7 +528,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage( { std::map::const_iterator pit = GroupPackages.find(group); - return pit != GroupPackages.end() ? pit->second : 0; + return pit != GroupPackages.end() ? pit->second : CM_NULLPTR; } cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( @@ -534,7 +536,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( { std::map::const_iterator pit = ComponentPackages.find(component); - return pit != ComponentPackages.end() ? pit->second : 0; + return pit != ComponentPackages.end() ? pit->second : CM_NULLPTR; } cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( @@ -556,7 +558,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( } } else { Repositories.erase(repositoryName); - repository = 0; + repository = CM_NULLPTR; cmCPackLogger(cmCPackLog::LOG_WARNING, "Invalid repository \"" << repositoryName << "\"" << " configuration. Repository will be skipped." diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 74f6da6..13a3613 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -33,13 +33,13 @@ } while (0) cmCPackIFWInstaller::cmCPackIFWInstaller() - : Generator(0) + : Generator(CM_NULLPTR) { } const char* cmCPackIFWInstaller::GetOption(const std::string& op) const { - return Generator ? Generator->GetOption(op) : 0; + return Generator ? Generator->GetOption(op) : CM_NULLPTR; } bool cmCPackIFWInstaller::IsOn(const std::string& op) const diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 405d668..5db06e6 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -96,15 +96,15 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const //------------------------------------------------------ cmCPackIFWPackage --- cmCPackIFWPackage::cmCPackIFWPackage() - : Generator(0) - , Installer(0) + : Generator(CM_NULLPTR) + , Installer(CM_NULLPTR) { } const char* cmCPackIFWPackage::GetOption(const std::string& op) const { - const char* option = Generator ? Generator->GetOption(op) : 0; - return option && *option ? option : 0; + const char* option = Generator ? Generator->GetOption(op) : CM_NULLPTR; + return option && *option ? option : CM_NULLPTR; } bool cmCPackIFWPackage::IsOn(const std::string& op) const diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index e4fa569..ee6d5e5 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -35,7 +35,7 @@ cmCPackIFWRepository::cmCPackIFWRepository() : Update(None) - , Generator(0) + , Generator(CM_NULLPTR) { } @@ -63,7 +63,7 @@ bool cmCPackIFWRepository::IsValid() const const char* cmCPackIFWRepository::GetOption(const std::string& op) const { - return Generator ? Generator->GetOption(op) : 0; + return Generator ? Generator->GetOption(op) : CM_NULLPTR; } bool cmCPackIFWRepository::IsOn(const std::string& op) const diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index baf6719..b1f6864 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -68,7 +68,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( ++fileIt) { std::string rp = filePrefix + *fileIt; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl); - archive.Add(rp, 0, 0, false); + archive.Add(rp, 0, CM_NULLPTR, false); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " << archive.GetError() << std::endl); @@ -139,7 +139,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) for (compIt = this->Components.begin(); compIt != this->Components.end(); ++compIt) { // Does the component belong to a group? - if (compIt->second.Group == NULL) { + if (compIt->second.Group == CM_NULLPTR) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -246,7 +246,7 @@ int cmCPackArchiveGenerator::PackageFiles() // Get the relative path to the file std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); - archive.Add(rp, 0, 0, false); + archive.Add(rp, 0, CM_NULLPTR, false); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " << *fileIt << "> to archive <" << packageFileNames[0] diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index 5361d95..01a9e76 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -43,7 +43,7 @@ class cmCPackComponent { public: cmCPackComponent() - : Group(0) + : Group(CM_NULLPTR) , IsRequired(true) , IsHidden(false) , IsDisabledByDefault(false) @@ -117,7 +117,7 @@ class cmCPackComponentGroup { public: cmCPackComponentGroup() - : ParentGroup(0) + : ParentGroup(CM_NULLPTR) { } diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index b659359..3edc430 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -133,7 +133,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) for (compIt = this->Components.begin(); compIt != this->Components.end(); ++compIt) { // Does the component belong to a group? - if (compIt->second.Group == NULL) { + if (compIt->second.Group == CM_NULLPTR) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -692,7 +692,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix( // the current COMPONENT belongs to. std::string groupVar = "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; - if (NULL != GetOption(groupVar)) { + if (CM_NULLPTR != GetOption(groupVar)) { return std::string(GetOption(groupVar)); } else { return componentName; @@ -917,18 +917,18 @@ static int ar_append(const char* archive, { int eval = 0; FILE* aFile = cmSystemTools::Fopen(archive, "wb+"); - if (aFile != NULL) { + if (aFile != CM_NULLPTR) { fwrite(ARMAG, SARMAG, 1, aFile); if (fseek(aFile, 0, SEEK_END) != -1) { CF cf; struct stat sb; /* Read from disk, write to an archive; pad on write. */ - SETCF(NULL, 0, aFile, archive, WPAD); + SETCF(CM_NULLPTR, CM_NULLPTR, aFile, archive, WPAD); for (std::vector::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { const char* filename = fileIt->c_str(); FILE* file = cmSystemTools::Fopen(filename, "rb"); - if (file == NULL) { + if (file == CM_NULLPTR) { eval = -1; continue; } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index c8b075d..914d0dc 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -34,14 +34,14 @@ cmCPackGenerator::cmCPackGenerator() { this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE; - this->MakefileMap = 0; - this->Logger = 0; + this->MakefileMap = CM_NULLPTR; + this->Logger = CM_NULLPTR; this->componentPackageMethod = ONE_PACKAGE_PER_GROUP; } cmCPackGenerator::~cmCPackGenerator() { - this->MakefileMap = 0; + this->MakefileMap = CM_NULLPTR; } void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr) @@ -251,8 +251,9 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << *it << std::endl); std::string output; int retVal = 1; - bool resB = cmSystemTools::RunSingleCommand( - it->c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); + bool resB = + cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal, + CM_NULLPTR, this->GeneratorVerbose, 0); if (!resB || retVal) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/InstallOutput.log"; @@ -814,7 +815,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( } } - if (NULL != mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { + if (CM_NULLPTR != + mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { if (!absoluteDestFiles.empty()) { absoluteDestFiles += ";"; } @@ -828,7 +830,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( std::string absoluteDestFileComponent = std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" + GetComponentInstallDirNameSuffix(installComponent); - if (NULL != this->GetOption(absoluteDestFileComponent)) { + if (CM_NULLPTR != this->GetOption(absoluteDestFileComponent)) { std::string absoluteDestFilesListComponent = this->GetOption(absoluteDestFileComponent); absoluteDestFilesListComponent += ";"; @@ -1178,7 +1180,7 @@ int cmCPackGenerator::PrepareGroupingKind() std::string groupingType; // Second way to specify grouping - if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) { + if (CM_NULLPTR != this->GetOption("CPACK_COMPONENTS_GROUPING")) { groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING"); } @@ -1355,7 +1357,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( component->Group = GetComponentGroup(projectName, groupName); component->Group->Components.push_back(component); } else { - component->Group = 0; + component->Group = CM_NULLPTR; } const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); @@ -1423,7 +1425,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup( group->ParentGroup = GetComponentGroup(projectName, parentGroupName); group->ParentGroup->Subgroups.push_back(group); } else { - group->ParentGroup = 0; + group->ParentGroup = CM_NULLPTR; } } return group; diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 6313a0e..23e4bb7 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -136,7 +136,7 @@ protected: cmInstalledFile const* GetInstalledFile(std::string const& name) const; virtual const char* GetOutputExtension() { return ".cpack"; } - virtual const char* GetOutputPostfix() { return 0; } + virtual const char* GetOutputPostfix() { return CM_NULLPTR; } /** * Prepare requested grouping kind from CPACK_xxx vars diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 2210835..0f0268f 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -151,7 +151,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator( { cmCPackGenerator* gen = this->NewGeneratorInternal(name); if (!gen) { - return 0; + return CM_NULLPTR; } this->Generators.push_back(gen); gen->SetLogger(this->Logger); @@ -164,7 +164,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal( cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it = this->GeneratorCreators.find(name); if (it == this->GeneratorCreators.end()) { - return 0; + return CM_NULLPTR; } return (it->second)(); } diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index ff06eb8..339323e 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -28,13 +28,13 @@ cmCPackLog::cmCPackLog() this->DefaultOutput = &std::cout; this->DefaultError = &std::cerr; - this->LogOutput = 0; + this->LogOutput = CM_NULLPTR; this->LogOutputCleanup = false; } cmCPackLog::~cmCPackLog() { - this->SetLogOutputStream(0); + this->SetLogOutputStream(CM_NULLPTR); } void cmCPackLog::SetLogOutputStream(std::ostream* os) @@ -48,13 +48,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os) bool cmCPackLog::SetLogOutputFile(const char* fname) { - cmGeneratedFileStream* cg = 0; + cmGeneratedFileStream* cg = CM_NULLPTR; if (fname) { cg = new cmGeneratedFileStream(fname); } if (cg && !*cg) { delete cg; - cg = 0; + cg = CM_NULLPTR; } this->SetLogOutputStream(cg); if (!cg) { diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 5123edd..d8ff907 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -212,7 +212,7 @@ int cmCPackNSISGenerator::PackageFiles() std::map::iterator groupIt; for (groupIt = this->ComponentGroups.begin(); groupIt != this->ComponentGroups.end(); ++groupIt) { - if (groupIt->second.ParentGroup == 0) { + if (groupIt->second.ParentGroup == CM_NULLPTR) { componentCode += this->CreateComponentGroupDescription(&groupIt->second, macrosOut); } @@ -301,8 +301,9 @@ int cmCPackNSISGenerator::PackageFiles() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd << std::endl); std::string output; int retVal = 1; - bool res = cmSystemTools::RunSingleCommand( - nsisCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); + bool res = + cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, + CM_NULLPTR, this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << nsisCmd << std::endl @@ -326,7 +327,7 @@ int cmCPackNSISGenerator::InitializeInternal() "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. " "This option will be reset to 0 (for this generator only)." << std::endl); - this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", 0); + this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", CM_NULLPTR); } cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" @@ -399,8 +400,9 @@ int cmCPackNSISGenerator::InitializeInternal() << std::endl); std::string output; int retVal = 1; - bool resS = cmSystemTools::RunSingleCommand( - nsisCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); + bool resS = + cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, + CM_NULLPTR, this->GeneratorVerbose, 0); cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)"); cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); if (!resS || retVal || diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index bc10111..2568d17 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -121,7 +121,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) for (compIt = this->Components.begin(); compIt != this->Components.end(); ++compIt) { // Does the component belong to a group? - if (compIt->second.Group == NULL) { + if (compIt->second.Group == CM_NULLPTR) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -245,7 +245,7 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix( // the current COMPONENT belongs to. std::string groupVar = "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; - if (NULL != GetOption(groupVar)) { + if (CM_NULLPTR != GetOption(groupVar)) { return std::string(GetOption(groupVar)); } else { return componentName; diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 425afd9..b4a2c6f 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -27,13 +27,13 @@ #include static const char* cmDocumentationName[][2] = { - { 0, " cpack - Packaging driver provided by CMake." }, - { 0, 0 } + { CM_NULLPTR, " cpack - Packaging driver provided by CMake." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsage[][2] = { - { 0, " cpack -G [options]" }, - { 0, 0 } + { CM_NULLPTR, " cpack -G [options]" }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationOptions[][2] = { @@ -47,7 +47,7 @@ static const char* cmDocumentationOptions[][2] = { { "-R ", "override/define CPACK_PACKAGE_VERSION" }, { "-B ", "override/define CPACK_PACKAGE_DIRECTORY" }, { "--vendor ", "override/define CPACK_PACKAGE_VENDOR" }, - { 0, 0 } + { CM_NULLPTR, CM_NULLPTR } }; int cpackUnknownArgument(const char*, void*) @@ -200,7 +200,7 @@ int main(int argc, char const* const* argv) cmCPackGeneratorFactory generators; generators.SetLogger(&log); - cmCPackGenerator* cpackGenerator = 0; + cmCPackGenerator* cpackGenerator = CM_NULLPTR; cmDocumentation doc; doc.addCPackStandardDocSections(); diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 17d4eef..0e08e1c 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -139,13 +139,13 @@ std::string cmCTestBZR::LoadInfo() { // Run "bzr info" to get the repository info from the work tree. const char* bzr = this->CommandLineTool.c_str(); - const char* bzr_info[] = { bzr, "info", 0 }; + const char* bzr_info[] = { bzr, "info", CM_NULLPTR }; InfoParser iout(this, "info-out> "); OutputLogger ierr(this->Log, "info-err> "); this->RunChild(bzr_info, &iout, &ierr); // Run "bzr revno" to get the repository revision number from the work tree. - const char* bzr_revno[] = { bzr, "revno", 0 }; + const char* bzr_revno[] = { bzr, "revno", CM_NULLPTR }; std::string rev; RevnoParser rout(this, "revno-out> ", rev); OutputLogger rerr(this->Log, "revno-err> "); @@ -190,7 +190,8 @@ public: int res = cmXMLParser::InitializeParser(); if (res) { XML_SetUnknownEncodingHandler(static_cast(this->Parser), - cmBZRXMLParserUnknownEncodingHandler, 0); + cmBZRXMLParserUnknownEncodingHandler, + CM_NULLPTR); } return res; } @@ -380,7 +381,7 @@ bool cmCTestBZR::UpdateImpl() bzr_update.push_back(this->URL.c_str()); - bzr_update.push_back(0); + bzr_update.push_back(CM_NULLPTR); // For some reason bzr uses stderr to display the update status. OutputLogger out(this->Log, "pull-out> "); @@ -408,7 +409,8 @@ void cmCTestBZR::LoadRevisions() // Run "bzr log" to get all global revisions of interest. const char* bzr = this->CommandLineTool.c_str(); const char* bzr_log[] = { - bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), 0 + bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), + CM_NULLPTR }; { LogParser out(this, "log-out> "); @@ -465,7 +467,7 @@ void cmCTestBZR::LoadModifications() { // Run "bzr status" which reports local modifications. const char* bzr = this->CommandLineTool.c_str(); - const char* bzr_status[] = { bzr, "status", "-SV", 0 }; + const char* bzr_status[] = { bzr, "status", "-SV", CM_NULLPTR }; StatusParser out(this, "status-out> "); OutputLogger err(this->Log, "status-err> "); this->RunChild(bzr_status, &out, &err); diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 632f452..eddbddc 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -72,7 +72,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, args.push_back(toolset); } - const char* config = 0; + const char* config = CM_NULLPTR; if (!this->CTest->GetConfigType().empty()) { config = this->CTest->GetConfigType().c_str(); } @@ -158,10 +158,10 @@ public: } ~cmCTestBuildAndTestCaptureRAII() { - this->CM.SetProgressCallback(0, 0); - cmSystemTools::SetStderrCallback(0, 0); - cmSystemTools::SetStdoutCallback(0, 0); - cmSystemTools::SetMessageCallback(0, 0); + this->CM.SetProgressCallback(CM_NULLPTR, CM_NULLPTR); + cmSystemTools::SetStderrCallback(CM_NULLPTR, CM_NULLPTR); + cmSystemTools::SetStdoutCallback(CM_NULLPTR, CM_NULLPTR); + cmSystemTools::SetMessageCallback(CM_NULLPTR, CM_NULLPTR); } }; @@ -247,7 +247,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } } std::string output; - const char* config = 0; + const char* config = CM_NULLPTR; if (!this->CTest->GetConfigType().empty()) { config = this->CTest->GetConfigType().c_str(); } @@ -321,7 +321,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) { testCommand.push_back(this->TestCommandArgs[k].c_str()); } - testCommand.push_back(0); + testCommand.push_back(CM_NULLPTR); std::string outs; int retval = 0; // run the test from the this->BuildRunDir if set @@ -347,8 +347,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } } - int runTestRes = - this->CTest->RunTest(testCommand, &outs, &retval, 0, remainingTime, 0); + int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, + CM_NULLPTR, remainingTime, CM_NULLPTR); if (runTestRes != cmsysProcess_State_Exited || retval != 0) { out << "Test command failed: " << testCommand[0] << "\n"; diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 05cccbf..408a1a8 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -19,14 +19,14 @@ cmCTestBuildCommand::cmCTestBuildCommand() { - this->GlobalGenerator = 0; + this->GlobalGenerator = CM_NULLPTR; this->Arguments[ctb_NUMBER_ERRORS] = "NUMBER_ERRORS"; this->Arguments[ctb_NUMBER_WARNINGS] = "NUMBER_WARNINGS"; this->Arguments[ctb_TARGET] = "TARGET"; this->Arguments[ctb_CONFIGURATION] = "CONFIGURATION"; this->Arguments[ctb_FLAGS] = "FLAGS"; this->Arguments[ctb_PROJECT_NAME] = "PROJECT_NAME"; - this->Arguments[ctb_LAST] = 0; + this->Arguments[ctb_LAST] = CM_NULLPTR; this->Last = ctb_LAST; } @@ -34,7 +34,7 @@ cmCTestBuildCommand::~cmCTestBuildCommand() { if (this->GlobalGenerator) { delete this->GlobalGenerator; - this->GlobalGenerator = 0; + this->GlobalGenerator = CM_NULLPTR; } } @@ -43,7 +43,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() cmCTestGenericHandler* handler = this->CTest->GetInitializedHandler("build"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate build handler"); - return 0; + return CM_NULLPTR; } this->Handler = (cmCTestBuildHandler*)handler; @@ -91,7 +91,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() if (this->GlobalGenerator) { if (this->GlobalGenerator->GetName() != cmakeGeneratorName) { delete this->GlobalGenerator; - this->GlobalGenerator = 0; + this->GlobalGenerator = CM_NULLPTR; } } if (!this->GlobalGenerator) { @@ -104,11 +104,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() e += "\""; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e); cmSystemTools::SetFatalErrorOccured(); - return 0; + return CM_NULLPTR; } } if (strlen(cmakeBuildConfiguration) == 0) { - const char* config = 0; + const char* config = CM_NULLPTR; #ifdef CMAKE_INTDIR config = CMAKE_INTDIR; #endif @@ -145,7 +145,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() "with a custom command line."; /* clang-format on */ this->SetError(ostr.str()); - return 0; + return CM_NULLPTR; } } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index a4d9dee..f96ef6d 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -92,7 +92,7 @@ static const char* cmCTestErrorMatches[] = { "^The project cannot be built\\.", "^\\[ERROR\\]", "^Command .* failed with exit code", - 0 + CM_NULLPTR }; static const char* cmCTestErrorExceptions[] = { @@ -107,7 +107,7 @@ static const char* cmCTestErrorExceptions[] = { ":[ \\t]+Where:", "([^ :]+):([0-9]+): Warning", "------ Build started: .* ------", - 0 + CM_NULLPTR }; static const char* cmCTestWarningMatches[] = { @@ -132,7 +132,7 @@ static const char* cmCTestWarningMatches[] = { "cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*", "^CMake Warning.*:", "^\\[WARNING\\]", - 0 + CM_NULLPTR }; static const char* cmCTestWarningExceptions[] = { @@ -152,7 +152,7 @@ static const char* cmCTestWarningExceptions[] = { "ld32: WARNING 85: definition of dataKey in", "cc: warning 422: Unknown option \"\\+b", "_with_warning_C", - 0 + CM_NULLPTR }; struct cmCTestBuildCompileErrorWarningRex @@ -170,7 +170,7 @@ static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = { { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 }, { "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 }, - { 0, 0, 0 } + { CM_NULLPTR, 0, 0 } }; cmCTestBuildHandler::cmCTestBuildHandler() @@ -521,7 +521,7 @@ public: { } FragmentCompare() - : FTC(0) + : FTC(CM_NULLPTR) { } bool operator()(std::string const& l, std::string const& r) @@ -799,7 +799,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(0); + argv.push_back(CM_NULLPTR); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:", this->Quiet); @@ -851,7 +851,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, // For every chunk of data int res; - while ((res = cmsysProcess_WaitForData(cp, &data, &length, 0))) { + while ((res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR))) { // Replace '\0' with '\n', since '\0' does not really make sense. This is // for Visual Studio output for (int cc = 0; cc < length; ++cc) { @@ -870,8 +870,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, } } - this->ProcessBuffer(0, 0, tick, tick_len, ofs, &this->BuildProcessingQueue); - this->ProcessBuffer(0, 0, tick, tick_len, ofs, + this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs, + &this->BuildProcessingQueue); + this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs, &this->BuildProcessingErrorQueue); cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" @@ -879,7 +880,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, this->Quiet); // Properly handle output of the build command - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); int result = cmsysProcess_GetState(cp); if (result == cmsysProcess_State_Exited) { diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index df19685..37bdf9a 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -103,7 +103,7 @@ bool cmCTestCVS::UpdateImpl() ai != args.end(); ++ai) { cvs_update.push_back(ai->c_str()); } - cvs_update.push_back(0); + cvs_update.push_back(CM_NULLPTR); UpdateParser out(this, "up-out> "); UpdateParser err(this, "up-err> "); @@ -229,7 +229,8 @@ void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag, // Run "cvs log" to get revisions of this file on this branch. const char* cvs = this->CommandLineTool.c_str(); - const char* cvs_log[] = { cvs, "log", "-N", branchFlag, file.c_str(), 0 }; + const char* cvs_log[] = { cvs, "log", "-N", + branchFlag, file.c_str(), CM_NULLPTR }; LogParser out(this, "log-out> ", revisions); OutputLogger err(this->Log, "log-err> "); diff --git a/Source/CTest/cmCTestCommand.h b/Source/CTest/cmCTestCommand.h index 22a2c8e..b0c9206 100644 --- a/Source/CTest/cmCTestCommand.h +++ b/Source/CTest/cmCTestCommand.h @@ -29,8 +29,8 @@ class cmCTestCommand : public cmCommand public: cmCTestCommand() { - this->CTest = 0; - this->CTestScriptHandler = 0; + this->CTest = CM_NULLPTR; + this->CTestScriptHandler = CM_NULLPTR; } cmCTest* CTest; diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index a90f27a..a823704 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -18,7 +18,7 @@ cmCTestConfigureCommand::cmCTestConfigureCommand() { this->Arguments[ctc_OPTIONS] = "OPTIONS"; - this->Arguments[ctc_LAST] = 0; + this->Arguments[ctc_LAST] = CM_NULLPTR; this->Last = ctc_LAST; } @@ -35,7 +35,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() "Build directory not specified. Either use BUILD " "argument to CTEST_CONFIGURE command or set CTEST_BINARY_DIRECTORY " "variable"); - return 0; + return CM_NULLPTR; } const char* ctestConfigureCommand = @@ -55,7 +55,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() "Source directory not specified. Either use SOURCE " "argument to CTEST_CONFIGURE command or set CTEST_SOURCE_DIRECTORY " "variable"); - return 0; + return CM_NULLPTR; } const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; @@ -63,7 +63,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() std::ostringstream e; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; this->SetError(e.str()); - return 0; + return CM_NULLPTR; } bool multiConfig = false; @@ -90,8 +90,9 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() cmakeConfigureCommand += option; cmakeConfigureCommand += "\""; - if ((0 != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) || - (0 != strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) { + if ((CM_NULLPTR != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) || + (CM_NULLPTR != + strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) { cmakeBuildTypeInOptions = true; } } @@ -134,7 +135,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() "Configure command is not specified. If this is a " "\"built with CMake\" project, set CTEST_CMAKE_GENERATOR. If not, " "set CTEST_CONFIGURE_COMMAND."); - return 0; + return CM_NULLPTR; } } @@ -143,7 +144,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() if (!handler) { this->SetError( "internal CTest error. Cannot instantiate configure handler"); - return 0; + return CM_NULLPTR; } handler->SetQuiet(this->Quiet); return handler; diff --git a/Source/CTest/cmCTestCoverageCommand.cxx b/Source/CTest/cmCTestCoverageCommand.cxx index 223d010..86e3ce4 100644 --- a/Source/CTest/cmCTestCoverageCommand.cxx +++ b/Source/CTest/cmCTestCoverageCommand.cxx @@ -30,7 +30,7 @@ cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler() this->CTest->GetInitializedHandler("coverage")); if (!handler) { this->SetError("internal CTest error. Cannot instantiate test handler"); - return 0; + return CM_NULLPTR; } // If a LABELS option was given, select only files with the labels. diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a631db9..7102533 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -76,7 +76,7 @@ public: i != this->CommandLineStrings.end(); ++i) { args.push_back(i->c_str()); } - args.push_back(0); // null terminate + args.push_back(CM_NULLPTR); // null terminate cmsysProcess_SetCommand(this->Process, &*args.begin()); if (!this->WorkingDirectory.empty()) { cmsysProcess_SetWorkingDirectory(this->Process, @@ -101,7 +101,7 @@ public: { cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname); } - int WaitForExit(double* timeout = 0) + int WaitForExit(double* timeout = CM_NULLPTR) { this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout); return this->PipeState; @@ -1781,7 +1781,7 @@ const char* bullseyeHelp[] = { " condition evaluated true or false, respectively.", " * A k indicates a constant decision or condition.", " * The slash / means this probe is excluded from summary results. ", - 0 + CM_NULLPTR }; } @@ -1809,7 +1809,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "run covbr: " << std::endl, this->Quiet); - if (!this->RunBullseyeCommand(cont, "covbr", 0, outputFile)) { + if (!this->RunBullseyeCommand(cont, "covbr", CM_NULLPTR, outputFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." << "\n"); return -1; @@ -1882,7 +1882,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( covLogXML.StartElement("Report"); // write the bullseye header line = 0; - for (int k = 0; bullseyeHelp[k] != 0; ++k) { + for (int k = 0; bullseyeHelp[k] != CM_NULLPTR; ++k) { covLogXML.StartElement("Line"); covLogXML.Attribute("Number", line); covLogXML.Attribute("Count", -1); diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 4818324..6b8e5b5 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -147,7 +147,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback); // Be sure to set Content-Type to satisfy fussy modsecurity rules struct curl_slist* headers = - ::curl_slist_append(NULL, "Content-Type: text/xml"); + ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml"); ::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers); std::vector responseData; std::vector debugData; diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 36a781e..61dbe33 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -64,7 +64,8 @@ std::string cmCTestGIT::GetWorkingRevision() { // Run plumbing "git rev-list" to get work tree revision. const char* git = this->CommandLineTool.c_str(); - const char* git_rev_list[] = { git, "rev-list", "-n", "1", "HEAD", "--", 0 }; + const char* git_rev_list[] = { git, "rev-list", "-n", "1", + "HEAD", "--", CM_NULLPTR }; std::string rev; OneLineParser out(this, "rl-out> ", rev); OutputLogger err(this->Log, "rl-err> "); @@ -93,7 +94,7 @@ std::string cmCTestGIT::FindGitDir() // Run "git rev-parse --git-dir" to locate the real .git directory. const char* git = this->CommandLineTool.c_str(); - char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", 0 }; + char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", CM_NULLPTR }; std::string git_dir_line; OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line); OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); @@ -135,7 +136,8 @@ std::string cmCTestGIT::FindTopDir() // Run "git rev-parse --show-cdup" to locate the top of the tree. const char* git = this->CommandLineTool.c_str(); - char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", 0 }; + char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", + CM_NULLPTR }; std::string cdup; OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup); OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); @@ -169,7 +171,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() } // Sentinel argument. - git_fetch.push_back(0); + git_fetch.push_back(CM_NULLPTR); // Fetch upstream refs. OutputLogger fetch_out(this->Log, "fetch-out> "); @@ -204,7 +206,8 @@ bool cmCTestGIT::UpdateByFetchAndReset() } // Reset the local branch to point at that tracked from upstream. - char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), 0 }; + char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), + CM_NULLPTR }; OutputLogger reset_out(this->Log, "reset-out> "); OutputLogger reset_err(this->Log, "reset-err> "); return this->RunChild(&git_reset[0], &reset_out, &reset_err); @@ -219,7 +222,7 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom) i != git_custom_command.end(); ++i) { git_custom.push_back(i->c_str()); } - git_custom.push_back(0); + git_custom.push_back(CM_NULLPTR); OutputLogger custom_out(this->Log, "custom-out> "); OutputLogger custom_err(this->Log, "custom-err> "); @@ -248,7 +251,7 @@ bool cmCTestGIT::UpdateImpl() // Git < 1.6.5 did not support submodule --recursive if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) { - recursive = 0; + recursive = CM_NULLPTR; // No need to require >= 1.6.5 if there are no submodules. if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { this->Log << "Git < 1.6.5 cannot update submodules recursively\n"; @@ -257,7 +260,7 @@ bool cmCTestGIT::UpdateImpl() // Git < 1.8.1 did not support sync --recursive if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) { - sync_recursive = 0; + sync_recursive = CM_NULLPTR; // No need to require >= 1.8.1 if there are no submodules. if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n"; @@ -272,7 +275,8 @@ bool cmCTestGIT::UpdateImpl() std::string init_submodules = this->CTest->GetCTestConfiguration("GITInitSubmodules"); if (cmSystemTools::IsOn(init_submodules.c_str())) { - char const* git_submodule_init[] = { git, "submodule", "init", 0 }; + char const* git_submodule_init[] = { git, "submodule", "init", + CM_NULLPTR }; ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err, top_dir.c_str()); @@ -282,7 +286,7 @@ bool cmCTestGIT::UpdateImpl() } char const* git_submodule_sync[] = { git, "submodule", "sync", - sync_recursive, 0 }; + sync_recursive, CM_NULLPTR }; ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err, top_dir.c_str()); @@ -290,7 +294,8 @@ bool cmCTestGIT::UpdateImpl() return false; } - char const* git_submodule[] = { git, "submodule", "update", recursive, 0 }; + char const* git_submodule[] = { git, "submodule", "update", recursive, + CM_NULLPTR }; return this->RunChild(git_submodule, &submodule_out, &submodule_err, top_dir.c_str()); } @@ -299,7 +304,7 @@ unsigned int cmCTestGIT::GetGitVersion() { if (!this->CurrentGitVersion) { const char* git = this->CommandLineTool.c_str(); - char const* git_version[] = { git, "--version", 0 }; + char const* git_version[] = { git, "--version", CM_NULLPTR }; std::string version; OneLineParser version_out(this, "version-out> ", version); OutputLogger version_err(this->Log, "version-err> "); @@ -611,10 +616,10 @@ void cmCTestGIT::LoadRevisions() std::string range = this->OldRevision + ".." + this->NewRevision; const char* git = this->CommandLineTool.c_str(); const char* git_rev_list[] = { git, "rev-list", "--reverse", - range.c_str(), "--", 0 }; + range.c_str(), "--", CM_NULLPTR }; const char* git_diff_tree[] = { git, "diff-tree", "--stdin", "--always", "-z", - "-r", "--pretty=raw", "--encoding=utf-8", 0 + "-r", "--pretty=raw", "--encoding=utf-8", CM_NULLPTR }; this->Log << this->ComputeCommandLine(git_rev_list) << " | " << this->ComputeCommandLine(git_diff_tree) << "\n"; @@ -639,13 +644,15 @@ void cmCTestGIT::LoadModifications() const char* git = this->CommandLineTool.c_str(); // Use 'git update-index' to refresh the index w.r.t. the work tree. - const char* git_update_index[] = { git, "update-index", "--refresh", 0 }; + const char* git_update_index[] = { git, "update-index", "--refresh", + CM_NULLPTR }; OutputLogger ui_out(this->Log, "ui-out> "); OutputLogger ui_err(this->Log, "ui-err> "); this->RunChild(git_update_index, &ui_out, &ui_err); // Use 'git diff-index' to get modified files. - const char* git_diff_index[] = { git, "diff-index", "-z", "HEAD", "--", 0 }; + const char* git_diff_index[] = { git, "diff-index", "-z", + "HEAD", "--", CM_NULLPTR }; DiffParser out(this, "di-out> "); OutputLogger err(this->Log, "di-err> "); this->RunChild(git_diff_index, &out, &err); diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 18caabe..7755ee9 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -19,7 +19,7 @@ cmCTestGenericHandler::cmCTestGenericHandler() { this->HandlerVerbose = cmSystemTools::OUTPUT_NONE; - this->CTest = 0; + this->CTest = CM_NULLPTR; this->SubmitIndex = 0; this->AppendXML = false; this->Quiet = false; @@ -77,7 +77,7 @@ const char* cmCTestGenericHandler::GetOption(const std::string& op) cmCTestGenericHandler::t_StringToString::iterator remit = this->Options.find(op); if (remit == this->Options.end()) { - return 0; + return CM_NULLPTR; } return remit->second.c_str(); } diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 298804b..eb3d611 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -101,7 +101,7 @@ std::string cmCTestHG::GetWorkingRevision() { // Run plumbing "hg identify" to get work tree revision. const char* hg = this->CommandLineTool.c_str(); - const char* hg_identify[] = { hg, "identify", "-i", 0 }; + const char* hg_identify[] = { hg, "identify", "-i", CM_NULLPTR }; std::string rev; IdentifyParser out(this, "rev-out> ", rev); OutputLogger err(this->Log, "rev-err> "); @@ -129,7 +129,7 @@ bool cmCTestHG::UpdateImpl() // Use "hg pull" followed by "hg update" to update the working tree. { const char* hg = this->CommandLineTool.c_str(); - const char* hg_pull[] = { hg, "pull", "-v", 0 }; + const char* hg_pull[] = { hg, "pull", "-v", CM_NULLPTR }; OutputLogger out(this->Log, "pull-out> "); OutputLogger err(this->Log, "pull-err> "); this->RunChild(&hg_pull[0], &out, &err); @@ -154,7 +154,7 @@ bool cmCTestHG::UpdateImpl() } // Sentinel argument. - hg_update.push_back(0); + hg_update.push_back(CM_NULLPTR); OutputLogger out(this->Log, "update-out> "); OutputLogger err(this->Log, "update-err> "); @@ -288,7 +288,8 @@ void cmCTestHG::LoadRevisions() " {file_dels}\n" "\n"; const char* hg_log[] = { - hg, "log", "--removed", "-r", range.c_str(), "--template", hgXMLTemplate, 0 + hg, "log", "--removed", "-r", range.c_str(), + "--template", hgXMLTemplate, CM_NULLPTR }; LogParser out(this, "log-out> "); @@ -303,7 +304,7 @@ void cmCTestHG::LoadModifications() { // Use 'hg status' to get modified files. const char* hg = this->CommandLineTool.c_str(); - const char* hg_status[] = { hg, "status", 0 }; + const char* hg_status[] = { hg, "status", CM_NULLPTR }; StatusParser out(this, "status-out> "); OutputLogger err(this->Log, "status-err> "); this->RunChild(hg_status, &out, &err); diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 76f971d..e1361a1 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -20,7 +20,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand() size_t cc; this->Arguments.reserve(INIT_SIZE); for (cc = 0; cc < INIT_SIZE; ++cc) { - this->Arguments.push_back(0); + this->Arguments.push_back(CM_NULLPTR); } this->Arguments[ct_RETURN_VALUE] = "RETURN_VALUE"; this->Arguments[ct_SOURCE] = "SOURCE"; @@ -36,7 +36,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector const& args, { // Allocate space for argument values. this->Values.clear(); - this->Values.resize(this->Last, 0); + this->Values.resize(this->Last, CM_NULLPTR); // Process input arguments. this->ArgumentDoing = ArgumentDoingNone; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 99fa9e7..477f16e 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -30,7 +30,7 @@ cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) { this->Passthru = true; - this->Process = 0; + this->Process = CM_NULLPTR; this->ExitCode = 1; this->CWD = cmSystemTools::GetCurrentWorkingDirectory(); @@ -128,7 +128,7 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv) return true; } else { this->RealArgC = 0; - this->RealArgV = 0; + this->RealArgV = CM_NULLPTR; std::cerr << "No launch/command separator ('--') found!\n"; return false; } @@ -227,9 +227,9 @@ void cmCTestLaunch::RunChild() // Record child stdout and stderr if necessary. if (!this->Passthru) { - char* data = 0; + char* data = CM_NULLPTR; int length = 0; - while (int p = cmsysProcess_WaitForData(cp, &data, &length, 0)) { + while (int p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { if (p == cmsysProcess_Pipe_STDOUT) { fout.write(data, length); std::cout.write(data, length); @@ -243,7 +243,7 @@ void cmCTestLaunch::RunChild() } // Wait for the real command to finish. - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); this->ExitCode = cmsysProcess_GetExitValue(cp); } @@ -384,7 +384,7 @@ void cmCTestLaunch::WriteXMLAction(cmXMLWriter& xml) } // OutputType - const char* outputType = 0; + const char* outputType = CM_NULLPTR; if (!this->OptionTargetType.empty()) { if (this->OptionTargetType == "EXECUTABLE") { outputType = "executable"; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 6f1a2c4..dfa8a1a 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -42,7 +42,7 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = { { "Allocation Conflict", cmCTestMemCheckHandler::FMM }, { "Bad Pointer Use", cmCTestMemCheckHandler::FMW }, { "Dangling Pointer", cmCTestMemCheckHandler::FMR }, - { 0, 0 } + { CM_NULLPTR, 0 } }; static void xmlReportError(int line, const char* msg, void* data) @@ -72,7 +72,7 @@ public: std::ostringstream ostr; ostr << name << ":\n"; int i = 0; - for (; atts[i] != 0; i += 2) { + for (; atts[i] != CM_NULLPTR; i += 2) { ostr << " " << atts[i] << " - " << atts[i + 1] << "\n"; } ostr << "\n"; @@ -83,12 +83,12 @@ public: const char* GetAttribute(const char* name, const char** atts) { int i = 0; - for (; atts[i] != 0; ++i) { + for (; atts[i] != CM_NULLPTR; ++i) { if (strcmp(name, atts[i]) == 0) { return atts[i + 1]; } } - return 0; + return CM_NULLPTR; } void ParseError(const char** atts) { @@ -241,9 +241,9 @@ void cmCTestMemCheckHandler::InitializeResultsVectors() // define the standard set of errors //---------------------------------------------------------------------- static const char* cmCTestMemCheckResultStrings[] = { - "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM", - "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK", - "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", 0 + "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM", + "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK", + "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", CM_NULLPTR }; static const char* cmCTestMemCheckResultLongStrings[] = { "Threading Problem", @@ -268,10 +268,10 @@ void cmCTestMemCheckHandler::InitializeResultsVectors() "PLK", "Uninitialized Memory Conditional", "Uninitialized Memory Read", - 0 + CM_NULLPTR }; this->GlobalResults.clear(); - for (int i = 0; cmCTestMemCheckResultStrings[i] != 0; ++i) { + for (int i = 0; cmCTestMemCheckResultStrings[i] != CM_NULLPTR; ++i) { this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]); this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]); this->GlobalResults.push_back(0); diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 072da29..d4a32f1 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -163,7 +163,7 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username) p4_users.push_back("-m"); p4_users.push_back("1"); p4_users.push_back(username.c_str()); - p4_users.push_back(0); + p4_users.push_back(CM_NULLPTR); UserParser out(this, "users-out> "); OutputLogger err(this->Log, "users-err> "); @@ -358,7 +358,7 @@ std::string cmCTestP4::GetWorkingRevision() std::string source = this->SourceDirectory + "/...#have"; p4_identify.push_back(source.c_str()); - p4_identify.push_back(0); + p4_identify.push_back(CM_NULLPTR); std::string rev; IdentifyParser out(this, "p4_changes-out> ", rev); @@ -418,7 +418,7 @@ void cmCTestP4::LoadRevisions() p4_changes.push_back("changes"); p4_changes.push_back(range.c_str()); - p4_changes.push_back(0); + p4_changes.push_back(CM_NULLPTR); ChangesParser out(this, "p4_changes-out> "); OutputLogger err(this->Log, "p4_changes-err> "); @@ -438,7 +438,7 @@ void cmCTestP4::LoadRevisions() p4_describe.push_back("describe"); p4_describe.push_back("-s"); p4_describe.push_back(i->c_str()); - p4_describe.push_back(0); + p4_describe.push_back(CM_NULLPTR); DescribeParser outDescribe(this, "p4_describe-out> "); OutputLogger errDescribe(this->Log, "p4_describe-err> "); @@ -457,7 +457,7 @@ void cmCTestP4::LoadModifications() p4_diff.push_back("-dn"); std::string source = this->SourceDirectory + "/..."; p4_diff.push_back(source.c_str()); - p4_diff.push_back(0); + p4_diff.push_back(CM_NULLPTR); DiffParser out(this, "p4_diff-out> "); OutputLogger err(this->Log, "p4_diff-err> "); @@ -474,7 +474,7 @@ bool cmCTestP4::UpdateCustom(const std::string& custom) i != p4_custom_command.end(); ++i) { p4_custom.push_back(i->c_str()); } - p4_custom.push_back(0); + p4_custom.push_back(CM_NULLPTR); OutputLogger custom_out(this->Log, "p4_customsync-out> "); OutputLogger custom_err(this->Log, "p4_customsync-err> "); @@ -525,7 +525,7 @@ bool cmCTestP4::UpdateImpl() } p4_sync.push_back(source.c_str()); - p4_sync.push_back(0); + p4_sync.push_back(CM_NULLPTR); OutputLogger out(this->Log, "p4_sync-out> "); OutputLogger err(this->Log, "p4_sync-err> "); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 48582c9..9e3802a 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -24,12 +24,12 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler) { this->CTest = handler->CTest; this->TestHandler = handler; - this->TestProcess = 0; + this->TestProcess = CM_NULLPTR; this->TestResult.ExecutionTime = 0; this->TestResult.ReturnValue = 0; this->TestResult.Status = cmCTestTestHandler::NOT_RUN; this->TestResult.TestCount = 0; - this->TestResult.Properties = 0; + this->TestResult.Properties = CM_NULLPTR; this->ProcessOutput = ""; this->CompressedOutput = ""; this->CompressionRatio = 2; @@ -577,7 +577,7 @@ double cmCTestRunTest::ResolveTimeout() return timeout; } struct tm* lctime; - time_t current_time = time(0); + time_t current_time = time(CM_NULLPTR); lctime = gmtime(¤t_time); int gm_hour = lctime->tm_hour; time_t gm_time = mktime(lctime); diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index e4b6e25..eae0c6c 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -291,7 +291,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector const& parameters, args.push_back(i->c_str()); } - args.push_back(0); + args.push_back(CM_NULLPTR); if (strcmp(parameters[0], "update") == 0) { return RunUpdateCommand(&args[0], out, err); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 44b6b93..b747c64 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -82,9 +82,9 @@ cmCTestScriptHandler::cmCTestScriptHandler() this->Backup = false; this->EmptyBinDir = false; this->EmptyBinDirOnce = false; - this->Makefile = 0; - this->CMake = 0; - this->GlobalGenerator = 0; + this->Makefile = CM_NULLPTR; + this->CMake = CM_NULLPTR; + this->GlobalGenerator = CM_NULLPTR; this->ScriptStartTime = 0; @@ -121,10 +121,10 @@ void cmCTestScriptHandler::Initialize() this->ScriptStartTime = 0; delete this->Makefile; - this->Makefile = 0; + this->Makefile = CM_NULLPTR; delete this->GlobalGenerator; - this->GlobalGenerator = 0; + this->GlobalGenerator = CM_NULLPTR; delete this->CMake; } @@ -200,7 +200,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) for (size_t i = 1; i < initArgs.size(); ++i) { argv.push_back(initArgs[i].c_str()); } - argv.push_back(0); + argv.push_back(CM_NULLPTR); // Now create process object cmsysProcess* cp = cmsysProcess_New(); @@ -226,7 +226,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) } // Properly handle output of the build command - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); int result = cmsysProcess_GetState(cp); int retVal = 0; bool failed = false; @@ -863,7 +863,7 @@ bool cmCTestScriptHandler::WriteInitialCache(const char* directory, return false; } - if (text != 0) { + if (text != CM_NULLPTR) { fout.write(text, strlen(text)); } diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 99d431a..c64d16b 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -32,12 +32,12 @@ bool cmCTestStartCommand::InitialPass(std::vector const& args, size_t cnt = 0; const char* smodel = args[cnt].c_str(); - const char* src_dir = 0; - const char* bld_dir = 0; + const char* src_dir = CM_NULLPTR; + const char* bld_dir = CM_NULLPTR; cnt++; - this->CTest->SetSpecificTrack(0); + this->CTest->SetSpecificTrack(CM_NULLPTR); if (cnt < args.size() - 1) { if (args[cnt] == "TRACK") { cnt++; diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 664552a..54da383 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -88,7 +88,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() extraFiles.end()); if (!this->CTest->SubmitExtraFiles(newExtraFiles)) { this->SetError("problem submitting extra files."); - return 0; + return CM_NULLPTR; } } @@ -96,7 +96,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() this->CTest->GetInitializedHandler("submit"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate submit handler"); - return 0; + return CM_NULLPTR; } // If no FILES or PARTS given, *all* PARTS are submitted by default. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3aacde0..67388ad 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -150,7 +150,7 @@ void cmCTestSubmitHandler::Initialize() this->HTTPProxyAuth = ""; this->FTPProxy = ""; this->FTPProxyType = 0; - this->LogFile = 0; + this->LogFile = CM_NULLPTR; this->Files.clear(); } @@ -308,7 +308,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, FILE* ftpfile; char error_buffer[1024]; struct curl_slist* headers = - ::curl_slist_append(NULL, "Content-Type: text/xml"); + ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml"); /* In windows, this will init the winsock stuff */ ::curl_global_init(CURL_GLOBAL_ALL); @@ -507,10 +507,10 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, // If curl failed for any reason, or checksum fails, wait and retry // if (res != CURLE_OK || this->HasErrors) { - std::string retryDelay = this->GetOption("RetryDelay") == NULL + std::string retryDelay = this->GetOption("RetryDelay") == CM_NULLPTR ? "" : this->GetOption("RetryDelay"); - std::string retryCount = this->GetOption("RetryCount") == NULL + std::string retryCount = this->GetOption("RetryCount") == CM_NULLPTR ? "" : this->GetOption("RetryCount"); @@ -776,7 +776,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, argv.push_back(scp_command.c_str()); // Scp command argv.push_back(scp_command.c_str()); // Dummy string for file argv.push_back(scp_command.c_str()); // Dummy string for remote url - argv.push_back(0); + argv.push_back(CM_NULLPTR); cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); @@ -807,12 +807,12 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, char* data; int length; - while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { + while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(data, length), this->Quiet); } - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); int result = cmsysProcess_GetState(cp); diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index c2c9a85..4cca6eb 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -26,7 +26,7 @@ public: cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler); cmCTestSubmitHandler(); - ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = 0; } + ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = CM_NULLPTR; } /* * The main entry point for this class diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 7b437c6..1d064db 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -27,7 +27,7 @@ cmCTestTestCommand::cmCTestTestCommand() this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM"; this->Arguments[ctt_STOP_TIME] = "STOP_TIME"; this->Arguments[ctt_TEST_LOAD] = "TEST_LOAD"; - this->Arguments[ctt_LAST] = 0; + this->Arguments[ctt_LAST] = CM_NULLPTR; this->Last = ctt_LAST; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 3ee9c5f..1b6b442 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -336,7 +336,7 @@ cmCTestTestHandler::cmCTestTestHandler() this->MemCheck = false; - this->LogFile = 0; + this->LogFile = CM_NULLPTR; // regex to detect ... this->DartStuff.compile("()"); @@ -550,7 +550,7 @@ int cmCTestTestHandler::ProcessHandler() cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return 1; } cmXMLWriter xml(xmlfile); @@ -558,15 +558,15 @@ int cmCTestTestHandler::ProcessHandler() } if (!this->PostProcessHandler()) { - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return -1; } if (!failed.empty()) { - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return -1; } - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return 0; } @@ -936,7 +936,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector& passed, bool randomSchedule = this->CTest->GetScheduleType() == "Random"; if (randomSchedule) { - srand((unsigned)time(0)); + srand((unsigned)time(CM_NULLPTR)); } for (ListOfTests::iterator it = this->TestList.begin(); @@ -1154,7 +1154,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector& vec) int retVal = 0; cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it << std::endl, this->Quiet); - if (!cmSystemTools::RunSingleCommand(it->c_str(), 0, 0, &retVal, 0, + if (!cmSystemTools::RunSingleCommand(it->c_str(), CM_NULLPTR, CM_NULLPTR, + &retVal, CM_NULLPTR, cmSystemTools::OUTPUT_MERGE /*this->Verbose*/) || retVal != 0) { diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index f1bae5d..bc06da6 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -83,12 +83,12 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() this->CTest->GetInitializedHandler("update"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate update handler"); - return 0; + return CM_NULLPTR; } handler->SetCommand(this); if (source_dir.empty()) { this->SetError("source directory not specified. Please use SOURCE tag"); - return 0; + return CM_NULLPTR; } handler->SetOption("SourceDirectory", source_dir.c_str()); handler->SetQuiet(this->Quiet); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 4eaa16b..8131c90 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -334,7 +334,7 @@ bool cmCTestUpdateHandler::SelectVCS() // If no update command was specified, lookup one for this VCS tool. if (this->UpdateCommand.empty()) { - const char* key = 0; + const char* key = CM_NULLPTR; switch (this->UpdateType) { case e_CVS: key = "CVSCommand"; diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index c85db02..7393d21 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -21,7 +21,7 @@ cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler() this->CTest->GetInitializedHandler("upload"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate upload handler"); - return 0; + return CM_NULLPTR; } static_cast(handler)->SetFiles(this->Files); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index e9934e5..3376588 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -65,7 +65,7 @@ bool cmCTestVC::InitialCheckout(const char* command) ai != args.end(); ++ai) { vc_co.push_back(ai->c_str()); } - vc_co.push_back(0); + vc_co.push_back(CM_NULLPTR); // Run the initial checkout command and log its output. this->Log << "--- Begin Initial Checkout ---\n"; diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h index 4ae38eb..eb85a236 100644 --- a/Source/CTest/cmCTestVC.h +++ b/Source/CTest/cmCTestVC.h @@ -104,8 +104,8 @@ protected: Revision const* PriorRev; File() : Status(PathUpdated) - , Rev(0) - , PriorRev(0) + , Rev(CM_NULLPTR) + , PriorRev(CM_NULLPTR) { } File(PathStatus status, Revision const* rev, Revision const* priorRev) @@ -121,11 +121,11 @@ protected: /** Run a command line and send output to given parsers. */ bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err, - const char* workDir = 0); + const char* workDir = CM_NULLPTR); /** Run VC update command line and send output to given parsers. */ bool RunUpdateCommand(char const* const* cmd, OutputParser* out, - OutputParser* err = 0); + OutputParser* err = CM_NULLPTR); /** Write xml element for one file. */ void WriteXMLEntry(cmXMLWriter& xml, std::string const& path, diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index e5dd74a..d786d79 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -130,8 +130,8 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, return true; } else { // try some alternate names - const char* tryname[] = { "GUX", "GTM", "ONT", 0 }; - for (int k = 0; tryname[k] != 0; k++) { + const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR }; + for (int k = 0; tryname[k] != CM_NULLPTR; k++) { std::string routine2 = routine + tryname[k]; i = this->RoutineToDirectory.find(routine2); if (i != this->RoutineToDirectory.end()) { diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index db5151c..92fe642 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -16,7 +16,7 @@ cmProcess::cmProcess() { - this->Process = 0; + this->Process = CM_NULLPTR; this->Timeout = 0; this->TotalTime = 0; this->ExitValue = 0; @@ -52,7 +52,7 @@ bool cmProcess::StartProcess() i != this->Arguments.end(); ++i) { this->ProcessArgs.push_back(i->c_str()); } - this->ProcessArgs.push_back(0); // null terminate the list + this->ProcessArgs.push_back(CM_NULLPTR); // null terminate the list this->Process = cmsysProcess_New(); cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin()); if (!this->WorkingDirectory.empty()) { diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index be8751c..606c954 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -24,29 +24,30 @@ #include static const char* cmDocumentationName[][2] = { - { 0, " ccmake - Curses Interface for CMake." }, - { 0, 0 } + { CM_NULLPTR, " ccmake - Curses Interface for CMake." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsage[][2] = { - { 0, " ccmake \n" - " ccmake " }, - { 0, "Specify a source directory to (re-)generate a build system for " - "it in the current working directory. Specify an existing build " - "directory to re-generate its build system." }, - { 0, 0 } + { CM_NULLPTR, " ccmake \n" + " ccmake " }, + { CM_NULLPTR, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsageNote[][2] = { - { 0, "Run 'ccmake --help' for more information." }, - { 0, 0 } + { CM_NULLPTR, "Run 'ccmake --help' for more information." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationOptions[] [2] = { CMAKE_STANDARD_OPTIONS_TABLE, - { 0, 0 } }; + { CM_NULLPTR, CM_NULLPTR } }; -cmCursesForm* cmCursesForm::CurrentForm = 0; +cmCursesForm* cmCursesForm::CurrentForm = CM_NULLPTR; extern "C" { @@ -176,7 +177,7 @@ int main(int argc, char const* const* argv) touchwin(stdscr); endwin(); delete cmCursesForm::CurrentForm; - cmCursesForm::CurrentForm = 0; + cmCursesForm::CurrentForm = CM_NULLPTR; std::cout << std::endl << std::endl; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index bdfc8e9..ea12756 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -32,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( { this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); - this->Entry = 0; + this->Entry = CM_NULLPTR; this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); } @@ -50,7 +50,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); } - this->Entry = 0; + this->Entry = CM_NULLPTR; const char* value = cm->GetState()->GetCacheEntryValue(key); assert(value); switch (cm->GetState()->GetCacheEntryType(key)) { @@ -111,6 +111,6 @@ const char* cmCursesCacheEntryComposite::GetValue() if (this->Label) { return this->Label->GetValue(); } else { - return 0; + return CM_NULLPTR; } } diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx index aa4710f..b3320c9 100644 --- a/Source/CursesDialog/cmCursesForm.cxx +++ b/Source/CursesDialog/cmCursesForm.cxx @@ -16,7 +16,7 @@ bool cmCursesForm::Debug = false; cmCursesForm::cmCursesForm() { - this->Form = 0; + this->Form = CM_NULLPTR; } cmCursesForm::~cmCursesForm() @@ -24,7 +24,7 @@ cmCursesForm::~cmCursesForm() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = 0; + this->Form = CM_NULLPTR; } } diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index d03d330..48cc42c 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -32,8 +32,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm( this->Messages += "\n\n"; } this->Title = title; - this->Fields[0] = 0; - this->Fields[1] = 0; + this->Fields[0] = CM_NULLPTR; + this->Fields[1] = CM_NULLPTR; } cmCursesLongMessageForm::~cmCursesLongMessageForm() @@ -110,7 +110,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int) if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = 0; + this->Form = CM_NULLPTR; } const char* msg = this->Messages.c_str(); @@ -119,7 +119,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int) if (this->Fields[0]) { free_field(this->Fields[0]); - this->Fields[0] = 0; + this->Fields[0] = CM_NULLPTR; } this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index b740eb0..9ae38d6 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -36,8 +36,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector const& args, , InitialWidth(initWidth) { this->NumberOfPages = 0; - this->Fields = 0; - this->Entries = 0; + this->Fields = CM_NULLPTR; + this->Entries = CM_NULLPTR; this->AdvancedMode = false; this->NumberOfVisibleEntries = 0; this->OkToGenerate = false; @@ -64,7 +64,7 @@ cmCursesMainForm::~cmCursesMainForm() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = 0; + this->Form = CM_NULLPTR; } delete[] this->Fields; @@ -75,7 +75,7 @@ cmCursesMainForm::~cmCursesMainForm() delete this->Entries; if (this->CMakeInstance) { delete this->CMakeInstance; - this->CMakeInstance = 0; + this->CMakeInstance = CM_NULLPTR; } } @@ -185,7 +185,7 @@ void cmCursesMainForm::RePost() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = 0; + this->Form = CM_NULLPTR; } delete[] this->Fields; if (this->AdvancedMode) { @@ -215,7 +215,7 @@ void cmCursesMainForm::RePost() this->Fields = new FIELD*[3 * this->NumberOfVisibleEntries + 1]; size_t cc; for (cc = 0; cc < 3 * this->NumberOfVisibleEntries + 1; cc++) { - this->Fields[cc] = 0; + this->Fields[cc] = CM_NULLPTR; } // Assign fields @@ -244,7 +244,7 @@ void cmCursesMainForm::RePost() this->NumberOfVisibleEntries = 1; } // Has to be null terminated. - this->Fields[3 * this->NumberOfVisibleEntries] = 0; + this->Fields[3 * this->NumberOfVisibleEntries] = CM_NULLPTR; } void cmCursesMainForm::Render(int left, int top, int width, int height) @@ -263,7 +263,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) // Delete the previous form unpost_form(this->Form); free_form(this->Form); - this->Form = 0; + this->Form = CM_NULLPTR; } // Wrong window size @@ -345,7 +345,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) } // Give the current widget (if it exists), a chance to print keys - cmCursesWidget* cw = 0; + cmCursesWidget* cw = CM_NULLPTR; if (this->Form) { FIELD* currentField = current_field(this->Form); cw = reinterpret_cast(field_userptr(currentField)); @@ -434,7 +434,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the key of the current entry FIELD* cur = current_field(this->Form); int findex = field_index(cur); - cmCursesWidget* lbl = 0; + cmCursesWidget* lbl = CM_NULLPTR; if (findex >= 0) { lbl = reinterpret_cast( field_userptr(this->Fields[findex - 2])); @@ -566,7 +566,7 @@ int cmCursesMainForm::Configure(int noconfigure) this->FillCacheManagerFromUI(); this->CMakeInstance->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); - this->LoadCache(0); + this->LoadCache(CM_NULLPTR); // Get rid of previous errors this->Errors = std::vector(); @@ -583,7 +583,7 @@ int cmCursesMainForm::Configure(int noconfigure) } else { retVal = this->CMakeInstance->Configure(); } - this->CMakeInstance->SetProgressCallback(0, 0); + this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR); keypad(stdscr, TRUE); /* Use key symbols as KEY_DOWN*/ @@ -638,7 +638,7 @@ int cmCursesMainForm::Generate() // run the generate process int retVal = this->CMakeInstance->Generate(); - this->CMakeInstance->SetProgressCallback(0, 0); + this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR); keypad(stdscr, TRUE); /* Use key symbols as KEY_DOWN*/ @@ -888,7 +888,7 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast( field_userptr(this->Fields[findex - 2])); const char* curField = lbl->GetValue(); - const char* helpString = 0; + const char* helpString = CM_NULLPTR; const char* existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(curField); @@ -973,7 +973,7 @@ void cmCursesMainForm::HandleInput() // (findex always corresponds to the value field) FIELD* nextCur; if (findex == 2) { - nextCur = 0; + nextCur = CM_NULLPTR; } else if (findex == 3 * this->NumberOfVisibleEntries - 1) { nextCur = this->Fields[findex - 5]; } else { @@ -1003,7 +1003,7 @@ void cmCursesMainForm::HandleInput() if (nextCur) { // make the next or prev. current field after deletion - nextCur = 0; + nextCur = CM_NULLPTR; std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { @@ -1052,7 +1052,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) int findex = start_index; for (;;) { if (!str.empty()) { - cmCursesWidget* lbl = 0; + cmCursesWidget* lbl = CM_NULLPTR; if (findex >= 0) { lbl = reinterpret_cast( field_userptr(this->Fields[findex - 2])); diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index a8e99b6..d17ee33 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -67,7 +67,7 @@ public: * exception is during a resize. The optional argument specifies the * string to be displayed in the status bar. */ - void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(0); } + void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(CM_NULLPTR); } virtual void UpdateStatusBar(const char* message); /** diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index 3707d0d..6eb5310 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -72,7 +72,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, return false; } - this->OriginalString = 0; + this->OriginalString = CM_NULLPTR; this->Done = false; char debugMessage[128]; diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx index 100ed1d..49f2795 100644 --- a/Source/CursesDialog/cmCursesWidget.cxx +++ b/Source/CursesDialog/cmCursesWidget.cxx @@ -23,7 +23,7 @@ cmCursesWidget::~cmCursesWidget() { if (this->Field) { free_field(this->Field); - this->Field = 0; + this->Field = CM_NULLPTR; } } diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index d8fd1d8..400be77 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -30,7 +30,7 @@ bool cmAddCustomCommandCommand::InitialPass( std::string source, target, main_dependency, working; std::string comment_buffer; - const char* comment = 0; + const char* comment = CM_NULLPTR; std::vector depends, outputs, output, byproducts; bool verbatim = false; bool append = false; diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index ac08cb2..9dc7c59 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -47,7 +47,7 @@ bool cmAddCustomTargetCommand::InitialPass( bool verbatim = false; bool uses_terminal = false; std::string comment_buffer; - const char* comment = 0; + const char* comment = CM_NULLPTR; std::vector sources; // Keep track of parser state. diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 235cf88..ceb7d31 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -151,9 +151,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, } if (archive_write_open( - this->Archive, this, 0, + this->Archive, this, CM_NULLPTR, reinterpret_cast(&Callback::Write), - 0) != ARCHIVE_OK) { + CM_NULLPTR) != ARCHIVE_OK) { this->Error = "archive_write_open: "; this->Error += cm_archive_error_string(this->Archive); return; @@ -229,7 +229,8 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) Entry e; cm_archive_entry_copy_sourcepath(e, file); cm_archive_entry_copy_pathname(e, dest); - if (archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK) { + if (archive_read_disk_entry_from_file(this->Disk, e, -1, CM_NULLPTR) != + ARCHIVE_OK) { this->Error = "archive_read_disk_entry_from_file '"; this->Error += file; this->Error += "': "; diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 72d8f3a..f847d09 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -72,13 +72,13 @@ public: * skip. The remaining part of the input path is appended to the * "prefix" value to construct the final name in the archive. */ - bool Add(std::string path, size_t skip = 0, const char* prefix = 0, + bool Add(std::string path, size_t skip = 0, const char* prefix = CM_NULLPTR, bool recursive = true); /** Returns true if there has been no error. */ operator safe_bool() const { - return this->Okay() ? &cmArchiveWrite::safe_bool_true : 0; + return this->Okay() ? &cmArchiveWrite::safe_bool_true : CM_NULLPTR; } /** Returns true if there has been an error. */ diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 586e8a8..fb143a2 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -36,8 +36,8 @@ bool cmBuildCommand::MainSignature(std::vector const& args) const char* variable = args[0].c_str(); // Parse remaining arguments. - const char* configuration = 0; - const char* project_name = 0; + const char* configuration = CM_NULLPTR; + const char* project_name = CM_NULLPTR; std::string target; enum Doing { diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index a78300c..f97791a 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -218,8 +218,8 @@ void CCONV cmAddUtilityCommand(void* arg, const char* utilityName, } // Pass the call to the makefile instance. - mf->AddUtilityCommand(utilityName, (all ? false : true), 0, depends2, - commandLines); + mf->AddUtilityCommand(utilityName, (all ? false : true), CM_NULLPTR, + depends2, commandLines); } void CCONV cmAddCustomCommand(void* arg, const char* source, const char* command, int numArgs, @@ -257,7 +257,7 @@ void CCONV cmAddCustomCommand(void* arg, const char* source, } // Pass the call to the makefile instance. - const char* no_comment = 0; + const char* no_comment = CM_NULLPTR; mf->AddCustomCommandOldStyle(target, outputs2, depends2, source, commandLines, no_comment); } @@ -291,8 +291,8 @@ void CCONV cmAddCustomCommandToOutput(void* arg, const char* output, } // Pass the call to the makefile instance. - const char* no_comment = 0; - const char* no_working_dir = 0; + const char* no_comment = CM_NULLPTR; + const char* no_working_dir = CM_NULLPTR; mf->AddCustomCommandToOutput(output, depends2, main_dependency, commandLines, no_comment, no_working_dir); } @@ -333,8 +333,8 @@ void CCONV cmAddCustomCommandToTarget(void* arg, const char* target, // Pass the call to the makefile instance. std::vector no_byproducts; std::vector no_depends; - const char* no_comment = 0; - const char* no_working_dir = 0; + const char* no_comment = CM_NULLPTR; + const char* no_working_dir = CM_NULLPTR; mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines, cctype, no_comment, no_working_dir); } @@ -414,7 +414,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs, result.push_back(args[i]); } int resargc = static_cast(result.size()); - char** resargv = 0; + char** resargv = CM_NULLPTR; if (resargc) { resargv = (char**)malloc(resargc * sizeof(char*)); } @@ -453,7 +453,7 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv) struct cmCPluginAPISourceFile { cmCPluginAPISourceFile() - : RealSourceFile(0) + : RealSourceFile(CM_NULLPTR) { } cmSourceFile* RealSourceFile; @@ -525,7 +525,7 @@ void CCONV* cmGetSource(void* arg, const char* name) } return (void*)i->second; } else { - return 0; + return CM_NULLPTR; } } @@ -534,7 +534,7 @@ void* CCONV cmAddSource(void* arg, void* arg2) cmMakefile* mf = static_cast(arg); cmCPluginAPISourceFile* osf = static_cast(arg2); if (osf->FullPath.empty()) { - return 0; + return CM_NULLPTR; } // Create the real cmSourceFile instance and copy over saved information. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2e47298..3694f09 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -70,7 +70,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) { struct tm* lctime; - time_t tctime = time(0); + time_t tctime = time(CM_NULLPTR); lctime = gmtime(&tctime); char buf[1024]; // add todays year day and month to the time in str because @@ -88,7 +88,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) // As such, this time may be in the past or in the future. time_t ntime = curl_getdate(buf, &tctime); cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl); - tctime = time(0); + tctime = time(CM_NULLPTR); cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl); const int dayLength = 24 * 60 * 60; @@ -134,7 +134,7 @@ std::string cmCTest::CleanString(const std::string& str) std::string cmCTest::CurrentTime() { - time_t currenttime = time(0); + time_t currenttime = time(CM_NULLPTR); struct tm* t = localtime(¤ttime); // return ::CleanString(ctime(¤ttime)); char current_time[1024]; @@ -244,7 +244,7 @@ std::string cmCTest::DecodeURL(const std::string& in) for (const char* c = in.c_str(); *c; ++c) { if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) { char buf[3] = { *(c + 1), *(c + 2), 0 }; - out.append(1, char(strtoul(buf, 0, 16))); + out.append(1, char(strtoul(buf, CM_NULLPTR, 16))); c += 2; } else { out.append(1, *c); @@ -288,7 +288,7 @@ cmCTest::cmCTest() this->ScheduleType = ""; this->StopTime = ""; this->NextDayStopTime = false; - this->OutputLogFile = 0; + this->OutputLogFile = CM_NULLPTR; this->OutputLogFileLastTag = -1; this->SuppressUpdatingCTestConfiguration = false; this->DartVersion = 1; @@ -347,7 +347,7 @@ cmCTest::cmCTest() cmCTest::~cmCTest() { cmDeleteAll(this->TestingHandlers); - this->SetOutputLogFileName(0); + this->SetOutputLogFileName(CM_NULLPTR); } void cmCTest::SetParallelLevel(int level) @@ -515,7 +515,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) std::string tag; if (createNewTag) { - time_t tctime = time(0); + time_t tctime = time(CM_NULLPTR); if (this->TomorrowTag) { tctime += (24 * 60 * 60); } @@ -540,7 +540,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } tfin.close(); } - if (tag.empty() || (0 != command) || this->Parts[PartStart]) { + if (tag.empty() || (CM_NULLPTR != command) || this->Parts[PartStart]) { cmCTestOptionalLog( this, DEBUG, "TestModel: " << this->GetTestModelString() << std::endl, quiet); @@ -562,7 +562,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) ofs << this->GetTestModelString() << std::endl; } ofs.close(); - if (0 == command) { + if (CM_NULLPTR == command) { cmCTestOptionalLog(this, OUTPUT, "Create new tag: " << tag << " - " << this->GetTestModelString() << std::endl, @@ -860,7 +860,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if (it == this->TestingHandlers.end()) { - return 0; + return CM_NULLPTR; } it->second->Initialize(); return it->second; @@ -871,7 +871,7 @@ cmCTestGenericHandler* cmCTest::GetHandler(const char* handler) cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if (it == this->TestingHandlers.end()) { - return 0; + return CM_NULLPTR; } return it->second; } @@ -1029,7 +1029,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(0); + argv.push_back(CM_NULLPTR); output = ""; cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:"); @@ -1057,7 +1057,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents " << tick_len << " bytes of output" << std::endl << " " << std::flush); - while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { + while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { for (int cc = 0; cc < length; ++cc) { if (data[cc] == 0) { data[cc] = '\n'; @@ -1082,7 +1082,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: " << int(double(output.size()) / 1024.0) << "K" << std::endl); - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); int result = cmsysProcess_GetState(cp); @@ -1211,7 +1211,7 @@ int cmCTest::RunTest(std::vector argv, std::string* output, char* data; int length; - while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { + while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { if (output) { tempOutput.insert(tempOutput.end(), data, data + length); } @@ -1221,7 +1221,7 @@ int cmCTest::RunTest(std::vector argv, std::string* output, } } - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); if (output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); } @@ -2181,7 +2181,7 @@ int cmCTest::Run(std::vector& args, std::string* output) it->second->SetSubmitIndex(this->SubmitIndex); } std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - if (!this->Initialize(cwd.c_str(), 0)) { + if (!this->Initialize(cwd.c_str(), CM_NULLPTR)) { res = 12; cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." << std::endl); @@ -2325,7 +2325,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname) bool inBld = bldRelpath.find("..") == bldRelpath.npos; // TODO: Handle files with .. in their name - std::string* res = 0; + std::string* res = CM_NULLPTR; if (inSrc && inBld) { // If both have relative path with no dots, pick the shorter one @@ -2375,7 +2375,7 @@ void cmCTest::EmptyCTestConfiguration() void cmCTest::DetermineNextDayStop() { struct tm* lctime; - time_t current_time = time(0); + time_t current_time = time(CM_NULLPTR); lctime = gmtime(¤t_time); int gm_hour = lctime->tm_hour; time_t gm_time = mktime(lctime); @@ -2459,7 +2459,7 @@ bool cmCTest::GetProduceXML() const char* cmCTest::GetSpecificTrack() { if (this->SpecificTrack.empty()) { - return 0; + return CM_NULLPTR; } return this->SpecificTrack.c_str(); } @@ -2534,7 +2534,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(0); + argv.push_back(CM_NULLPTR); *stdOut = ""; *stdErr = ""; @@ -2555,7 +2555,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, int res; bool done = false; while (!done) { - res = cmsysProcess_WaitForData(cp, &data, &length, 0); + res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR); switch (res) { case cmsysProcess_Pipe_STDOUT: tempOutput.insert(tempOutput.end(), data, data + length); @@ -2572,7 +2572,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, } } - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); if (!tempOutput.empty()) { stdOut->append(&*tempOutput.begin(), tempOutput.size()); } @@ -2614,7 +2614,7 @@ void cmCTest::SetOutputLogFileName(const char* name) { if (this->OutputLogFile) { delete this->OutputLogFile; - this->OutputLogFile = 0; + this->OutputLogFile = CM_NULLPTR; } if (name) { this->OutputLogFile = new cmGeneratedFileStream(name); @@ -2628,7 +2628,7 @@ static const char* cmCTestStringLogType[] = { "DEBUG", "HANDLER_VERBOSE_OUTPUT", "WARNING", "ERROR_MESSAGE", - 0 }; + CM_NULLPTR }; #ifdef cerr #undef cerr diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 65ecaa4..833cd96 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -120,7 +120,7 @@ public: typedef std::set SetOfStrings; ///! Process Command line arguments - int Run(std::vector&, std::string* output = 0); + int Run(std::vector&, std::string* output = CM_NULLPTR); /** * Initialize and finalize testing @@ -271,8 +271,8 @@ public: * escaped for this to with spaces. */ bool RunCommand(const char* command, std::string* stdOut, - std::string* stdErr, int* retVal = 0, const char* dir = 0, - double timeout = 0.0); + std::string* stdErr, int* retVal = CM_NULLPTR, + const char* dir = CM_NULLPTR, double timeout = 0.0); //! Clean/make safe for xml the given value such that it may be used as // one of the key fields by CDash when computing the buildid. @@ -574,7 +574,7 @@ private: //! Check if the argument is the one specified bool CheckArgument(const std::string& arg, const char* varg1, - const char* varg2 = 0); + const char* varg2 = CM_NULLPTR); //! Output errors from a test void OutputTestErrors(std::vector const& process_output); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index bcef3c8..bdd7303 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -179,7 +179,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal, } const char* cmCacheManager::PersistentProperties[] = { "ADVANCED", "MODIFIED", - "STRINGS", 0 }; + "STRINGS", CM_NULLPTR }; bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) @@ -447,7 +447,7 @@ cmCacheManager::CacheEntry* cmCacheManager::GetCacheEntry( if (i != this->Cache.end()) { return &i->second; } - return 0; + return CM_NULLPTR; } cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key) @@ -462,7 +462,7 @@ const char* cmCacheManager::GetInitializedCacheValue( if (i != this->Cache.end() && i->second.Initialized) { return i->second.Value.c_str(); } - return 0; + return CM_NULLPTR; } void cmCacheManager::PrintCache(std::ostream& out) const @@ -616,7 +616,7 @@ const char* cmCacheManager::CacheIterator::GetProperty( if (!this->IsAtEnd()) { return this->GetEntry().GetProperty(prop); } - return 0; + return CM_NULLPTR; } void cmCacheManager::CacheIterator::SetProperty(const std::string& p, @@ -653,5 +653,5 @@ void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v) bool cmCacheManager::CacheIterator::PropertyExists( const std::string& prop) const { - return this->GetProperty(prop) != NULL; + return this->GetProperty(prop) != CM_NULLPTR; } diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 153e957..2331867 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -113,7 +113,7 @@ public: void PrintCache(std::ostream&) const; ///! Get the iterator for an entry with a given key. - cmCacheManager::CacheIterator GetCacheIterator(const char* key = 0); + cmCacheManager::CacheIterator GetCacheIterator(const char* key = CM_NULLPTR); ///! Remove an entry from the cache void RemoveCacheEntry(const std::string& key); @@ -128,7 +128,7 @@ public: { cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); if (it.IsAtEnd()) { - return 0; + return CM_NULLPTR; } return it.GetValue(); } @@ -171,7 +171,8 @@ public: void RemoveCacheEntryProperty(std::string const& key, std::string const& propName) { - this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); + this->GetCacheIterator(key.c_str()) + .SetProperty(propName, (void*)CM_NULLPTR); } void AppendCacheEntryProperty(std::string const& key, diff --git a/Source/cmCommand.h b/Source/cmCommand.h index be90a46..a5f20e6 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -38,7 +38,7 @@ public: */ cmCommand() { - this->Makefile = 0; + this->Makefile = CM_NULLPTR; this->Enabled = true; } diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index a4f3c7d..294117c 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -25,7 +25,7 @@ cmCommandArgumentParserHelper::cmCommandArgumentParserHelper() this->WarnUninitialized = false; this->CheckSystemVars = false; this->FileLine = -1; - this->FileName = 0; + this->FileName = CM_NULLPTR; this->RemoveEmpty = true; this->EmptyVariable[0] = 0; strcpy(this->DCURLYVariable, "${"); @@ -96,13 +96,13 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, e << "Syntax $" << key << "{} is not supported. " << "Only ${}, $ENV{}, and $CACHE{} are allowed."; this->SetError(e.str()); - return 0; + return CM_NULLPTR; } char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) { if (!var) { - return 0; + return CM_NULLPTR; } if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { std::ostringstream ostr; @@ -125,7 +125,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str()); } } - return 0; + return CM_NULLPTR; } if (this->EscapeQuotes && value) { return this->AddString(cmSystemTools::EscapeQuotes(value)); @@ -176,7 +176,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2) void cmCommandArgumentParserHelper::AllocateParserType( cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len) { - pt->str = 0; + pt->str = CM_NULLPTR; if (len == 0) { len = static_cast(strlen(str)); } diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index c336bc5..1345bd5 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -21,11 +21,11 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, , ArgumentsBeforeEmpty(true) , CurrentIndex(0) { - if (args != 0) { + if (args != CM_NULLPTR) { args->AddArgument(this); } - if (this->Group != 0) { + if (this->Group != CM_NULLPTR) { this->Group->ContainedArguments.push_back(this); } } @@ -45,7 +45,7 @@ void cmCommandArgument::Follows(const cmCommandArgument* arg) void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) { - if (group != 0) { + if (group != CM_NULLPTR) { this->ArgumentsBeforeEmpty = false; this->ArgumentsBefore.insert(group->ContainedArguments.begin(), group->ContainedArguments.end()); @@ -69,7 +69,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const bool cmCommandArgument::KeyMatches(const std::string& key) const { - if ((this->Key == 0) || (this->Key[0] == '\0')) { + if ((this->Key == CM_NULLPTR) || (this->Key[0] == '\0')) { return true; } return (key == this->Key); @@ -77,7 +77,7 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const void cmCommandArgument::ApplyOwnGroup() { - if (this->Group != 0) { + if (this->Group != CM_NULLPTR) { for (std::vector::const_iterator it = this->Group->ContainedArguments.begin(); it != this->Group->ContainedArguments.end(); ++it) { @@ -105,9 +105,9 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) - , Ignore(0) + , Ignore(CM_NULLPTR) { - if ((key == 0) || (*key == 0)) { + if ((key == CM_NULLPTR) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -117,7 +117,7 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index) { if (index >= this->DataStart) { - if ((this->Ignore == 0) || (arg != this->Ignore)) { + if ((this->Ignore == CM_NULLPTR) || (arg != this->Ignore)) { this->Vector.push_back(arg); } } @@ -134,7 +134,7 @@ cmCAString::cmCAString(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) { - if ((key == 0) || (*key == 0)) { + if ((key == CM_NULLPTR) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -216,7 +216,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group) void cmCommandArgumentsHelper::Parse(const std::vector* args, std::vector* unconsumedArgs) { - if (args == 0) { + if (args == CM_NULLPTR) { return; } @@ -227,8 +227,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector* args, (*argIt)->Reset(); } - cmCommandArgument* activeArgument = 0; - const cmCommandArgument* previousArgument = 0; + cmCommandArgument* activeArgument = CM_NULLPTR; + const cmCommandArgument* previousArgument = CM_NULLPTR; for (std::vector::const_iterator it = args->begin(); it != args->end(); ++it) { for (std::vector::iterator argIt = @@ -246,10 +246,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector* args, bool argDone = activeArgument->Consume(*it); previousArgument = activeArgument; if (argDone) { - activeArgument = 0; + activeArgument = CM_NULLPTR; } } else { - if (unconsumedArgs != 0) { + if (unconsumedArgs != CM_NULLPTR) { unconsumedArgs->push_back(*it); } } diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 27fef1f..9133148 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -43,7 +43,7 @@ class cmCommandArgument { public: cmCommandArgument(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = 0); + cmCommandArgumentGroup* group = CM_NULLPTR); virtual ~cmCommandArgument() {} /// this argument may follow after arg. 0 means it comes first. @@ -95,7 +95,7 @@ class cmCAStringVector : public cmCommandArgument { public: cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = 0); + cmCommandArgumentGroup* group = CM_NULLPTR); /// Return the vector of strings const std::vector& GetVector() const { return this->Vector; } @@ -118,7 +118,7 @@ class cmCAString : public cmCommandArgument { public: cmCAString(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = 0); + cmCommandArgumentGroup* group = CM_NULLPTR); /// Return the string const std::string& GetString() const { return this->String; } @@ -137,7 +137,7 @@ class cmCAEnabler : public cmCommandArgument { public: cmCAEnabler(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = 0); + cmCommandArgumentGroup* group = CM_NULLPTR); /// Has it been enabled ? bool IsEnabled() const { return this->Enabled; } @@ -154,7 +154,7 @@ class cmCADisabler : public cmCommandArgument { public: cmCADisabler(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = 0); + cmCommandArgumentGroup* group = CM_NULLPTR); /// Is it still enabled ? bool IsEnabled() const { return this->Enabled; } diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 101093d..7ad18f0 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -98,7 +98,7 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT"); format = cmOutputConverter::GetFortranFormat(tgtfmt); } - const char* var = 0; + const char* var = CM_NULLPTR; switch (format) { case cmOutputConverter::FortranFormatFixed: var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 2129394..fffb77d 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -194,7 +194,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, this->OldLinkDirMode = false; // No computation has been done. - this->CCG = 0; + this->CCG = CM_NULLPTR; } cmComputeLinkDepends::~cmComputeLinkDepends() @@ -286,7 +286,7 @@ std::map::iterator cmComputeLinkDepends::AllocateLinkEntry( std::map::iterator lei = this->LinkEntryIndex.insert(index_entry).first; this->EntryList.push_back(LinkEntry()); - this->InferredDependSets.push_back(0); + this->InferredDependSets.push_back(CM_NULLPTR); this->EntryConstraintGraph.push_back(EdgeList()); return lei; } @@ -314,7 +314,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item) // If the item has dependencies queue it to follow them. if (entry.Target) { // Target dependencies are always known. Follow them. - BFSEntry qe = { index, 0 }; + BFSEntry qe = { index, CM_NULLPTR }; this->BFSQueue.push(qe); } else { // Look for an old-style _LIB_DEPENDS variable. diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 6aa40c3..4a33aff 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -44,7 +44,7 @@ public: bool IsFlag; LinkEntry() : Item() - , Target(0) + , Target(CM_NULLPTR) , IsSharedDep(false) , IsFlag(false) { diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 1eefbb1..7db5df3 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -262,7 +262,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( this->GlobalGenerator, target, "linker search path"); this->OrderRuntimeSearchPath = new cmOrderDirectories( this->GlobalGenerator, target, "runtime search path"); - this->OrderDependentRPath = 0; + this->OrderDependentRPath = CM_NULLPTR; // Get the language used for linking this target. this->LinkLanguage = this->Target->GetLinkerLanguage(config); @@ -283,7 +283,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( // On platforms without import libraries there may be a special flag // to use when creating a plugin (module) that obtains symbols from // the program that will load it. - this->LoaderFlag = 0; + this->LoaderFlag = CM_NULLPTR; if (!this->UseImportLibrary && this->Target->GetType() == cmState::MODULE_LIBRARY) { std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; @@ -561,7 +561,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) for (std::vector::const_iterator i = libsVec.begin(); i != libsVec.end(); ++i) { if (this->ImplicitLinkLibs.find(*i) == this->ImplicitLinkLibs.end()) { - this->AddItem(*i, 0); + this->AddItem(*i, CM_NULLPTR); } } } @@ -693,7 +693,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, // Check if we need to include the dependent shared library in other // path ordering. - cmOrderDirectories* order = 0; + cmOrderDirectories* order = CM_NULLPTR; if (this->SharedDependencyMode == SharedDepModeLibDir && !this->LinkWithRuntimePath /* AddLibraryRuntimeInfo adds it */) { // Add the item to the linker search path. @@ -705,7 +705,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, if (order) { if (tgt) { std::string soName = tgt->GetSOName(this->Config); - const char* soname = soName.empty() ? 0 : soName.c_str(); + const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str(); order->AddRuntimeLibrary(lib, soname); } else { order->AddRuntimeLibrary(lib); @@ -724,9 +724,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo() this->LinkTypeEnabled = false; // Lookup link type selection flags. - const char* static_link_type_flag = 0; - const char* shared_link_type_flag = 0; - const char* target_type_str = 0; + const char* static_link_type_flag = CM_NULLPTR; + const char* shared_link_type_flag = CM_NULLPTR; + const char* target_type_str = CM_NULLPTR; switch (this->Target->GetType()) { case cmState::EXECUTABLE: target_type_str = "EXE"; @@ -1606,7 +1606,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo( // Try to get the soname of the library. Only files with this name // could possibly conflict. std::string soName = target->GetSOName(this->Config); - const char* soname = soName.empty() ? 0 : soName.c_str(); + const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str(); // Include this library in the runtime path ordering. this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index c0ddc53..023c781 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -38,7 +38,7 @@ public: Item() : Value() , IsPath(true) - , Target(0) + , Target(CM_NULLPTR) { } Item(Item const& item) @@ -47,7 +47,8 @@ public: , Target(item.Target) { } - Item(std::string const& v, bool p, cmGeneratorTarget const* target = 0) + Item(std::string const& v, bool p, + cmGeneratorTarget const* target = CM_NULLPTR) : Value(v) , IsPath(p) , Target(target) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 570405a..ff7eb0b 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -291,7 +291,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( // within the project. if (dependee && dependee->GetType() == cmState::EXECUTABLE && !dependee->IsExecutableWithExports()) { - dependee = 0; + dependee = CM_NULLPTR; } if (dependee) { @@ -355,7 +355,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, // within the project. if (linking && dependee && dependee->GetType() == cmState::EXECUTABLE && !dependee->IsExecutableWithExports()) { - dependee = 0; + dependee = CM_NULLPTR; } if (dependee) { diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 7006b62..67b2571 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -130,7 +130,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted( if ((this->Policy54Status != cmPolicies::WARN && this->Policy54Status != cmPolicies::OLD) && argument.WasQuoted()) { - return 0; + return CM_NULLPTR; } const char* def = this->Makefile.GetDefinition(argument.GetValue()); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0149fdf..7d35a9e 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -77,7 +77,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, } const char* sourceDirectory = argv[2].c_str(); - const char* projectName = 0; + const char* projectName = CM_NULLPTR; std::string targetName; std::vector cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0] std::vector compileDefs; diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 85049ca..e54b3c7 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -30,7 +30,7 @@ cmsys::auto_ptr cmCryptoHash::New(const char* algo) } else if (strcmp(algo, "SHA512") == 0) { return cmsys::auto_ptr(new cmCryptoHashSHA512); } else { - return cmsys::auto_ptr(0); + return cmsys::auto_ptr(CM_NULLPTR); } } diff --git a/Source/cmCurl.h b/Source/cmCurl.h index eac7f13..26bf94e 100644 --- a/Source/cmCurl.h +++ b/Source/cmCurl.h @@ -16,6 +16,6 @@ #include "cm_curl.h" -std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = 0); +std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR); #endif diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 4c5bd03..2b9248d 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -38,7 +38,7 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf, , Backtrace() , Comment(comment ? comment : "") , WorkingDirectory(workingDirectory ? workingDirectory : "") - , HaveComment(comment != NULL) + , HaveComment(comment != CM_NULLPTR) , EscapeAllowMakeVars(false) , EscapeOldStyle(true) { @@ -69,7 +69,7 @@ const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const const char* cmCustomCommand::GetComment() const { - const char* no_comment = 0; + const char* no_comment = CM_NULLPTR; return this->HaveComment ? this->Comment.c_str() : no_comment; } diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 99bb601..315a1b6 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -45,7 +45,7 @@ bool cmCustomCommandGenerator::UseCrossCompilingEmulator(unsigned int c) const std::string const& argv0 = this->CC.GetCommandLines()[c][0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); if (target && target->GetType() == cmState::EXECUTABLE) { - return target->GetProperty("CROSSCOMPILING_EMULATOR") != 0; + return target->GetProperty("CROSSCOMPILING_EMULATOR") != CM_NULLPTR; } return false; } diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 28b6677..e0fb59b 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -41,7 +41,7 @@ const char* cmDefinitions::Get(const std::string& key, StackIter begin, StackIter end) { Def const& def = cmDefinitions::GetInternal(key, begin, end, false); - return def.Exists ? def.c_str() : 0; + return def.Exists ? def.c_str() : CM_NULLPTR; } void cmDefinitions::Raise(const std::string& key, StackIter begin, diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 5df3cc1..b25e3ce 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -23,7 +23,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir) : CompileDirectory() , LocalGenerator(lg) , Verbose(false) - , FileComparison(0) + , FileComparison(CM_NULLPTR) , TargetDirectory(targetDir) , MaxPath(16384) , Dependee(new char[MaxPath]) @@ -140,7 +140,7 @@ bool cmDepends::CheckDependencies( // regenerated. bool okay = true; bool dependerExists = false; - DependencyVector* currentDependencies = 0; + DependencyVector* currentDependencies = CM_NULLPTR; while (internalDepends.getline(this->Dependee, this->MaxPath)) { if (this->Dependee[0] == 0 || this->Dependee[0] == '#' || @@ -182,7 +182,7 @@ bool cmDepends::CheckDependencies( bool regenerate = false; const char* dependee = this->Dependee + 1; const char* depender = this->Depender; - if (currentDependencies != 0) { + if (currentDependencies != CM_NULLPTR) { currentDependencies->push_back(dependee); } @@ -242,9 +242,9 @@ bool cmDepends::CheckDependencies( // Remove the information of this depender from the map, it needs // to be rescanned - if (currentDependencies != 0) { + if (currentDependencies != CM_NULLPTR) { validDeps.erase(this->Depender); - currentDependencies = 0; + currentDependencies = CM_NULLPTR; } // Remove the depender to be sure it is rebuilt. @@ -261,7 +261,7 @@ bool cmDepends::CheckDependencies( void cmDepends::SetIncludePathFromLanguage(const std::string& lang) { // Look for the new per "TARGET_" variant first: - const char* includePath = 0; + const char* includePath = CM_NULLPTR; std::string includePathVar = "CMAKE_"; includePathVar += lang; includePathVar += "_TARGET_INCLUDE_PATH"; diff --git a/Source/cmDepends.h b/Source/cmDepends.h index a62f8c2..0e1cbb9 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -29,7 +29,7 @@ class cmDepends public: /** Instances need to know the build directory name and the relative path from the build directory to the target file. */ - cmDepends(cmLocalGenerator* lg = 0, const char* targetDir = ""); + cmDepends(cmLocalGenerator* lg = CM_NULLPTR, const char* targetDir = ""); /** at what level will the compile be done from */ void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; } diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 57e719c..18e123e 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -29,7 +29,7 @@ #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: " cmDependsC::cmDependsC() - : ValidDeps(0) + : ValidDeps(CM_NULLPTR) { } @@ -105,7 +105,7 @@ bool cmDependsC::WriteDependencies(const std::set& sources, std::set dependencies; bool haveDeps = false; - if (this->ValidDeps != 0) { + if (this->ValidDeps != CM_NULLPTR) { std::map::const_iterator tmpIt = this->ValidDeps->find(obj); if (tmpIt != this->ValidDeps->end()) { @@ -269,12 +269,12 @@ void cmDependsC::ReadCacheFile() } std::string line; - cmIncludeLines* cacheEntry = 0; + cmIncludeLines* cacheEntry = CM_NULLPTR; bool haveFileName = false; while (cmSystemTools::GetLineFromStream(fin, line)) { if (line.empty()) { - cacheEntry = 0; + cacheEntry = CM_NULLPTR; haveFileName = false; continue; } @@ -312,7 +312,7 @@ void cmDependsC::ReadCacheFile() } } } - } else if (cacheEntry != 0) { + } else if (cacheEntry != CM_NULLPTR) { UnscannedEntry entry; entry.FileName = line; if (cmSystemTools::GetLineFromStream(fin, line)) { diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index bbda688..9ea1e48 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -53,7 +53,7 @@ public: }; cmDependsFortran::cmDependsFortran() - : Internal(0) + : Internal(CM_NULLPTR) { } diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 238e7a1..79c4669 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -59,7 +59,7 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt) if (!*pt) { return; } - *pt = 0; + *pt = CM_NULLPTR; this->UnionsAvailable--; } @@ -160,13 +160,13 @@ void cmDependsJavaParserHelper::PrepareElement( cmDependsJavaParserHelper::ParserType* me) { // Inititalize self - me->str = 0; + me->str = CM_NULLPTR; } void cmDependsJavaParserHelper::AllocateParserType( cmDependsJavaParserHelper::ParserType* pt, const char* str, int len) { - pt->str = 0; + pt->str = CM_NULLPTR; if (len == 0) { len = (int)strlen(str); } @@ -226,7 +226,7 @@ std::vector cmDependsJavaParserHelper::GetFilesProduced() std::vector::const_iterator it; for (it = toplevel.NestedClasses.begin(); it != toplevel.NestedClasses.end(); ++it) { - it->AddFileNamesForPrinting(&files, 0, "$"); + it->AddFileNamesForPrinting(&files, CM_NULLPTR, "$"); } return files; } @@ -326,7 +326,7 @@ void cmDependsJavaParserHelper::Error(const char* str) void cmDependsJavaParserHelper::UpdateCombine(const char* str1, const char* str2) { - if (this->CurrentCombine == "" && str1 != 0) { + if (this->CurrentCombine == "" && str1 != CM_NULLPTR) { this->CurrentCombine = str1; } this->CurrentCombine += "."; diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 413dacd..919a45e 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -49,12 +49,12 @@ static const char* cmDocumentationStandardOptions[][2] = { { "--help-variable-list []", "List variables with help available and exit." }, { "--help-variables []", "Print cmake-variables manual and exit." }, - { 0, 0 } + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationGeneratorsHeader[][2] = { - { 0, "The following generators are available on this platform:" }, - { 0, 0 } + { CM_NULLPTR, "The following generators are available on this platform:" }, + { CM_NULLPTR, CM_NULLPTR } }; cmDocumentation::cmDocumentation() @@ -137,7 +137,7 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os) this->CurrentArgument = i->Argument; // If a file name was given, use it. Otherwise, default to the // given stream. - cmsys::ofstream* fout = 0; + cmsys::ofstream* fout = CM_NULLPTR; std::ostream* s = &os; if (!i->Filename.empty()) { fout = new cmsys::ofstream(i->Filename.c_str()); @@ -420,7 +420,7 @@ void cmDocumentation::SetSections( void cmDocumentation::PrependSection(const char* name, const char* docs[][2]) { - cmDocumentationSection* sec = 0; + cmDocumentationSection* sec = CM_NULLPTR; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -434,7 +434,7 @@ void cmDocumentation::PrependSection(const char* name, const char* docs[][2]) void cmDocumentation::PrependSection(const char* name, std::vector& docs) { - cmDocumentationSection* sec = 0; + cmDocumentationSection* sec = CM_NULLPTR; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -447,7 +447,7 @@ void cmDocumentation::PrependSection(const char* name, void cmDocumentation::AppendSection(const char* name, const char* docs[][2]) { - cmDocumentationSection* sec = 0; + cmDocumentationSection* sec = CM_NULLPTR; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -461,7 +461,7 @@ void cmDocumentation::AppendSection(const char* name, const char* docs[][2]) void cmDocumentation::AppendSection(const char* name, std::vector& docs) { - cmDocumentationSection* sec = 0; + cmDocumentationSection* sec = CM_NULLPTR; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index dd99ca8..ac36c8b 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -39,7 +39,7 @@ public: * help arguments. */ bool CheckOptions(int argc, const char* const* argv, - const char* exitOpt = 0); + const char* exitOpt = CM_NULLPTR); /** * Print help requested on the command line. Call after diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index 7d0bbdc..4c31733f 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -26,7 +26,7 @@ private: static cmDynamicLoaderCache* Instance; }; -cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = 0; +cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = CM_NULLPTR; cmDynamicLoaderCache::~cmDynamicLoaderCache() { @@ -75,7 +75,7 @@ void cmDynamicLoaderCache::FlushCache() cmsys::DynamicLoader::CloseLibrary(it->second); } delete cmDynamicLoaderCache::Instance; - cmDynamicLoaderCache::Instance = 0; + cmDynamicLoaderCache::Instance = CM_NULLPTR; } cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance() diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 16294ea..59667cd 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -672,7 +672,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( if (dssi->second.Position > 0) { return &dssi->second; } - return 0; + return CM_NULLPTR; } // Create an entry for this tag. Assume it is missing until found. @@ -683,14 +683,14 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( // Try reading the dynamic section. if (!this->LoadDynamicSection()) { - return 0; + return CM_NULLPTR; } // Get the string table referenced by the DYNAMIC section. ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; if (sec.sh_link >= this->SectionHeaders.size()) { this->SetErrorMessage("Section DYNAMIC has invalid string table index."); - return 0; + return CM_NULLPTR; } ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link]; @@ -705,7 +705,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( if (dyn.d_un.d_val >= strtab.sh_size) { this->SetErrorMessage("Section DYNAMIC references string beyond " "the end of its string section."); - return 0; + return CM_NULLPTR; } // Seek to the position reported by the entry. @@ -734,7 +734,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( if (!this->Stream) { this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); se.Value = ""; - return 0; + return CM_NULLPTR; } // The value has been read successfully. Report it. @@ -745,14 +745,14 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( return &se; } } - return 0; + return CM_NULLPTR; } //============================================================================ // External class implementation. cmELF::cmELF(const char* fname) - : Internal(0) + : Internal(CM_NULLPTR) { // Try to open the file. cmsys::auto_ptr fin(new cmsys::ifstream(fname)); @@ -879,7 +879,7 @@ cmELF::StringEntry const* cmELF::GetSOName() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) { return this->Internal->GetSOName(); } else { - return 0; + return CM_NULLPTR; } } @@ -890,7 +890,7 @@ cmELF::StringEntry const* cmELF::GetRPath() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRPath(); } else { - return 0; + return CM_NULLPTR; } } @@ -901,7 +901,7 @@ cmELF::StringEntry const* cmELF::GetRunPath() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRunPath(); } else { - return 0; + return CM_NULLPTR; } } diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index f3f8c2f..58bbc31 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -90,7 +90,7 @@ bool cmExecProgramCommand::InitialPass(std::vector const& args, args[1].c_str(), verbose); } else { result = cmExecProgramCommand::RunCommand(command.c_str(), output, retVal, - 0, verbose); + CM_NULLPTR, verbose); } if (!result) { retVal = -1; @@ -209,7 +209,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, } fflush(stdout); fflush(stderr); - const char* cmd[] = { "/bin/sh", "-c", command, 0 }; + const char* cmd[] = { "/bin/sh", "-c", command, CM_NULLPTR }; cmsysProcess_SetCommand(cp, cmd); #endif @@ -219,7 +219,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, int length; char* data; int p; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, 0), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) { if (verbose) { cmSystemTools::Stdout(data, length); @@ -229,7 +229,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, } // All output has been read. Wait for the process to exit. - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); // Check the result of running the process. std::string msg; diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index ef87aac..7cd4f9f 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -50,7 +50,8 @@ public: private: static bool RunCommand(const char* command, std::string& output, int& retVal, - const char* directory = 0, bool verbose = true); + const char* directory = CM_NULLPTR, + bool verbose = true); }; #endif diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 575cdc3..d97b25f 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -161,7 +161,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector const& args, return false; } else { // Add the null terminating pointer to the command argument list. - cmds[i].push_back(0); + cmds[i].push_back(CM_NULLPTR); } } @@ -228,7 +228,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector const& args, int length; char* data; int p; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, 0), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { // Put the output in the right place. if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) { if (output_variable.empty()) { @@ -246,7 +246,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector const& args, } // All output has been read. Wait for the process to exit. - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); // Fix the text in the output strings. cmExecuteProcessCommandFixText(tempOutput, output_strip_trailing_whitespace); diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 8ca7a11..a53d285 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -18,8 +18,8 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator() { - this->LG = 0; - this->ExportSet = 0; + this->LG = CM_NULLPTR; + this->ExportSet = CM_NULLPTR; } void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index a0e7e45..3cb575e 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -35,7 +35,7 @@ cmExportCommand::cmExportCommand() , Filename(&Helper, "FILE", &ArgumentGroup) , ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup) { - this->ExportSet = 0; + this->ExportSet = CM_NULLPTR; } // cmExportCommand @@ -50,10 +50,10 @@ bool cmExportCommand::InitialPass(std::vector const& args, if (args[0] == "PACKAGE") { return this->HandlePackage(args); } else if (args[0] == "EXPORT") { - this->ExportSetName.Follows(0); + this->ExportSetName.Follows(CM_NULLPTR); this->ArgumentGroup.Follows(&this->ExportSetName); } else { - this->Targets.Follows(0); + this->Targets.Follows(CM_NULLPTR); this->ArgumentGroup.Follows(&this->Targets); } diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index 5a826f2..fdc0760 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -63,7 +63,8 @@ std::string cmExportTryCompileFileGenerator::FindTargets( cmGeneratorExpression ge; - cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, 0, 0); + cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, + CM_NULLPTR, CM_NULLPTR); cmsys::auto_ptr cge = ge.Parse(prop); diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index 2ba9b8d..0771a4e 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -21,7 +21,7 @@ int cmExpr_yyparse(yyscan_t yyscanner); cmExprParserHelper::cmExprParserHelper() { this->FileLine = -1; - this->FileName = 0; + this->FileName = CM_NULLPTR; } cmExprParserHelper::~cmExprParserHelper() diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index dee666b..fbfbccc 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -289,8 +289,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( xml.StartElement("Build"); - this->AppendTarget(xml, "all", 0, make.c_str(), lgs[0], compiler.c_str(), - makeArgs); + this->AppendTarget(xml, "all", CM_NULLPTR, make.c_str(), lgs[0], + compiler.c_str(), makeArgs); // add all executable and library targets and some of the GLOBAL // and UTILITY targets @@ -306,7 +306,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory()) == 0) { - this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, + this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, compiler.c_str(), makeArgs); } } break; @@ -322,7 +322,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( break; } - this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, + this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, compiler.c_str(), makeArgs); break; case cmState::EXECUTABLE: @@ -515,7 +515,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget( xml.StartElement("Target"); xml.Attribute("title", targetName); - if (target != 0) { + if (target != CM_NULLPTR) { int cbTargetType = this->GetCBTargetType(target); std::string workingDir = lg->GetCurrentBinaryDirectory(); if (target->GetType() == cmState::EXECUTABLE) { @@ -523,12 +523,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget( // set the working directory to this dir. const char* runtimeOutputDir = makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"); - if (runtimeOutputDir != 0) { + if (runtimeOutputDir != CM_NULLPTR) { workingDir = runtimeOutputDir; } else { const char* executableOutputDir = makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - if (executableOutputDir != 0) { + if (executableOutputDir != CM_NULLPTR) { workingDir = executableOutputDir; } } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index f964b97..16cb082 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -217,17 +217,17 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out, // now we have both, decide which one to use std::string valueToUse; - if (envVarValue == 0 && cacheValue == 0) { + if (envVarValue == CM_NULLPTR && cacheValue == CM_NULLPTR) { // nothing known, do nothing valueToUse = ""; - } else if (envVarValue != 0 && cacheValue == 0) { + } else if (envVarValue != CM_NULLPTR && cacheValue == CM_NULLPTR) { // The variable is in the env, but not in the cache. Use it and put it // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmState::STRING, true); mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory()); - } else if (envVarValue == 0 && cacheValue != 0) { + } else if (envVarValue == CM_NULLPTR && cacheValue != CM_NULLPTR) { // It is already in the cache, but not in the env, so use it from the cache valueToUse = cacheValue; } else { diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index ff6e4b6..0400ad5 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -82,7 +82,7 @@ private: const std::string& make, const std::string& makeArguments, const std::string& path, const char* prefix = "", - const char* makeTarget = NULL); + const char* makeTarget = CM_NULLPTR); static void AppendScannerProfile( cmXMLWriter& xml, const std::string& profileID, bool openActionEnabled, const std::string& openActionFilePath, bool pParserEnabled, diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 02159dd..b757a49 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -137,9 +137,9 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, if (targetName == "edit_cache") { const char* editCommand = (*it)->GetMakefile()->GetDefinition("CMAKE_EDIT_COMMAND"); - if (editCommand == 0) { + if (editCommand == CM_NULLPTR) { insertTarget = false; - } else if (strstr(editCommand, "ccmake") != NULL) { + } else if (strstr(editCommand, "ccmake") != CM_NULLPTR) { insertTarget = false; } } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 2b9f64f..c166e26 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -134,9 +134,9 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::string compiler = ""; if (!lgs.empty()) { - this->AppendTarget(fout, "all", lgs[0], 0, make.c_str(), mf, + this->AppendTarget(fout, "all", lgs[0], CM_NULLPTR, make.c_str(), mf, compiler.c_str(), sourceFileFlags, true); - this->AppendTarget(fout, "clean", lgs[0], 0, make.c_str(), mf, + this->AppendTarget(fout, "clean", lgs[0], CM_NULLPTR, make.c_str(), mf, compiler.c_str(), sourceFileFlags, false); } @@ -155,7 +155,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory()) == 0) { - this->AppendTarget(fout, targetName, *lg, 0, make.c_str(), + this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); } @@ -172,8 +172,9 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( break; } - this->AppendTarget(fout, targetName, *lg, 0, make.c_str(), makefile, - compiler.c_str(), sourceFileFlags, false); + this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(), + makefile, compiler.c_str(), sourceFileFlags, + false); break; case cmState::EXECUTABLE: case cmState::STATIC_LIBRARY: @@ -204,7 +205,7 @@ void cmExtraSublimeTextGenerator::AppendTarget( MapSourceFileFlags& sourceFileFlags, bool firstTarget) { - if (target != 0) { + if (target != CM_NULLPTR) { std::vector sourceFiles; target->GetSourceFiles(sourceFiles, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index ebd6223..03ee31e 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -73,8 +73,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, // Add command for generating the .h and .cxx files std::string no_main_dependency = ""; - const char* no_comment = 0; - const char* no_working_dir = 0; + const char* no_comment = CM_NULLPTR; + const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( cxxres, depends, no_main_dependency, commandLines, no_comment, no_working_dir); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index c1fca51..4aecf7c 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -231,17 +231,17 @@ bool cmFileCommand::HandleReadCommand(std::vector const& args) cmCommandArgumentGroup group; cmCAString readArg(&argHelper, "READ"); - cmCAString fileNameArg(&argHelper, 0); - cmCAString resultArg(&argHelper, 0); + cmCAString fileNameArg(&argHelper, CM_NULLPTR); + cmCAString resultArg(&argHelper, CM_NULLPTR); cmCAString offsetArg(&argHelper, "OFFSET", &group); cmCAString limitArg(&argHelper, "LIMIT", &group); cmCAEnabler hexOutputArg(&argHelper, "HEX", &group); - readArg.Follows(0); + readArg.Follows(CM_NULLPTR); fileNameArg.Follows(&readArg); resultArg.Follows(&fileNameArg); group.Follows(&resultArg); - argHelper.Parse(&args, 0); + argHelper.Parse(&args, CM_NULLPTR); std::string fileName = fileNameArg.GetString(); if (!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) { @@ -901,9 +901,9 @@ bool cmFileCommand::HandleDifferentCommand( */ // Evaluate arguments. - const char* file_lhs = 0; - const char* file_rhs = 0; - const char* var = 0; + const char* file_lhs = CM_NULLPTR; + const char* file_rhs = CM_NULLPTR; + const char* var = CM_NULLPTR; enum Doing { DoingNone, @@ -958,7 +958,7 @@ struct cmFileCopier , MatchlessFiles(true) , FilePermissions(0) , DirPermissions(0) - , CurrentMatchRule(0) + , CurrentMatchRule(CM_NULLPTR) , UseGivenPermissionsFile(false) , UseGivenPermissionsDir(false) , UseSourcePermissions(true) @@ -1942,9 +1942,9 @@ bool cmFileCommand::HandleRPathChangeCommand( std::vector const& args) { // Evaluate arguments. - const char* file = 0; - const char* oldRPath = 0; - const char* newRPath = 0; + const char* file = CM_NULLPTR; + const char* oldRPath = CM_NULLPTR; + const char* newRPath = CM_NULLPTR; enum Doing { DoingNone, @@ -2032,7 +2032,7 @@ bool cmFileCommand::HandleRPathRemoveCommand( std::vector const& args) { // Evaluate arguments. - const char* file = 0; + const char* file = CM_NULLPTR; enum Doing { DoingNone, @@ -2096,8 +2096,8 @@ bool cmFileCommand::HandleRPathCheckCommand( std::vector const& args) { // Evaluate arguments. - const char* file = 0; - const char* rpath = 0; + const char* file = CM_NULLPTR; + const char* rpath = CM_NULLPTR; enum Doing { DoingNone, @@ -2438,7 +2438,7 @@ public: inline void release(void) { - this->Easy = 0; + this->Easy = CM_NULLPTR; return; } @@ -2934,7 +2934,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector const& args) ::curl_global_cleanup(); fclose(fin); - fin = NULL; + fin = CM_NULLPTR; if (!logVar.empty()) { std::string log; diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 638c1d1..d255ceb 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -234,13 +234,13 @@ void cmFindCommon::GetIgnoredPaths(std::vector& ignore) { // null-terminated list of paths. static const char* paths[] = { "CMAKE_SYSTEM_IGNORE_PATH", - "CMAKE_IGNORE_PATH", 0 }; + "CMAKE_IGNORE_PATH", CM_NULLPTR }; // Construct the list of path roots with no trailing slashes. for (const char** pathName = paths; *pathName; ++pathName) { // Get the list of paths to ignore from the variable. const char* ignorePath = this->Makefile->GetDefinition(*pathName); - if ((ignorePath == 0) || (strlen(ignorePath) == 0)) { + if ((ignorePath == CM_NULLPTR) || (strlen(ignorePath) == 0)) { continue; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index c133fcf..09fa795 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1199,7 +1199,7 @@ public: cmSystemTools::RemoveFile(this->File); } } - void Release() { this->File = 0; } + void Release() { this->File = CM_NULLPTR; } }; void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir, @@ -1526,7 +1526,7 @@ class cmFileList public: cmFileList() : First() - , Last(0) + , Last(CM_NULLPTR) { } virtual ~cmFileList() {} diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 934e928..a72204a 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -65,7 +65,8 @@ cmFortranParser_s::cmFortranParser_s(std::vector const& includes, // Create a dummy buffer that is never read but is the fallback // buffer when the last file is popped off the stack. - YY_BUFFER_STATE buffer = cmFortran_yy_create_buffer(0, 4, this->Scanner); + YY_BUFFER_STATE buffer = + cmFortran_yy_create_buffer(CM_NULLPTR, 4, this->Scanner); cmFortran_yy_switch_to_buffer(buffer, this->Scanner); } @@ -83,7 +84,7 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname) std::string dir = cmSystemTools::GetParentDirectory(fname); cmFortranFile f(file, current, dir); YY_BUFFER_STATE buffer = - cmFortran_yy_create_buffer(0, 16384, parser->Scanner); + cmFortran_yy_create_buffer(CM_NULLPTR, 16384, parser->Scanner); cmFortran_yy_switch_to_buffer(buffer, parser->Scanner); parser->FileStack.push(f); return 1; diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 71fbba3..5d02427 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -81,12 +81,12 @@ private: class cmCompiledGeneratorExpression { public: - const char* Evaluate(cmLocalGenerator* lg, const std::string& config, - bool quiet = false, - cmGeneratorTarget const* headTarget = 0, - cmGeneratorTarget const* currentTarget = 0, - cmGeneratorExpressionDAGChecker* dagChecker = 0, - std::string const& language = std::string()) const; + const char* Evaluate( + cmLocalGenerator* lg, const std::string& config, bool quiet = false, + cmGeneratorTarget const* headTarget = CM_NULLPTR, + cmGeneratorTarget const* currentTarget = CM_NULLPTR, + cmGeneratorExpressionDAGChecker* dagChecker = CM_NULLPTR, + std::string const& language = std::string()) const; const char* Evaluate(cmLocalGenerator* lg, const std::string& config, bool quiet, cmGeneratorTarget const* headTarget, cmGeneratorExpressionDAGChecker* dagChecker, diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 28ca824..6b7fe9a 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -63,7 +63,7 @@ struct cmGeneratorExpressionDAGChecker void ReportError(cmGeneratorExpressionContext* context, const std::string& expr); - bool EvaluatingLinkLibraries(const char* tgt = 0); + bool EvaluatingLinkLibraries(const char* tgt = CM_NULLPTR); #define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const; diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 5b48eea..f9dbc2d 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -40,8 +40,8 @@ void cmGeneratorExpressionEvaluationFile::Generate( { std::string rawCondition = this->Condition->GetInput(); if (!rawCondition.empty()) { - std::string condResult = - this->Condition->Evaluate(lg, config, false, 0, 0, 0, lang); + std::string condResult = this->Condition->Evaluate( + lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); if (condResult == "0") { return; } @@ -56,10 +56,10 @@ void cmGeneratorExpressionEvaluationFile::Generate( } } - const std::string outputFileName = - this->OutputFileExpr->Evaluate(lg, config, false, 0, 0, 0, lang); - const std::string outputContent = - inputExpression->Evaluate(lg, config, false, 0, 0, 0, lang); + const std::string outputFileName = this->OutputFileExpr->Evaluate( + lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); + const std::string outputContent = inputExpression->Evaluate( + lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); std::map::iterator it = outputFiles.find(outputFileName); @@ -97,8 +97,8 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile( for (std::vector::const_iterator le = enabledLanguages.begin(); le != enabledLanguages.end(); ++le) { - std::string name = - this->OutputFileExpr->Evaluate(lg, config, false, 0, 0, 0, *le); + std::string name = this->OutputFileExpr->Evaluate( + lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, *le); cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(name); sf->SetProperty("GENERATED", "1"); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 599ea8d..830979f 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -627,7 +627,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode cmGeneratorExpressionDAGChecker*) const CM_OVERRIDE { if (parameters.empty()) { - return configurationNode.Evaluate(parameters, context, content, 0); + return configurationNode.Evaluate(parameters, context, content, + CM_NULLPTR); } static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$"); if (!configValidator.find(*parameters.begin())) { @@ -646,8 +647,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } if (context->CurrentTarget && context->CurrentTarget->IsImported()) { - const char* loc = 0; - const char* imp = 0; + const char* loc = CM_NULLPTR; + const char* imp = CM_NULLPTR; std::string suffix; if (context->CurrentTarget->Target->GetMappedConfig( context->Config, &loc, &imp, suffix)) { @@ -758,7 +759,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode #define TRANSITIVE_PROPERTY_NAME(PROPERTY) , "INTERFACE_" #PROPERTY static const char* targetPropertyTransitiveWhitelist[] = { - 0 CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME) + CM_NULLPTR CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME) }; #undef TRANSITIVE_PROPERTY_NAME @@ -1270,10 +1271,10 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode } compileFeaturesNode; static const char* targetPolicyWhitelist[] = { - 0 + CM_NULLPTR #define TARGET_POLICY_STRING(POLICY) , #POLICY - CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING) + CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING) #undef TARGET_POLICY_STRING }; @@ -1683,7 +1684,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode( } NodeMap::const_iterator i = nodeMap.find(identifier); if (i == nodeMap.end()) { - return 0; + return CM_NULLPTR; } return i->second; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 3668c82..c7dd3e4 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -491,7 +491,7 @@ std::vector const* cmGeneratorTarget::GetSourceDepends( if (i != this->SourceDepends.end()) { return &i->second.Depends; } - return 0; + return CM_NULLPTR; } static void handleSystemIncludesDep( @@ -802,7 +802,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory( if (iter == this->SystemIncludesCache.end()) { cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", 0, 0); + this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR); bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED"); @@ -998,7 +998,8 @@ void cmGeneratorTarget::GetSourceFiles(std::vector& files, this->DebugSourcesDone = true; } - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES", + CM_NULLPTR, CM_NULLPTR); UNORDERED_SET uniqueSrcs; bool contextDependentDirectSources = @@ -1506,7 +1507,7 @@ const char* cmGeneratorTarget::GetExportMacro() const } return this->ExportMacro.c_str(); } else { - return 0; + return CM_NULLPTR; } } @@ -1750,7 +1751,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo( { // There is no compile information for imported targets. if (this->IsImported()) { - return 0; + return CM_NULLPTR; } if (this->GetType() > cmState::OBJECT_LIBRARY) { @@ -1759,7 +1760,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo( msg += " which has type "; msg += cmState::GetTargetTypeName(this->GetType()); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); - return 0; + return CM_NULLPTR; } // Lookup/compute/cache the compile information for this configuration. @@ -1788,7 +1789,7 @@ cmSourceFile const* cmGeneratorTarget::GetModuleDefinitionFile( return data.front(); } - return 0; + return CM_NULLPTR; } bool cmGeneratorTarget::IsDLLPlatform() const @@ -1841,8 +1842,8 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector& result, } cmGeneratorExpression ge; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "AUTOUIC_OPTIONS", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "AUTOUIC_OPTIONS", CM_NULLPTR, CM_NULLPTR); cmSystemTools::ExpandListArgument( ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this, &dagChecker), @@ -1927,7 +1928,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target) this->Makefile = target->Target->GetMakefile(); this->LocalGenerator = target->GetLocalGenerator(); this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); - this->CurrentEntry = 0; + this->CurrentEntry = CM_NULLPTR; // Queue all the source files already specified for the target. if (target->GetType() != cmState::INTERFACE_LIBRARY) { @@ -2002,7 +2003,7 @@ void cmTargetTraceDependencies::Trace() this->CheckCustomCommand(*cc); } } - this->CurrentEntry = 0; + this->CurrentEntry = CM_NULLPTR; this->GeneratorTarget->AddTracedSources(this->NewSources); } @@ -2202,7 +2203,7 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory( void cmGeneratorTarget::GetAppleArchs(const std::string& config, std::vector& archVec) const { - const char* archs = 0; + const char* archs = CM_NULLPTR; if (!config.empty()) { std::string defVarName = "OSX_ARCHITECTURES_"; defVarName += cmSystemTools::UpperCase(config); @@ -2360,8 +2361,8 @@ std::vector cmGeneratorTarget::GetIncludeDirectories( std::vector includes; UNORDERED_SET uniqueIncludes; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "INCLUDE_DIRECTORIES", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR); std::vector debugProperties; const char* debugProp = @@ -2487,8 +2488,8 @@ void cmGeneratorTarget::GetCompileOptions(std::vector& result, { UNORDERED_SET uniqueOptions; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "COMPILE_OPTIONS", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "COMPILE_OPTIONS", CM_NULLPTR, CM_NULLPTR); std::vector debugProperties; const char* debugProp = @@ -2539,8 +2540,8 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector& result, { UNORDERED_SET uniqueFeatures; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "COMPILE_FEATURES", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "COMPILE_FEATURES", CM_NULLPTR, CM_NULLPTR); std::vector debugProperties; const char* debugProp = @@ -2589,8 +2590,8 @@ void cmGeneratorTarget::GetCompileDefinitions( { UNORDERED_SET uniqueOptions; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "COMPILE_DEFINITIONS", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "COMPILE_DEFINITIONS", CM_NULLPTR, CM_NULLPTR); std::vector debugProperties; const char* debugProp = @@ -2796,8 +2797,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName, this->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules, // and then only when the platform supports an soname flag. - version = 0; - soversion = 0; + version = CM_NULLPTR; + soversion = CM_NULLPTR; } if (version && !soversion) { // The soversion must be set if the library version is set. Use @@ -2871,7 +2872,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name, const char* version = this->GetProperty("VERSION"); if (this->GetType() != cmState::EXECUTABLE || this->Makefile->IsOn("XCODE")) { - version = 0; + version = CM_NULLPTR; } #endif @@ -2971,7 +2972,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, : this->GetProperty("PREFIX")); const char* targetSuffix = (implib ? this->GetProperty("IMPORT_SUFFIX") : this->GetProperty("SUFFIX")); - const char* configPostfix = 0; + const char* configPostfix = CM_NULLPTR; if (!config.empty()) { std::string configProp = cmSystemTools::UpperCase(config); configProp += "_POSTFIX"; @@ -2979,7 +2980,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, // Mac application bundles and frameworks have no postfix. if (configPostfix && (this->IsAppBundleOnApple() || this->IsFrameworkOnApple())) { - configPostfix = 0; + configPostfix = CM_NULLPTR; } } const char* prefixVar = this->Target->GetPrefixVariableInternal(implib); @@ -3013,14 +3014,14 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, fw_prefix = this->GetOutputName(config, false); fw_prefix += ".framework/"; targetPrefix = fw_prefix.c_str(); - targetSuffix = 0; + targetSuffix = CM_NULLPTR; } if (this->IsCFBundleOnApple()) { fw_prefix = this->GetCFBundleDirectory(config, false); fw_prefix += "/"; targetPrefix = fw_prefix.c_str(); - targetSuffix = 0; + targetSuffix = CM_NULLPTR; } // Begin the final name with the prefix. @@ -3269,7 +3270,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt, switch (t) { case BoolType: assert(0 && "String compatibility check function called for boolean"); - return 0; + return CM_NULLPTR; case StringType: return tgt->GetLinkInterfaceDependentStringProperty(prop, config); case NumberMinType: @@ -3278,7 +3279,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt, return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config); } assert(0 && "Unreachable!"); - return 0; + return CM_NULLPTR; } template @@ -3316,7 +3317,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, } if (emitted.insert(*pi).second) { getLinkInterfaceDependentProperty(depender, *pi, config, t, - 0); + CM_NULLPTR); if (cmSystemTools::GetErrorOccuredFlag()) { return; } @@ -3394,24 +3395,25 @@ void cmGeneratorTarget::CheckPropertyCompatibility( } checkPropertyConsistency(this, li->Target, strBool, emittedBools, - config, BoolType, 0); + config, BoolType, CM_NULLPTR); if (cmSystemTools::GetErrorOccuredFlag()) { return; } - checkPropertyConsistency( - this, li->Target, strString, emittedStrings, config, StringType, 0); + checkPropertyConsistency(this, li->Target, strString, + emittedStrings, config, StringType, + CM_NULLPTR); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency(this, li->Target, strNumMin, emittedMinNumbers, config, - NumberMinType, 0); + NumberMinType, CM_NULLPTR); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency(this, li->Target, strNumMax, emittedMaxNumbers, config, - NumberMaxType, 0); + NumberMaxType, CM_NULLPTR); if (cmSystemTools::GetErrorOccuredFlag()) { return; } @@ -3544,7 +3546,7 @@ std::pair consistentStringProperty(const char* lhs, const char* rhs) { const bool b = strcmp(lhs, rhs) == 0; - return std::make_pair(b, b ? lhs : 0); + return std::make_pair(b, b ? lhs : CM_NULLPTR); } std::pair consistentNumberProperty(const char* lhs, @@ -3553,7 +3555,7 @@ std::pair consistentNumberProperty(const char* lhs, { char* pEnd; - const char* const null_ptr = 0; + const char* const null_ptr = CM_NULLPTR; long lnum = strtol(lhs, &pEnd, 0); if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) { @@ -3587,7 +3589,7 @@ std::pair consistentProperty(const char* lhs, return std::make_pair(true, lhs); } - const char* const null_ptr = 0; + const char* const null_ptr = CM_NULLPTR; switch (t) { case BoolType: @@ -3758,28 +3760,28 @@ bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility(this, p, config, "FALSE", - BoolType, 0); + BoolType, CM_NULLPTR); } const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility( - this, p, config, "empty", StringType, 0); + this, p, config, "empty", StringType, CM_NULLPTR); } const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility( - this, p, config, "empty", NumberMinType, 0); + this, p, config, "empty", NumberMinType, CM_NULLPTR); } const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility( - this, p, config, "empty", NumberMaxType, 0); + this, p, config, "empty", NumberMaxType, CM_NULLPTR); } cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( @@ -3794,7 +3796,7 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( new cmComputeLinkInformation(this, config); if (!info || !info->Compute()) { delete info; - info = 0; + info = CM_NULLPTR; } // Store the information for this configuration. @@ -3971,7 +3973,8 @@ void cmGeneratorTarget::ExpandLinkItems( std::vector& items, bool& hadHeadSensitiveCondition) const { cmGeneratorExpression ge; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0); + cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, CM_NULLPTR, + CM_NULLPTR); // The $ expression may be in a link interface to specify private // link dependencies that are otherwise excluded from usage requirements. if (usage_requirements_only) { @@ -3999,7 +4002,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface( // export symbols. if (this->GetType() == cmState::EXECUTABLE && !this->IsExecutableWithExports()) { - return 0; + return CM_NULLPTR; } // Lookup any existing link interface for this configuration. @@ -4023,7 +4026,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface( } } - return iface.Exists ? &iface : 0; + return iface.Exists ? &iface : CM_NULLPTR; } void cmGeneratorTarget::ComputeLinkInterface( @@ -4115,7 +4118,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries( // export symbols. if (this->GetType() == cmState::EXECUTABLE && !this->IsExecutableWithExports()) { - return 0; + return CM_NULLPTR; } // Lookup any existing link interface for this configuration. @@ -4138,7 +4141,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries( usage_requirements_only); } - return iface.Exists ? &iface : 0; + return iface.Exists ? &iface : CM_NULLPTR; } std::string cmGeneratorTarget::GetDirectory(const std::string& config, @@ -4167,7 +4170,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( { // There is no output information for imported targets. if (this->IsImported()) { - return 0; + return CM_NULLPTR; } // Only libraries and executables have well-defined output files. @@ -4177,7 +4180,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( msg += " which has type "; msg += cmState::GetTargetTypeName(this->GetType()); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); - return 0; + return CM_NULLPTR; } // Lookup/compute/cache the output information for this configuration. @@ -4208,7 +4211,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( cmake::FATAL_ERROR, "Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.", this->GetBacktrace()); - return 0; + return CM_NULLPTR; } return &i->second; } @@ -4222,7 +4225,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, // Look for a target property defining the target output directory // based on the target type. std::string targetTypeName = this->GetOutputTargetType(implib); - const char* propertyName = 0; + const char* propertyName = CM_NULLPTR; std::string propertyNameStr = targetTypeName; if (!propertyNameStr.empty()) { propertyNameStr += "_OUTPUT_DIRECTORY"; @@ -4231,7 +4234,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(conf); - const char* configProp = 0; + const char* configProp = CM_NULLPTR; std::string configPropStr = targetTypeName; if (!configPropStr.empty()) { configPropStr += "_OUTPUT_DIRECTORY_"; @@ -4299,7 +4302,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, { // Look for a target property defining the target output directory // based on the target type. - const char* propertyName = 0; + const char* propertyName = CM_NULLPTR; std::string propertyNameStr = kind; if (!propertyNameStr.empty()) { propertyNameStr += "_OUTPUT_DIRECTORY"; @@ -4309,7 +4312,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(conf); - const char* configProp = 0; + const char* configProp = CM_NULLPTR; std::string configPropStr = kind; if (!configPropStr.empty()) { configPropStr += "_OUTPUT_DIRECTORY_"; @@ -4367,7 +4370,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // An explicit list of interface libraries may be set for shared // libraries and executables that export symbols. - const char* explicitLibraries = 0; + const char* explicitLibraries = CM_NULLPTR; std::string linkIfaceProp; if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD && this->GetPolicyStatusCMP0022() != cmPolicies::WARN) { @@ -4493,7 +4496,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface( { cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config); if (!info) { - return 0; + return CM_NULLPTR; } std::string CONFIG = cmSystemTools::UpperCase(config); @@ -4529,7 +4532,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( { // There is no imported information for non-imported targets. if (!this->IsImported()) { - return 0; + return CM_NULLPTR; } // Lookup/compute/cache the import information for this @@ -4555,7 +4558,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( // If the location is empty then the target is not available for // this configuration. if (i->second.Location.empty() && i->second.ImportLibrary.empty()) { - return 0; + return CM_NULLPTR; } // Return the import information. @@ -4572,8 +4575,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Initialize members. info.NoSOName = false; - const char* loc = 0; - const char* imp = 0; + const char* loc = CM_NULLPTR; + const char* imp = CM_NULLPTR; std::string suffix; if (!this->Target->GetMappedConfig(desired_config, &loc, &imp, suffix)) { return; @@ -4715,7 +4718,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation( { // There is no link implementation for imported targets. if (this->IsImported()) { - return 0; + return CM_NULLPTR; } std::string CONFIG = cmSystemTools::UpperCase(config); @@ -4944,7 +4947,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal( { // There is no link implementation for imported targets. if (this->IsImported()) { - return 0; + return CM_NULLPTR; } // Populate the link implementation libraries for this configuration. @@ -4984,8 +4987,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( end = entryRange.end(); le != end; ++le, ++btIt) { std::vector llibs; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "LINK_LIBRARIES", 0, 0); + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "LINK_LIBRARIES", CM_NULLPTR, CM_NULLPTR); cmGeneratorExpression ge(*btIt); cmsys::auto_ptr const cge = ge.Parse(*le); std::string const evaluated = @@ -5078,7 +5081,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink( // within the project. if (tgt && tgt->GetType() == cmState::EXECUTABLE && !tgt->IsExecutableWithExports()) { - tgt = 0; + tgt = CM_NULLPTR; } if (tgt && tgt->GetType() == cmState::OBJECT_LIBRARY) { @@ -5092,7 +5095,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink( "with the ENABLE_EXPORTS property set."; cmake* cm = this->LocalGenerator->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace()); - tgt = 0; + tgt = CM_NULLPTR; } return tgt; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 2ee9bef..f9987aa 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -215,7 +215,7 @@ public: bool contentOnly = true) const; /** @return the mac content directory for this target. */ - std::string GetMacContentDirectory(const std::string& config = 0, + std::string GetMacContentDirectory(const std::string& config = CM_NULLPTR, bool implib = false) const; cmTarget* Target; @@ -402,7 +402,7 @@ public: { SourceFileFlags() : Type(SourceFileTypeNormal) - , MacFolder(0) + , MacFolder(CM_NULLPTR) { } SourceFileFlags(SourceFileFlags const& r) @@ -453,7 +453,7 @@ public: /** Convert the given GNU import library name (.dll.a) to a name with a new extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */ bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out, - const char* newExt = 0) const; + const char* newExt = CM_NULLPTR) const; bool IsExecutableWithExports() const; diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 331aab9..c89d030 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -42,7 +42,7 @@ bool cmGetCMakePropertyCommand::InitialPass( this->Makefile->GetGlobalGenerator()->GetInstallComponents(); output = cmJoin(*components, ";"); } else { - const char* prop = 0; + const char* prop = CM_NULLPTR; if (!args[1].empty()) { prop = this->Makefile->GetState()->GetGlobalProperty(args[1]); } diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 1b5bcc9..a331e78 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -73,7 +73,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass( return true; } - const char* prop = 0; + const char* prop = CM_NULLPTR; if (!i->empty()) { if (*i == "DEFINITIONS") { switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0059)) { diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 06f7504..7c49c9a 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -323,7 +323,7 @@ bool cmGetPropertyCommand::HandleCacheMode() return false; } - const char* value = 0; + const char* value = CM_NULLPTR; if (this->Makefile->GetState()->GetCacheEntryValue(this->Name)) { value = this->Makefile->GetState()->GetCacheEntryProperty( this->Name, this->PropertyName); @@ -347,7 +347,7 @@ bool cmGetPropertyCommand::HandleInstallMode() std::string value; bool isSet = file->GetProperty(this->PropertyName, value); - return this->StoreResult(isSet ? value.c_str() : 0); + return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR); } else { std::ostringstream e; e << "given INSTALL name that could not be found or created: " diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx index e64befe..7b30a7d 100644 --- a/Source/cmGetSourceFilePropertyCommand.cxx +++ b/Source/cmGetSourceFilePropertyCommand.cxx @@ -34,7 +34,7 @@ bool cmGetSourceFilePropertyCommand::InitialPass( this->Makefile->AddDefinition(var, sf->GetLanguage().c_str()); return true; } - const char* prop = 0; + const char* prop = CM_NULLPTR; if (!args[2].empty()) { prop = sf->GetPropertyForUser(args[2]); } diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index dded9f7..228ec69 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -33,7 +33,7 @@ bool cmGetTargetPropertyCommand::InitialPass( } } else if (cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) { cmTarget& target = *tgt; - const char* prop_cstr = 0; + const char* prop_cstr = CM_NULLPTR; if (!args[2].empty()) { prop_cstr = target.GetProperty(args[2], this->Makefile); } diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index 6599021..5eaf872 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -27,7 +27,7 @@ bool cmGetTestPropertyCommand::InitialPass( std::string var = args[2]; cmTest* test = this->Makefile->GetTest(testName); if (test) { - const char* prop = 0; + const char* prop = CM_NULLPTR; if (!args[1].empty()) { prop = test->GetProperty(args[1]); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 536c5d2..3ec16c0 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -81,9 +81,9 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm) // how long to let try compiles run this->TryCompileTimeout = 0; - this->ExtraGenerator = 0; - this->CurrentMakefile = 0; - this->TryCompileOuterMakefile = 0; + this->ExtraGenerator = CM_NULLPTR; + this->CurrentMakefile = CM_NULLPTR; + this->TryCompileOuterMakefile = CM_NULLPTR; this->ConfigureDoneCMP0026AndCMP0024 = false; @@ -242,7 +242,7 @@ bool cmGlobalGenerator::GenerateImportFile(const std::string& file) } delete it->second; - it->second = 0; + it->second = CM_NULLPTR; this->BuildExportSets.erase(it); return result; } @@ -1081,7 +1081,7 @@ void cmGlobalGenerator::Configure() std::ostringstream msg; if (cmSystemTools::GetErrorOccuredFlag()) { msg << "Configuring incomplete, errors occurred!"; - const char* logs[] = { "CMakeOutput.log", "CMakeError.log", 0 }; + const char* logs[] = { "CMakeOutput.log", "CMakeError.log", CM_NULLPTR }; for (const char** log = logs; *log; ++log) { std::string f = this->CMakeInstance->GetHomeOutputDirectory(); f += this->CMakeInstance->GetCMakeFilesDirectory(); @@ -1128,7 +1128,7 @@ cmExportBuildFileGenerator* cmGlobalGenerator::GetExportedTargetsFile( { std::map::const_iterator it = this->BuildExportSets.find(filename); - return it == this->BuildExportSets.end() ? 0 : it->second; + return it == this->BuildExportSets.end() ? CM_NULLPTR : it->second; } void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target) @@ -1269,7 +1269,7 @@ void cmGlobalGenerator::Generate() "Generating", (static_cast(i) + 1.0f) / static_cast(this->LocalGenerators.size())); } - this->SetCurrentMakefile(0); + this->SetCurrentMakefile(CM_NULLPTR); if (!this->GenerateCPackPropertiesFile()) { this->GetCMakeInstance()->IssueMessage( @@ -1291,7 +1291,7 @@ void cmGlobalGenerator::Generate() this->WriteSummary(); - if (this->ExtraGenerator != 0) { + if (this->ExtraGenerator != CM_NULLPTR) { this->ExtraGenerator->Generate(); } @@ -1698,7 +1698,8 @@ int cmGlobalGenerator::Build(const std::string&, const std::string& bindir, output += "\n"; if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr, outputPtr, - &retVal, 0, outputflag, timeout)) { + &retVal, CM_NULLPTR, outputflag, + timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); output += *outputPtr; @@ -1718,7 +1719,8 @@ int cmGlobalGenerator::Build(const std::string&, const std::string& bindir, output += "\n"; if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr, outputPtr, - &retVal, 0, outputflag, timeout)) { + &retVal, CM_NULLPTR, outputflag, + timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( "Generator: execution of make failed. Make command was: ", @@ -1945,7 +1947,7 @@ cmMakefile* cmGlobalGenerator::FindMakefile(const std::string& start_dir) const return *it; } } - return 0; + return CM_NULLPTR; } ///! Find a local generator by its startdirectory @@ -1960,7 +1962,7 @@ cmLocalGenerator* cmGlobalGenerator::FindLocalGenerator( return *it; } } - return 0; + return CM_NULLPTR; } void cmGlobalGenerator::AddAlias(const std::string& name, @@ -1994,7 +1996,7 @@ cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const if (i != this->TargetSearchIndex.end()) { return i->second; } - return 0; + return CM_NULLPTR; } cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl( @@ -2005,7 +2007,7 @@ cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl( if (i != this->GeneratorTargetSearchIndex.end()) { return i->second; } - return 0; + return CM_NULLPTR; } cmTarget* cmGlobalGenerator::FindTarget(const std::string& name, @@ -2135,7 +2137,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); (*targets)[this->GetTestTargetName()] = this->CreateGlobalTarget(this->GetTestTargetName(), "Running tests...", - &cpackCommandLines, depends, 0, + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); } @@ -2156,7 +2158,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); (*targets)[editCacheTargetName] = this->CreateGlobalTarget( editCacheTargetName, "Running CMake cache editor...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ true); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); } else { singleLine.push_back(cmSystemTools::GetCMakeCommand()); singleLine.push_back("-E"); @@ -2165,7 +2167,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); (*targets)[editCacheTargetName] = this->CreateGlobalTarget( editCacheTargetName, "No interactive CMake dialog available...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ false); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ false); } } @@ -2182,7 +2184,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); (*targets)[rebuildCacheTargetName] = this->CreateGlobalTarget( rebuildCacheTargetName, "Running CMake to regenerate build system...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ true); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); } // Install @@ -2208,7 +2210,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) singleLine.push_back(ostr.str()); (*targets)["list_install_components"] = this->CreateGlobalTarget( "list_install_components", ostr.str().c_str(), &cpackCommandLines, - depends, 0, /*uses_terminal*/ false); + depends, CM_NULLPTR, /*uses_terminal*/ false); } std::string cmd = cmSystemTools::GetCMakeCommand(); cpackCommandLines.erase(cpackCommandLines.begin(), @@ -2249,7 +2251,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); (*targets)[this->GetInstallTargetName()] = this->CreateGlobalTarget( this->GetInstallTargetName(), "Install the project...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ true); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); // install_local if (const char* install_local = this->GetInstallLocalTargetName()) { @@ -2263,12 +2265,12 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_local] = this->CreateGlobalTarget( install_local, "Installing only the local directory...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ true); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); } // install_strip const char* install_strip = this->GetInstallStripTargetName(); - if ((install_strip != 0) && (mf->IsSet("CMAKE_STRIP"))) { + if ((install_strip != CM_NULLPTR) && (mf->IsSet("CMAKE_STRIP"))) { cmCustomCommandLine stripCmdLine = singleLine; stripCmdLine.insert(stripCmdLine.begin() + 1, @@ -2279,7 +2281,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_strip] = this->CreateGlobalTarget( install_strip, "Installing the project stripped...", - &cpackCommandLines, depends, 0, /*uses_terminal*/ true); + &cpackCommandLines, depends, CM_NULLPTR, /*uses_terminal*/ true); } } } @@ -2327,8 +2329,8 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget( std::vector no_byproducts; std::vector no_depends; // Store the custom command in the target. - cmCustomCommand cc(0, no_outputs, no_byproducts, no_depends, *commandLines, - 0, workingDirectory); + cmCustomCommand cc(CM_NULLPTR, no_outputs, no_byproducts, no_depends, + *commandLines, CM_NULLPTR, workingDirectory); cc.SetUsesTerminal(uses_terminal); target.AddPostBuildCommand(cc); target.SetProperty("EchoString", message); @@ -2406,7 +2408,7 @@ void cmGlobalGenerator::SetExternalMakefileProjectGenerator( cmExternalMakefileProjectGenerator* extraGenerator) { this->ExtraGenerator = extraGenerator; - if (this->ExtraGenerator != 0) { + if (this->ExtraGenerator != CM_NULLPTR) { this->ExtraGenerator->SetGlobalGenerator(this); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 789e515..089a637 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -277,15 +277,15 @@ public: virtual const char* GetAllTargetName() const { return "ALL_BUILD"; } virtual const char* GetInstallTargetName() const { return "INSTALL"; } - virtual const char* GetInstallLocalTargetName() const { return 0; } - virtual const char* GetInstallStripTargetName() const { return 0; } - virtual const char* GetPreinstallTargetName() const { return 0; } + virtual const char* GetInstallLocalTargetName() const { return CM_NULLPTR; } + virtual const char* GetInstallStripTargetName() const { return CM_NULLPTR; } + virtual const char* GetPreinstallTargetName() const { return CM_NULLPTR; } virtual const char* GetTestTargetName() const { return "RUN_TESTS"; } virtual const char* GetPackageTargetName() const { return "PACKAGE"; } - virtual const char* GetPackageSourceTargetName() const { return 0; } - virtual const char* GetEditCacheTargetName() const { return 0; } - virtual const char* GetRebuildCacheTargetName() const { return 0; } - virtual const char* GetCleanTargetName() const { return 0; } + virtual const char* GetPackageSourceTargetName() const { return CM_NULLPTR; } + virtual const char* GetEditCacheTargetName() const { return CM_NULLPTR; } + virtual const char* GetRebuildCacheTargetName() const { return CM_NULLPTR; } + virtual const char* GetCleanTargetName() const { return CM_NULLPTR; } // Lookup edit_cache target command preferred by this generator. virtual std::string GetEditCacheCommand() const { return ""; } @@ -503,7 +503,7 @@ private: void ClearGeneratorMembers(); - virtual const char* GetBuildIgnoreErrorsFlag() const { return 0; } + virtual const char* GetBuildIgnoreErrorsFlag() const { return CM_NULLPTR; } // Cache directory content and target files to be built. struct DirectoryContent diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 40678da..6787519 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -52,7 +52,7 @@ public: cmake* cm) const CM_OVERRIDE { if (name != T::GetActualName()) { - return 0; + return CM_NULLPTR; } return new T(cm); } diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 68a2538..bbd6baa 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -111,13 +111,13 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( // make sure the file is part of this source tree if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - 0)) { + CM_NULLPTR)) { files.insert(tmp); tmp = cmSystemTools::GetFilenameName(tmp); // add all files which dont match the default // */CMakeLists.txt;*cmake; to the file pattern if ((tmp != "CMakeLists.txt") && - (strstr(tmp.c_str(), ".cmake") == 0)) { + (strstr(tmp.c_str(), ".cmake") == CM_NULLPTR)) { cmakeFilePattern += tmp + ";"; } } @@ -142,7 +142,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - 0) && + CM_NULLPTR) && (cmSystemTools::GetFilenameExtension(tmp) != ".moc")) { files.insert(tmp); @@ -166,7 +166,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - 0)) { + CM_NULLPTR)) { files.insert(tmp); } } @@ -296,12 +296,12 @@ void cmGlobalKdevelopGenerator::MergeProjectFiles( it != lines.end(); it++) { const char* line = (*it).c_str(); // skip these tags as they are always replaced - if ((strstr(line, "") != 0) || - (strstr(line, "") != 0) || - (strstr(line, "") != 0) || - (strstr(line, "") != 0) || - (strstr(line, "") != 0) || - (strstr(line, "") != 0)) { + if ((strstr(line, "") != CM_NULLPTR) || + (strstr(line, "") != CM_NULLPTR) || + (strstr(line, "") != CM_NULLPTR) || + (strstr(line, "") != CM_NULLPTR) || + (strstr(line, "") != CM_NULLPTR) || + (strstr(line, "") != CM_NULLPTR)) { continue; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 3aec630..91f08e6 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -443,9 +443,9 @@ void cmGlobalNinjaGenerator::WriteDefault(std::ostream& os, cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) : cmGlobalCommonGenerator(cm) - , BuildFileStream(0) - , RulesFileStream(0) - , CompileCommandsStream(0) + , BuildFileStream(CM_NULLPTR) + , RulesFileStream(CM_NULLPTR) + , CompileCommandsStream(CM_NULLPTR) , Rules() , AllDependencies() , UsingGCCOnWindows(false) @@ -531,8 +531,8 @@ void cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf) command.push_back(this->NinjaCommand); command.push_back("--version"); std::string version; - cmSystemTools::RunSingleCommand(command, &version, 0, 0, 0, - cmSystemTools::OUTPUT_NONE); + cmSystemTools::RunSingleCommand(command, &version, CM_NULLPTR, CM_NULLPTR, + CM_NULLPTR, cmSystemTools::OUTPUT_NONE); this->NinjaVersion = cmSystemTools::TrimWhitespace(version); } } @@ -676,7 +676,7 @@ void cmGlobalNinjaGenerator::CloseBuildFileStream() { if (this->BuildFileStream) { delete this->BuildFileStream; - this->BuildFileStream = 0; + this->BuildFileStream = CM_NULLPTR; } else { cmSystemTools::Error("Build file stream was not open."); } @@ -717,7 +717,7 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream() { if (this->RulesFileStream) { delete this->RulesFileStream; - this->RulesFileStream = 0; + this->RulesFileStream = CM_NULLPTR; } else { cmSystemTools::Error("Rules file stream was not open."); } @@ -805,7 +805,7 @@ void cmGlobalNinjaGenerator::CloseCompileCommandsStream() if (this->CompileCommandsStream) { *this->CompileCommandsStream << "\n]"; delete this->CompileCommandsStream; - this->CompileCommandsStream = 0; + this->CompileCommandsStream = CM_NULLPTR; } } @@ -914,7 +914,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, // Mark the target's outputs as ambiguous to ensure that no other target uses // the output as an alias. for (cmNinjaDeps::iterator i = outputs.begin(); i != outputs.end(); ++i) { - TargetAliases[*i] = 0; + TargetAliases[*i] = CM_NULLPTR; } // Insert the alias into the map. If the alias was already present in the @@ -922,7 +922,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, std::pair newAlias = TargetAliases.insert(std::make_pair(buildAlias, target)); if (newAlias.second && newAlias.first->second != target) { - newAlias.first->second = 0; + newAlias.first->second = CM_NULLPTR; } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index ea51fbf..69ec6ca 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -93,7 +93,7 @@ public: const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables, const std::string& rspfile = std::string(), - int cmdLineLimit = 0, bool* usedResponseFile = 0); + int cmdLineLimit = 0, bool* usedResponseFile = CM_NULLPTR); /** * Helper to write a build statement with the special 'phony' rule. diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index cc5d1ba..f115ecb 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -32,7 +32,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) #else this->UseLinkScript = true; #endif - this->CommandDatabase = NULL; + this->CommandDatabase = CM_NULLPTR; this->IncludeDirective = "include"; this->DefineWindowsNULL = false; @@ -155,10 +155,10 @@ void cmGlobalUnixMakefileGenerator3::Generate() this->WriteMainMakefile2(); this->WriteMainCMakefile(); - if (this->CommandDatabase != NULL) { + if (this->CommandDatabase != CM_NULLPTR) { *this->CommandDatabase << std::endl << "]"; delete this->CommandDatabase; - this->CommandDatabase = NULL; + this->CommandDatabase = CM_NULLPTR; } } @@ -166,7 +166,7 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( const std::string& sourceFile, const std::string& workingDirectory, const std::string& compileCommand) { - if (this->CommandDatabase == NULL) { + if (this->CommandDatabase == CM_NULLPTR) { std::string commandDatabaseName = std::string(this->GetCMakeInstance()->GetHomeOutputDirectory()) + "/compile_commands.json"; diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 3963cf8..ed35ecd 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -149,7 +149,7 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName) for (std::map::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == NULL) { + if (ptrIt->second == CM_NULLPTR) { continue; } @@ -193,7 +193,7 @@ void cmGraphVizWriter::WritePerTargetFiles(const char* fileName) for (std::map::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == NULL) { + if (ptrIt->second == CM_NULLPTR) { continue; } @@ -239,7 +239,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName) for (std::map::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == NULL) { + if (ptrIt->second == CM_NULLPTR) { continue; } @@ -278,7 +278,7 @@ void cmGraphVizWriter::WriteConnections( this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - if (targetPtrIt->second == NULL) // it's an external library + if (targetPtrIt->second == CM_NULLPTR) // it's an external library { return; } @@ -329,7 +329,7 @@ void cmGraphVizWriter::WriteDependerConnections( this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - if (targetPtrIt->second == NULL) // it's an external library + if (targetPtrIt->second == CM_NULLPTR) // it's an external library { return; } @@ -340,7 +340,7 @@ void cmGraphVizWriter::WriteDependerConnections( for (std::map::const_iterator dependerIt = this->TargetPtrs.begin(); dependerIt != this->TargetPtrs.end(); ++dependerIt) { - if (dependerIt->second == NULL) { + if (dependerIt->second == CM_NULLPTR) { continue; } @@ -468,7 +468,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); - this->TargetPtrs[libName] = NULL; + this->TargetPtrs[libName] = CM_NULLPTR; // str << " \"" << ostr << "\" [ label=\"" << libName // << "\" shape=\"ellipse\"];" << std::endl; } diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index 9609e95..34fd626 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -28,7 +28,7 @@ static bool cm_IsHexChar(char c) static unsigned int ChompStrlen(const char* line) { - if (line == 0) { + if (line == CM_NULLPTR) { return 0; } unsigned int length = static_cast(strlen(line)); @@ -144,7 +144,7 @@ cmHexFileConverter::FileType cmHexFileConverter::DetermineFileType( { char buf[1024]; FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb"); - if (inFile == 0) { + if (inFile == CM_NULLPTR) { return Binary; } @@ -193,11 +193,11 @@ bool cmHexFileConverter::TryConvert(const char* inFileName, // try to open the file FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb"); FILE* outFile = cmsys::SystemTools::Fopen(outFileName, "wb"); - if ((inFile == 0) || (outFile == 0)) { - if (inFile != 0) { + if ((inFile == CM_NULLPTR) || (outFile == CM_NULLPTR)) { + if (inFile != CM_NULLPTR) { fclose(inFile); } - if (outFile != 0) { + if (outFile != CM_NULLPTR) { fclose(outFile); } return false; @@ -206,7 +206,7 @@ bool cmHexFileConverter::TryConvert(const char* inFileName, // convert them line by line bool success = false; char buf[1024]; - while (fgets(buf, 1024, inFile) != 0) { + while (fgets(buf, 1024, inFile) != CM_NULLPTR) { if (type == MotorolaSrec) { success = ConvertMotorolaSrecLine(buf, outFile); } else if (type == IntelHex) { diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index cb9b74d..360ebeb 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -77,7 +77,7 @@ bool cmIncludeCommand::InitialPass(std::vector const& args, cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator(); if (gg->IsExportedTargetsFile(fname_abs)) { - const char* modal = 0; + const char* modal = CM_NULLPTR; std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index e9de8df..86ab85a 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -186,7 +186,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) cmCommandArgumentsHelper argHelper; cmCommandArgumentGroup group; - cmCAStringVector genericArgVector(&argHelper, 0); + cmCAStringVector genericArgVector(&argHelper, CM_NULLPTR); cmCAStringVector archiveArgVector(&argHelper, "ARCHIVE", &group); cmCAStringVector libraryArgVector(&argHelper, "LIBRARY", &group); cmCAStringVector runtimeArgVector(&argHelper, "RUNTIME", &group); @@ -197,10 +197,10 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) &group); cmCAStringVector publicHeaderArgVector(&argHelper, "PUBLIC_HEADER", &group); cmCAStringVector resourceArgVector(&argHelper, "RESOURCE", &group); - genericArgVector.Follows(0); + genericArgVector.Follows(CM_NULLPTR); group.Follows(&genericArgVector); - argHelper.Parse(&args, 0); + argHelper.Parse(&args, CM_NULLPTR); // now parse the generic args (i.e. the ones not specialized on LIBRARY/ // ARCHIVE, RUNTIME etc. (see above) @@ -210,7 +210,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) cmCAStringVector targetList(&genericArgs.Parser, "TARGETS"); cmCAString exports(&genericArgs.Parser, "EXPORT", &genericArgs.ArgumentGroup); - targetList.Follows(0); + targetList.Follows(CM_NULLPTR); genericArgs.ArgumentGroup.Follows(&targetList); genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs); bool success = genericArgs.Finalize(); @@ -373,14 +373,14 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) ti != targets.end(); ++ti) { // Handle each target type. cmTarget& target = *(*ti); - cmInstallTargetGenerator* archiveGenerator = 0; - cmInstallTargetGenerator* libraryGenerator = 0; - cmInstallTargetGenerator* runtimeGenerator = 0; - cmInstallTargetGenerator* frameworkGenerator = 0; - cmInstallTargetGenerator* bundleGenerator = 0; - cmInstallFilesGenerator* privateHeaderGenerator = 0; - cmInstallFilesGenerator* publicHeaderGenerator = 0; - cmInstallFilesGenerator* resourceGenerator = 0; + cmInstallTargetGenerator* archiveGenerator = CM_NULLPTR; + cmInstallTargetGenerator* libraryGenerator = CM_NULLPTR; + cmInstallTargetGenerator* runtimeGenerator = CM_NULLPTR; + cmInstallTargetGenerator* frameworkGenerator = CM_NULLPTR; + cmInstallTargetGenerator* bundleGenerator = CM_NULLPTR; + cmInstallFilesGenerator* privateHeaderGenerator = CM_NULLPTR; + cmInstallFilesGenerator* publicHeaderGenerator = CM_NULLPTR; + cmInstallFilesGenerator* resourceGenerator = CM_NULLPTR; // Track whether this is a namelink-only rule. bool namelinkOnly = false; @@ -407,7 +407,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) runtimeGenerator = CreateInstallTargetGenerator(target, runtimeArgs, false); } - if ((archiveGenerator == 0) && (runtimeGenerator == 0)) { + if ((archiveGenerator == CM_NULLPTR) && + (runtimeGenerator == CM_NULLPTR)) { this->SetError("Library TARGETS given no DESTINATION!"); return false; } @@ -621,14 +622,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } // Keep track of whether we're installing anything in each category - installsArchive = installsArchive || archiveGenerator != 0; - installsLibrary = installsLibrary || libraryGenerator != 0; - installsRuntime = installsRuntime || runtimeGenerator != 0; - installsFramework = installsFramework || frameworkGenerator != 0; - installsBundle = installsBundle || bundleGenerator != 0; + installsArchive = installsArchive || archiveGenerator != CM_NULLPTR; + installsLibrary = installsLibrary || libraryGenerator != CM_NULLPTR; + installsRuntime = installsRuntime || runtimeGenerator != CM_NULLPTR; + installsFramework = installsFramework || frameworkGenerator != CM_NULLPTR; + installsBundle = installsBundle || bundleGenerator != CM_NULLPTR; installsPrivateHeader = - installsPrivateHeader || privateHeaderGenerator != 0; - installsPublicHeader = installsPublicHeader || publicHeaderGenerator != 0; + installsPrivateHeader || privateHeaderGenerator != CM_NULLPTR; + installsPublicHeader = + installsPublicHeader || publicHeaderGenerator != CM_NULLPTR; installsResource = installsResource || resourceGenerator; this->Makefile->AddInstallGenerator(archiveGenerator); @@ -704,7 +706,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) bool programs = (args[0] == "PROGRAMS"); cmInstallCommandArguments ica(this->DefaultComponentName); cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES"); - files.Follows(0); + files.Follows(CM_NULLPTR); ica.ArgumentGroup.Follows(&files); std::vector unknownArgs; ica.Parse(&args, &unknownArgs); @@ -744,7 +746,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) for (std::vector::const_iterator fileIt = filesVector.begin(); fileIt != filesVector.end(); ++fileIt) { if (gg->IsExportedTargetsFile(*fileIt)) { - const char* modal = 0; + const char* modal = CM_NULLPTR; std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; @@ -820,7 +822,7 @@ bool cmInstallCommand::HandleDirectoryMode( bool exclude_from_all = false; bool message_never = false; std::vector dirs; - const char* destination = 0; + const char* destination = CM_NULLPTR; std::string permissions_file; std::string permissions_dir; std::vector configurations; @@ -1103,7 +1105,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES", &ica.ArgumentGroup); cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup); - exp.Follows(0); + exp.Follows(CM_NULLPTR); ica.ArgumentGroup.Follows(&exp); std::vector unknownArgs; diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index 57e37a3..312c50e 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -17,7 +17,7 @@ const char* cmInstallCommandArguments::PermissionsTable[] = { "OWNER_READ", "OWNER_WRITE", "OWNER_EXECUTE", "GROUP_READ", "GROUP_WRITE", "GROUP_EXECUTE", "WORLD_READ", "WORLD_WRITE", - "WORLD_EXECUTE", "SETUID", "SETGID", 0 + "WORLD_EXECUTE", "SETUID", "SETGID", CM_NULLPTR }; const std::string cmInstallCommandArguments::EmptyString; @@ -35,7 +35,7 @@ cmInstallCommandArguments::cmInstallCommandArguments( , Optional(&Parser, "OPTIONAL", &ArgumentGroup) , NamelinkOnly(&Parser, "NAMELINK_ONLY", &ArgumentGroup) , NamelinkSkip(&Parser, "NAMELINK_SKIP", &ArgumentGroup) - , GenericArguments(0) + , GenericArguments(CM_NULLPTR) , DefaultComponentName(defaultComponent) { } @@ -45,7 +45,7 @@ const std::string& cmInstallCommandArguments::GetDestination() const if (!this->DestinationString.empty()) { return this->DestinationString; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetDestination(); } return this->EmptyString; @@ -56,7 +56,7 @@ const std::string& cmInstallCommandArguments::GetComponent() const if (!this->Component.GetString().empty()) { return this->Component.GetString(); } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetComponent(); } if (!this->DefaultComponentName.empty()) { @@ -71,7 +71,7 @@ const std::string& cmInstallCommandArguments::GetRename() const if (!this->Rename.GetString().empty()) { return this->Rename.GetString(); } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetRename(); } return this->EmptyString; @@ -82,7 +82,7 @@ const std::string& cmInstallCommandArguments::GetPermissions() const if (!this->PermissionsString.empty()) { return this->PermissionsString; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetPermissions(); } return this->EmptyString; @@ -93,7 +93,7 @@ bool cmInstallCommandArguments::GetOptional() const if (this->Optional.IsEnabled()) { return true; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetOptional(); } return false; @@ -104,7 +104,7 @@ bool cmInstallCommandArguments::GetExcludeFromAll() const if (this->ExcludeFromAll.IsEnabled()) { return true; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetExcludeFromAll(); } return false; @@ -115,7 +115,7 @@ bool cmInstallCommandArguments::GetNamelinkOnly() const if (this->NamelinkOnly.IsEnabled()) { return true; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetNamelinkOnly(); } return false; @@ -126,7 +126,7 @@ bool cmInstallCommandArguments::GetNamelinkSkip() const if (this->NamelinkSkip.IsEnabled()) { return true; } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetNamelinkSkip(); } return false; @@ -138,7 +138,7 @@ const std::vector& cmInstallCommandArguments::GetConfigurations() if (!this->Configurations.GetVector().empty()) { return this->Configurations.GetVector(); } - if (this->GenericArguments != 0) { + if (this->GenericArguments != CM_NULLPTR) { return this->GenericArguments->GetConfigurations(); } return this->Configurations.GetVector(); diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 671ab4c..a637b25 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -22,7 +22,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( bool optional) : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) - , LocalGenerator(0) + , LocalGenerator(CM_NULLPTR) , Directories(dirs) , FilePermissions(file_permissions) , DirPermissions(dir_permissions) @@ -81,7 +81,7 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule( std::vector const& dirs) { // Write code to install the directories. - const char* no_rename = 0; + const char* no_rename = CM_NULLPTR; this->AddInstallRule(os, this->GetDestination(config), cmInstallType_DIRECTORY, dirs, this->Optional, this->FilePermissions.c_str(), diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 2fef3a8..6250012 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -37,7 +37,7 @@ cmInstallExportGenerator::cmInstallExportGenerator( , FileName(filename) , Namespace(name_space) , ExportOld(exportOld) - , LocalGenerator(0) + , LocalGenerator(CM_NULLPTR) { this->EFGen = new cmExportInstallFileGenerator(this); exportSet->AddInstallation(this); @@ -161,8 +161,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, std::string config_test = this->CreateConfigTest(i->first); os << indent << "if(" << config_test << ")\n"; this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), 0, 0, 0, - indent.Next()); + false, this->FilePermissions.c_str(), CM_NULLPTR, + CM_NULLPTR, CM_NULLPTR, indent.Next()); os << indent << "endif()\n"; files.clear(); } @@ -201,5 +201,6 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os, std::vector files; files.push_back(this->MainImportFile); this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), 0, 0, 0, indent); + false, this->FilePermissions.c_str(), CM_NULLPTR, + CM_NULLPTR, CM_NULLPTR, indent); } diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 8c1b357..8885ef2 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -23,7 +23,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( const char* rename, bool optional) : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) - , LocalGenerator(0) + , LocalGenerator(CM_NULLPTR) , Files(files) , FilePermissions(file_permissions) , Rename(rename) @@ -65,12 +65,12 @@ void cmInstallFilesGenerator::AddFilesInstallRule( std::vector const& files) { // Write code to install the files. - const char* no_dir_permissions = 0; + const char* no_dir_permissions = CM_NULLPTR; this->AddInstallRule( os, this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, this->Optional, this->FilePermissions.c_str(), no_dir_permissions, - this->Rename.c_str(), 0, indent); + this->Rename.c_str(), CM_NULLPTR, indent); } void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index b003e78..ad9fc28 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -39,13 +39,12 @@ public: bool exclude_from_all); ~cmInstallGenerator() CM_OVERRIDE; - void AddInstallRule(std::ostream& os, std::string const& dest, - cmInstallType type, - std::vector const& files, - bool optional = false, const char* permissions_file = 0, - const char* permissions_dir = 0, const char* rename = 0, - const char* literal_args = 0, - Indent const& indent = Indent()); + void AddInstallRule( + std::ostream& os, std::string const& dest, cmInstallType type, + std::vector const& files, bool optional = false, + const char* permissions_file = CM_NULLPTR, + const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR, + const char* literal_args = CM_NULLPTR, Indent const& indent = Indent()); /** Get the install destination as it should appear in the installation script. */ diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 1b0f1d1..76d6b71 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -15,7 +15,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, bool code, const char* component, bool exclude_from_all) - : cmInstallGenerator(0, std::vector(), component, + : cmInstallGenerator(CM_NULLPTR, std::vector(), component, MessageDefault, exclude_from_all) , Script(script) , Code(code) diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index d56bb05..448d278 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -30,7 +30,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator( : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) , TargetName(targetName) - , Target(0) + , Target(CM_NULLPTR) , FilePermissions(file_permissions) , ImportLibrary(implib) , Optional(optional) @@ -294,8 +294,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( &cmInstallTargetGenerator::PreReplacementTweaks); // Write code to install the target file. - const char* no_dir_permissions = 0; - const char* no_rename = 0; + const char* no_dir_permissions = CM_NULLPTR; + const char* no_rename = CM_NULLPTR; bool optional = this->Optional || this->ImportLibrary; this->AddInstallRule(os, this->GetDestination(config), type, filesFrom, optional, this->FilePermissions.c_str(), diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index ed0f74b..bfc5cf1 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -16,7 +16,7 @@ #include "cmSystemTools.h" cmInstalledFile::cmInstalledFile() - : NameExpression(0) + : NameExpression(CM_NULLPTR) { } diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 0fbe093..8aa3981 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -26,7 +26,7 @@ class cmLinkItem : public std::string public: cmLinkItem() : std_string() - , Target(0) + , Target(CM_NULLPTR) { } cmLinkItem(const std_string& n, cmGeneratorTarget const* t) @@ -118,7 +118,7 @@ struct cmOptionalLinkInterface : public cmLinkInterface , AllDone(false) , Exists(false) , HadHeadSensitiveCondition(false) - , ExplicitLibraries(0) + , ExplicitLibraries(CM_NULLPTR) { } bool LibrariesDone; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 1a85396..6b31074 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -56,7 +56,7 @@ public: public: iterator() - : Tree(0) + : Tree(CM_NULLPTR) , Position(0) { } diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 4460418..28b3781 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -71,7 +71,7 @@ bool cmListFileParser::ParseFile() // Verify the Byte-Order-Mark, if any. if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) { - cmListFileLexer_SetFileName(this->Lexer, 0, 0); + cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR); this->IssueFileOpenError( "File starts with a Byte-Order-Mark that is not UTF-8."); return false; @@ -314,13 +314,13 @@ cmListFileBacktrace::cmListFileBacktrace(cmState::Snapshot bottom, Entry* cur) cmListFileBacktrace::cmListFileBacktrace() : Bottom() - , Cur(0) + , Cur(CM_NULLPTR) { } cmListFileBacktrace::cmListFileBacktrace(cmState::Snapshot snapshot) : Bottom(snapshot.GetCallStackBottom()) - , Cur(0) + , Cur(CM_NULLPTR) { } diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index c2a5d46..ddf6ce6 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -94,11 +94,11 @@ public: #endif signal(SIGILL, TrapsForSignalsCFunction); } else { - signal(SIGSEGV, 0); + signal(SIGSEGV, CM_NULLPTR); #ifdef SIGBUS - signal(SIGBUS, 0); + signal(SIGBUS, CM_NULLPTR); #endif - signal(SIGILL, 0); + signal(SIGILL, CM_NULLPTR); } } @@ -112,7 +112,7 @@ extern "C" void TrapsForSignalsCFunction(int sig) cmLoadedCommand::TrapsForSignals(sig); } -const char* cmLoadedCommand::LastName = 0; +const char* cmLoadedCommand::LastName = CM_NULLPTR; bool cmLoadedCommand::InitialPass(std::vector const& args, cmExecutionStatus&) @@ -128,7 +128,7 @@ bool cmLoadedCommand::InitialPass(std::vector const& args, // create argc and argv and then invoke the command int argc = static_cast(args.size()); - char** argv = 0; + char** argv = CM_NULLPTR; if (argc) { argv = (char**)malloc(argc * sizeof(char*)); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0de9895..ff767e6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -272,7 +272,7 @@ void cmLocalGenerator::GenerateInstallRules() // Choose a default install configuration. std::string default_config = config; const char* default_order[] = { "RELEASE", "MINSIZEREL", "RELWITHDEBINFO", - "DEBUG", 0 }; + "DEBUG", CM_NULLPTR }; for (const char** c = default_order; *c && default_config.empty(); ++c) { for (std::vector::iterator i = configurationTypes.begin(); i != configurationTypes.end(); ++i) { @@ -445,7 +445,7 @@ cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( if (ti != this->GeneratorTargets.end()) { return *ti; } - return 0; + return CM_NULLPTR; } void cmLocalGenerator::ComputeTargetManifest() @@ -508,7 +508,7 @@ static const char* ruleReplaceVars[] = { "CMAKE_RANLIB", "CMAKE_LINKER", "CMAKE_CL_SHOWINCLUDES_PREFIX", - 0 + CM_NULLPTR }; std::string cmLocalGenerator::ExpandRuleVariable( @@ -704,13 +704,13 @@ std::string cmLocalGenerator::ExpandRuleVariable( std::string actualReplace = ruleReplaceVars[pos]; // If this is the compiler then look for the extra variable // _COMPILER_ARG1 which must be the first argument to the compiler - const char* compilerArg1 = 0; - const char* compilerTarget = 0; - const char* compilerOptionTarget = 0; - const char* compilerExternalToolchain = 0; - const char* compilerOptionExternalToolchain = 0; - const char* compilerSysroot = 0; - const char* compilerOptionSysroot = 0; + const char* compilerArg1 = CM_NULLPTR; + const char* compilerTarget = CM_NULLPTR; + const char* compilerOptionTarget = CM_NULLPTR; + const char* compilerExternalToolchain = CM_NULLPTR; + const char* compilerOptionExternalToolchain = CM_NULLPTR; + const char* compilerSysroot = CM_NULLPTR; + const char* compilerOptionSysroot = CM_NULLPTR; if (actualReplace == "CMAKE_${LANG}_COMPILER") { std::string arg1 = actualReplace + "_ARG1"; cmSystemTools::ReplaceString(arg1, "${LANG}", lang); @@ -872,7 +872,7 @@ std::string cmLocalGenerator::GetIncludeFlags( // normal flag is repeated for each directory. std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_"; sysFlagVar += lang; - const char* sysIncludeFlag = 0; + const char* sysIncludeFlag = CM_NULLPTR; if (repeatFlag) { sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar); } @@ -1585,7 +1585,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, target->GetAppleArchs(config, archs); const char* sysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); if (sysroot && sysroot[0] == '/' && !sysroot[1]) { - sysroot = 0; + sysroot = CM_NULLPTR; } std::string sysrootFlagVar = std::string("CMAKE_") + lang + "_SYSROOT_FLAG"; @@ -1925,7 +1925,7 @@ void cmLocalGenerator::AddVisibilityPresetFlags( } std::string warnCMP0063; - std::string* pWarnCMP0063 = 0; + std::string* pWarnCMP0063 = CM_NULLPTR; if (target->GetType() != cmState::SHARED_LIBRARY && target->GetType() != cmState::MODULE_LIBRARY && !target->IsExecutableWithExports()) { @@ -2036,7 +2036,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags, std::string const& lang, int targetType) { - const char* picFlags = 0; + const char* picFlags = CM_NULLPTR; if (targetType == cmState::EXECUTABLE) { std::string flagsVar = "CMAKE_"; @@ -2217,7 +2217,7 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature, } snp = snp.GetBuildsystemDirectoryParent(); } - return 0; + return CM_NULLPTR; } std::string cmLocalGenerator::GetProjectName() const @@ -2280,7 +2280,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( // Include the user-specified pre-install script for this target. if (const char* preinstall = (*l)->GetProperty("PRE_INSTALL_SCRIPT")) { - cmInstallScriptGenerator g(preinstall, false, 0, false); + cmInstallScriptGenerator g(preinstall, false, CM_NULLPTR, false); g.Generate(os, config, configurationTypes); } @@ -2333,7 +2333,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( // Include the user-specified post-install script for this target. if (const char* postinstall = (*l)->GetProperty("POST_INSTALL_SCRIPT")) { - cmInstallScriptGenerator g(postinstall, false, 0, false); + cmInstallScriptGenerator g(postinstall, false, CM_NULLPTR, false); g.Generate(os, config, configurationTypes); } } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 66fbe01..fa4bb30 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -300,9 +300,9 @@ public: std::string ConstructComment(cmCustomCommandGenerator const& ccg, const char* default_comment = ""); // Compute object file names. - std::string GetObjectFileNameWithoutTarget(const cmSourceFile& source, - std::string const& dir_max, - bool* hasSourceExtension = 0); + std::string GetObjectFileNameWithoutTarget( + const cmSourceFile& source, std::string const& dir_max, + bool* hasSourceExtension = CM_NULLPTR); /** Fill out the static linker flags for the given target. */ void GetStaticLibraryFlags(std::string& flags, std::string const& config, @@ -329,7 +329,7 @@ public: virtual void ComputeObjectFilenames( std::map& mapping, - cmGeneratorTarget const* gt = 0); + cmGeneratorTarget const* gt = CM_NULLPTR); bool IsWindowsShell() const; bool IsWatcomWMake() const; diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 75da328..6e61087 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -78,7 +78,7 @@ public: void ComputeObjectFilenames( std::map& mapping, - cmGeneratorTarget const* gt = 0) CM_OVERRIDE; + cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE; protected: std::string ConvertToIncludeReference( diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 0478a3a..c6cfa88 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -340,8 +340,8 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule( std::vector depends; depends.push_back(output); std::vector no_commands; - this->WriteMakeRule(ruleFileStream, 0, outNoExt, depends, no_commands, - true, true); + this->WriteMakeRule(ruleFileStream, CM_NULLPTR, outNoExt, depends, + no_commands, true, true); inHelp = false; } @@ -703,8 +703,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop( // Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make. std::vector depends; depends.push_back(".hpux_make_needs_suffix_list"); - this->WriteMakeRule(makefileStream, 0, ".SUFFIXES", depends, no_commands, - false); + this->WriteMakeRule(makefileStream, CM_NULLPTR, ".SUFFIXES", depends, + no_commands, false); if (this->IsWatcomWMake()) { // Switch on WMake feature, if an error or interrupt occurs during // makefile processing, the current target being made may be deleted @@ -1164,7 +1164,7 @@ void cmLocalUnixMakefileGenerator3::AppendEcho( line = ""; // Progress appears only on first line. - progress = 0; + progress = CM_NULLPTR; // Terminate on end-of-string. if (*c == '\0') { @@ -1433,7 +1433,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( std::string lang = *li; // Create the scanner for this language - cmDepends* scanner = 0; + cmDepends* scanner = CM_NULLPTR; if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM") { // TODO: Handle RC (resource files) dependencies correctly. scanner = new cmDependsC(this, targetDir, lang, &validDeps); diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 319a587..42d1d91 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -110,7 +110,8 @@ public: std::string Arg; }; void AppendEcho(std::vector& commands, std::string const& text, - EchoColor color = EchoNormal, EchoProgress const* = 0); + EchoColor color = EchoNormal, + EchoProgress const* = CM_NULLPTR); /** Get whether the makefile is to have color. */ bool GetColorMakefile() const { return this->ColorMakefile; } @@ -236,10 +237,11 @@ protected: std::vector& commands, cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target, bool echo_comment = false, cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT, - std::ostream* content = 0); + std::ostream* content = CM_NULLPTR); void AppendCleanCommand(std::vector& commands, const std::vector& files, - cmGeneratorTarget* target, const char* filename = 0); + cmGeneratorTarget* target, + const char* filename = CM_NULLPTR); // Helper methods for dependeny updates. bool ScanDependencies( @@ -256,7 +258,7 @@ private: void ComputeObjectFilenames( std::map& mapping, - cmGeneratorTarget const* gt = 0) CM_OVERRIDE; + cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE; friend class cmMakefileTargetGenerator; friend class cmMakefileExecutableTargetGenerator; @@ -273,7 +275,7 @@ private: cmGeneratorTarget* Target; std::string Language; LocalObjectEntry() - : Target(0) + : Target(CM_NULLPTR) , Language() { } diff --git a/Source/cmLocale.h b/Source/cmLocale.h index e69c32e..f922c03 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -22,7 +22,7 @@ class cmLocaleRAII public: cmLocaleRAII() - : OldLocale(setlocale(LC_CTYPE, 0)) + : OldLocale(setlocale(LC_CTYPE, CM_NULLPTR)) { setlocale(LC_CTYPE, ""); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e8c1576..eae4258 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -787,7 +787,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( // Make sure there is at least one output. if (outputs.empty()) { cmSystemTools::Error("Attempt to add a custom rule with no output!"); - return 0; + return CM_NULLPTR; } // Validate custom commands. TODO: More strict? @@ -798,12 +798,12 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( std::ostringstream e; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; this->IssueMessage(cmake::FATAL_ERROR, e.str()); - return 0; + return CM_NULLPTR; } } // Choose a source file on which to store the custom command. - cmSourceFile* file = 0; + cmSourceFile* file = CM_NULLPTR; if (!commandLines.empty() && !main_dependency.empty()) { // The main dependency was specified. Use it unless a different // custom command already used it. @@ -817,7 +817,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( } else { // The existing custom command is different. We need to // generate a rule file for this new command. - file = 0; + file = CM_NULLPTR; } } else if (!file) { file = this->CreateSource(main_dependency); @@ -938,7 +938,7 @@ void cmMakefile::AddCustomCommandOldStyle( std::vector no_byproducts; this->AddCustomCommandToTarget(target, no_byproducts, depends, commandLines, cmTarget::POST_BUILD, comment, - 0); + CM_NULLPTR); return; } @@ -956,14 +956,14 @@ void cmMakefile::AddCustomCommandOldStyle( if (sourceFiles.find(source)) { // The source looks like a real file. Use it as the main dependency. sf = this->AddCustomCommandToOutput(output, depends, source, - commandLines, comment, 0); + commandLines, comment, CM_NULLPTR); } else { // The source may not be a real file. Do not use a main dependency. std::string no_main_dependency = ""; std::vector depends2 = depends; depends2.push_back(source); sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency, - commandLines, comment, 0); + commandLines, comment, CM_NULLPTR); } // If the rule was added to the source (and not a .rule file), @@ -1817,8 +1817,8 @@ void cmMakefile::RemoveDefinition(const std::string& name) #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); if (vv) { - vv->VariableAccessed(name, cmVariableWatch::VARIABLE_REMOVED_ACCESS, 0, - this); + vv->VariableAccessed(name, cmVariableWatch::VARIABLE_REMOVED_ACCESS, + CM_NULLPTR, this); } #endif } @@ -1951,7 +1951,7 @@ cmSourceFile* cmMakefile::LinearGetSourceFileWithOutput( } // otherwise return NULL - return 0; + return CM_NULLPTR; } cmSourceFile* cmMakefile::GetSourceFileWithOutput( @@ -1967,14 +1967,14 @@ cmSourceFile* cmMakefile::GetSourceFileWithOutput( if (o != this->OutputToSource.end()) { return (*o).second; } - return 0; + return CM_NULLPTR; } #if defined(CMAKE_BUILD_WITH_CMAKE) cmSourceGroup* cmMakefile::GetSourceGroup( const std::vector& name) const { - cmSourceGroup* sg = 0; + cmSourceGroup* sg = CM_NULLPTR; // first look for source group starting with the same as the one we want for (std::vector::const_iterator sgIt = @@ -1987,11 +1987,11 @@ cmSourceGroup* cmMakefile::GetSourceGroup( } } - if (sg != 0) { + if (sg != CM_NULLPTR) { // iterate through its children to find match source group for (unsigned int i = 1; i < name.size(); ++i) { sg = sg->LookupChild(name[i].c_str()); - if (sg == 0) { + if (sg == CM_NULLPTR) { break; } } @@ -2009,14 +2009,14 @@ void cmMakefile::AddSourceGroup(const std::string& name, const char* regex) void cmMakefile::AddSourceGroup(const std::vector& name, const char* regex) { - cmSourceGroup* sg = 0; + cmSourceGroup* sg = CM_NULLPTR; std::vector currentName; int i = 0; const int lastElement = static_cast(name.size() - 1); for (i = lastElement; i >= 0; --i) { currentName.assign(name.begin(), name.begin() + i + 1); sg = this->GetSourceGroup(currentName); - if (sg != 0) { + if (sg != CM_NULLPTR) { break; } } @@ -2043,7 +2043,8 @@ void cmMakefile::AddSourceGroup(const std::vector& name, } // build the whole source group path for (++i; i <= lastElement; ++i) { - sg->AddChild(cmSourceGroup(name[i].c_str(), 0, sg->GetFullName())); + sg->AddChild( + cmSourceGroup(name[i].c_str(), CM_NULLPTR, sg->GetFullName())); sg = sg->LookupChild(name[i].c_str()); } @@ -2263,7 +2264,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const } } #endif - return def != NULL; + return def != CM_NULLPTR; } const char* cmMakefile::GetDefinition(const std::string& name) const @@ -2570,7 +2571,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.pop_back(); result.append(last, in - last); std::string const& lookup = result.substr(var.loc); - const char* value = NULL; + const char* value = CM_NULLPTR; std::string varresult; static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE"; switch (var.domain) { @@ -2623,7 +2624,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( if (!atOnly) { t_lookup lookup; const char* next = in + 1; - const char* start = NULL; + const char* start = CM_NULLPTR; char nextc = *next; if (nextc == '{') { // Looking for a variable. @@ -3107,7 +3108,7 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const return sf; } } - return 0; + return CM_NULLPTR; } cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName, @@ -3277,7 +3278,7 @@ cmVariableWatch* cmMakefile::GetVariableWatch() const this->GetCMakeInstance()->GetVariableWatch()) { return this->GetCMakeInstance()->GetVariableWatch(); } - return 0; + return CM_NULLPTR; } #endif @@ -3438,8 +3439,8 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } // Perform variable replacements. - this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, 0, -1, - true, true); + this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, CM_NULLPTR, + -1, true, true); } int cmMakefile::ConfigureFile(const char* infile, const char* outfile, @@ -3578,7 +3579,7 @@ cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const if (i != this->Targets.end()) { return &i->second; } - return 0; + return CM_NULLPTR; } cmTest* cmMakefile::CreateTest(const std::string& testName) @@ -3600,7 +3601,7 @@ cmTest* cmMakefile::GetTest(const std::string& testName) const if (mi != this->Tests.end()) { return mi->second; } - return 0; + return CM_NULLPTR; } void cmMakefile::AddCMakeDependFilesFromUser() @@ -4061,10 +4062,10 @@ bool cmMakefile::IgnoreErrorsCMP0061() const } #define FEATURE_STRING(F) , #F -static const char* const C_FEATURES[] = { 0 FOR_EACH_C_FEATURE( +static const char* const C_FEATURES[] = { CM_NULLPTR FOR_EACH_C_FEATURE( FEATURE_STRING) }; -static const char* const CXX_FEATURES[] = { 0 FOR_EACH_CXX_FEATURE( +static const char* const CXX_FEATURES[] = { CM_NULLPTR FOR_EACH_CXX_FEATURE( FEATURE_STRING) }; #undef FEATURE_STRING @@ -4178,7 +4179,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang, this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); } - return 0; + return CM_NULLPTR; } return featuresKnown; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index c68cd1c..642b691 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -182,24 +182,23 @@ public: * Add a utility to the build. A utiltity target is a command that * is run every time the target is built. */ - cmTarget* AddUtilityCommand(const std::string& utilityName, - bool excludeFromAll, - const std::vector& depends, - const char* workingDirectory, - const char* command, const char* arg1 = 0, - const char* arg2 = 0, const char* arg3 = 0, - const char* arg4 = 0); + cmTarget* AddUtilityCommand( + const std::string& utilityName, bool excludeFromAll, + const std::vector& depends, const char* workingDirectory, + const char* command, const char* arg1 = CM_NULLPTR, + const char* arg2 = CM_NULLPTR, const char* arg3 = CM_NULLPTR, + const char* arg4 = CM_NULLPTR); cmTarget* AddUtilityCommand( const std::string& utilityName, bool excludeFromAll, const char* workingDirectory, const std::vector& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, - const char* comment = 0, bool uses_terminal = false); + const char* comment = CM_NULLPTR, bool uses_terminal = false); cmTarget* AddUtilityCommand( const std::string& utilityName, bool excludeFromAll, const char* workingDirectory, const std::vector& byproducts, const std::vector& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, - const char* comment = 0, bool uses_terminal = false); + const char* comment = CM_NULLPTR, bool uses_terminal = false); /** * Add a link library to the build. @@ -274,14 +273,14 @@ public: /** * Add a root source group for consideration when adding a new source. */ - void AddSourceGroup(const std::string& name, const char* regex = 0); + void AddSourceGroup(const std::string& name, const char* regex = CM_NULLPTR); /** * Add a source group for consideration when adding a new source. * name is tokenized. */ void AddSourceGroup(const std::vector& name, - const char* regex = 0); + const char* regex = CM_NULLPTR); #endif @@ -519,8 +518,8 @@ public: const char* ExpandVariablesInString(std::string& source) const; const char* ExpandVariablesInString(std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly = false, - const char* filename = 0, long line = -1, - bool removeEmpty = false, + const char* filename = CM_NULLPTR, + long line = -1, bool removeEmpty = false, bool replaceAt = false) const; /** @@ -592,11 +591,11 @@ public: */ bool ExpandArguments(std::vector const& inArgs, std::vector& outArgs, - const char* filename = 0) const; + const char* filename = CM_NULLPTR) const; bool ExpandArguments(std::vector const& inArgs, std::vector& outArgs, - const char* filename = 0) const; + const char* filename = CM_NULLPTR) const; /** * Get the instance @@ -743,7 +742,7 @@ public: bool PolicyOptionalWarningEnabled(std::string const& var); bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature, - std::string* error = 0) const; + std::string* error = CM_NULLPTR) const; bool CompileFeatureKnown(cmTarget const* target, const std::string& feature, std::string& lang, std::string* error) const; @@ -933,11 +932,11 @@ private: std::vector QtUiFilesWithOptions; bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature, - std::string* error = 0) const; + std::string* error = CM_NULLPTR) const; bool AddRequiredTargetCxxFeature(cmTarget* target, const std::string& feature, - std::string* error = 0) const; + std::string* error = CM_NULLPTR) const; void CheckNeededCLanguage(const std::string& feature, bool& needC90, bool& needC99, bool& needC11) const; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index ba4c6e6..9a37a33 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -418,8 +418,9 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } // Write the build rule. - this->LocalGenerator->WriteMakeRule( - *this->BuildFileStream, 0, targetFullPathReal, depends, commands, false); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + targetFullPathReal, depends, commands, + false); // The symlink name for the target should depend on the real target // so if the target version changes it rebuilds and recreates the @@ -428,8 +429,9 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) depends.clear(); commands.clear(); depends.push_back(targetFullPathReal); - this->LocalGenerator->WriteMakeRule( - *this->BuildFileStream, 0, targetFullPath, depends, commands, false); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + targetFullPath, depends, commands, + false); } // Write the main driver rule to build everything in this target. diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 5348b80..380fd7d 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -111,7 +111,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() this->AppendObjectDepends(depends); // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, this->GeneratorTarget->GetName(), depends, commands, true); @@ -346,7 +346,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( commands, buildEcho, cmLocalUnixMakefileGenerator3::EchoLink, &progress); } - const char* forbiddenFlagVar = 0; + const char* forbiddenFlagVar = CM_NULLPTR; switch (this->GeneratorTarget->GetType()) { case cmState::SHARED_LIBRARY: forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS"; @@ -762,8 +762,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Write the build rule. - this->WriteMakeRule(*this->BuildFileStream, 0, outputs, depends, commands, - false); + this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends, + commands, false); // Write the main driver rule to build everything in this target. this->WriteTargetDriverRule(targetFullPath, relink); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 8b341a1..e922fbd 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -33,12 +33,12 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) - , OSXBundleGenerator(0) - , MacOSXContentGenerator(0) + , OSXBundleGenerator(CM_NULLPTR) + , MacOSXContentGenerator(CM_NULLPTR) { - this->BuildFileStream = 0; - this->InfoFileStream = 0; - this->FlagFileStream = 0; + this->BuildFileStream = CM_NULLPTR; + this->InfoFileStream = CM_NULLPTR; + this->FlagFileStream = CM_NULLPTR; this->CustomCommandDriver = OnBuild; this->LocalGenerator = static_cast(target->GetLocalGenerator()); @@ -61,7 +61,7 @@ cmMakefileTargetGenerator::~cmMakefileTargetGenerator() cmMakefileTargetGenerator* cmMakefileTargetGenerator::New( cmGeneratorTarget* tgt) { - cmMakefileTargetGenerator* result = 0; + cmMakefileTargetGenerator* result = CM_NULLPTR; switch (tgt->GetType()) { case cmState::EXECUTABLE: @@ -139,7 +139,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() cmSystemTools::ExpandListArgument( cge->Evaluate(this->LocalGenerator, config, false, this->GeneratorTarget, - 0, 0), + CM_NULLPTR, CM_NULLPTR), this->CleanFiles); } @@ -320,7 +320,8 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()( cmOutputConverter::SHELL); commands.push_back(copyCommand); this->Generator->LocalGenerator->WriteMakeRule( - *this->Generator->BuildFileStream, 0, output, depends, commands, false); + *this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands, + false); this->Generator->ExtraFiles.insert(output); } @@ -652,7 +653,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( } // Write the rule. - this->WriteMakeRule(*this->BuildFileStream, 0, outputs, depends, commands); + this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends, + commands); bool do_preprocess_rules = lang_has_preprocessor && this->LocalGenerator->GetCreatePreprocessedSourceRules(); @@ -708,7 +710,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( commands.push_back(cmd); } - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, relativeObjI, force_depends, commands, false); } @@ -754,7 +756,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( commands.push_back(cmd); } - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, relativeObjS, force_depends, commands, false); } @@ -766,8 +768,9 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( objectRequires += ".requires"; std::vector p_depends; // always provide an empty requires target - this->LocalGenerator->WriteMakeRule( - *this->BuildFileStream, 0, objectRequires, p_depends, no_commands, true); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + objectRequires, p_depends, no_commands, + true); // write a build rule to recursively build what this obj provides std::string objectProvides = relativeObj; @@ -783,13 +786,14 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( p_depends.clear(); p_depends.push_back(objectRequires); - this->LocalGenerator->WriteMakeRule( - *this->BuildFileStream, 0, objectProvides, p_depends, r_commands, true); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + objectProvides, p_depends, r_commands, + true); // write the provides.build rule dependency on the obj file p_depends.clear(); p_depends.push_back(relativeObj); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, temp, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, temp, p_depends, no_commands, false); } @@ -815,8 +819,8 @@ void cmMakefileTargetGenerator::WriteTargetRequiresRules() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, depTarget, - depends, no_commands, true); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + depTarget, depends, no_commands, true); } void cmMakefileTargetGenerator::WriteTargetCleanRules() @@ -837,8 +841,8 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() cmOutputConverter::HOME_OUTPUT); // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, cleanTarget, - depends, commands, true); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + cleanTarget, depends, commands, true); } bool cmMakefileTargetGenerator::WriteMakeRule( @@ -892,7 +896,7 @@ bool cmMakefileTargetGenerator::WriteMakeRule( if (!o_symbolic) { output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out); } - this->LocalGenerator->WriteMakeRule(os, 0, *o, output_depends, + this->LocalGenerator->WriteMakeRule(os, CM_NULLPTR, *o, output_depends, output_commands, o_symbolic, in_help); if (!o_symbolic) { @@ -1025,8 +1029,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, depTarget, - depends, commands, true); + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + depTarget, depends, commands, true); } void cmMakefileTargetGenerator::DriveCustomCommands( @@ -1088,8 +1092,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile( // Write the rule. const std::vector& outputs = ccg.GetOutputs(); - bool symbolic = - this->WriteMakeRule(*this->BuildFileStream, 0, outputs, depends, commands); + bool symbolic = this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + outputs, depends, commands); // If the rule has changed make sure the output is rebuilt. if (!symbolic) { @@ -1254,7 +1258,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule( std::vector depends; depends.push_back(main_output); - const char* comment = 0; + const char* comment = CM_NULLPTR; if (relink) { // Setup the comment for the preinstall driver. comment = "Rule to relink during preinstall."; diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 6e44e8f..27006ee 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -95,7 +95,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, this->GeneratorTarget->GetName(), depends, commands, true); diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 07f1fa8..2fb6a75 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -35,7 +35,7 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector const& args, cmState* state = this->Makefile->GetState(); if (!state->GetCacheEntryValue(variable)) { this->Makefile->GetCMakeInstance()->AddCacheEntry( - variable, 0, 0, cmState::UNINITIALIZED); + variable, CM_NULLPTR, CM_NULLPTR, cmState::UNINITIALIZED); overwrite = true; } if (!state->GetCacheEntryValue(variable)) { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 04ba842..77d3901 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -134,7 +134,7 @@ const char* cmNinjaNormalTargetGenerator::GetVisibleTypeName() const case cmState::EXECUTABLE: return "executable"; default: - return 0; + return CM_NULLPTR; } } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 954c73e..a876efa 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -53,14 +53,14 @@ cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) } default: - return 0; + return CM_NULLPTR; } } cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) - , MacOSXContentGenerator(0) - , OSXBundleGenerator(0) + , MacOSXContentGenerator(CM_NULLPTR) + , OSXBundleGenerator(CM_NULLPTR) , MacContentFolders() , LocalGenerator( static_cast(target->GetLocalGenerator())) @@ -739,5 +739,5 @@ bool cmNinjaTargetGenerator::ForceResponseFile() { static std::string const forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE"; return (this->GetMakefile()->IsDefinitionSet(forceRspFile) || - cmSystemTools::GetEnv(forceRspFile) != 0); + cmSystemTools::GetEnv(forceRspFile) != CM_NULLPTR); } diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index c19cae0..dbfe6eb 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -23,7 +23,7 @@ cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target, , Makefile(target->Target->GetMakefile()) , LocalGenerator(target->GetLocalGenerator()) , ConfigName(configName) - , MacContentFolders(0) + , MacContentFolders(CM_NULLPTR) { if (this->MustSkip()) { return; diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index fc1a388..38e197c 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -30,7 +30,8 @@ public: cmOrderDirectories(cmGlobalGenerator* gg, cmGeneratorTarget const* target, const char* purpose); ~cmOrderDirectories(); - void AddRuntimeLibrary(std::string const& fullPath, const char* soname = 0); + void AddRuntimeLibrary(std::string const& fullPath, + const char* soname = CM_NULLPTR); void AddLinkLibrary(std::string const& fullPath); void AddUserDirectories(std::vector const& extra); void AddLanguageDirectories(std::vector const& dirs); diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index b92c074..411184c 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -54,7 +54,7 @@ std::string cmOutputConverter::ConvertToOutputForExisting( assert(remote != NONE); const char* remotePath = this->GetRelativeRootPath(remote); - assert(remotePath != 0); + assert(remotePath != CM_NULLPTR); return this->ConvertToOutputForExisting(remotePath, format); } @@ -73,7 +73,7 @@ const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const default: break; } - return 0; + return CM_NULLPTR; } std::string cmOutputConverter::Convert(const std::string& source, @@ -155,7 +155,7 @@ std::string cmOutputConverter::Convert(RelativeRoot remote, assert(remote != NONE); const char* remotePath = this->GetRelativeRootPath(remote); - assert(remotePath != 0); + assert(remotePath != CM_NULLPTR); if (local.empty()) { return this->ConvertToOutputFormat(remotePath, output); diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 29f1acc..ef636e7 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -28,7 +28,7 @@ public: */ cmDependInformation() : DependDone(false) - , SourceFile(0) + , SourceFile(CM_NULLPTR) { } @@ -154,7 +154,7 @@ public: */ const cmDependInformation* FindDependencies(const char* file) { - cmDependInformation* info = this->GetDependInformation(file, 0); + cmDependInformation* info = this->GetDependInformation(file, CM_NULLPTR); this->GenerateDependInformation(info); return info; } @@ -203,7 +203,7 @@ protected: message += includeFile; message += " for file "; message += info->FullPath.c_str(); - cmSystemTools::Error(message.c_str(), 0); + cmSystemTools::Error(message.c_str(), CM_NULLPTR); } continue; } @@ -329,7 +329,7 @@ protected: // See if the cmSourceFile for it has any files specified as // dependency hints. - if (info->SourceFile != 0) { + if (info->SourceFile != CM_NULLPTR) { // Get the cmSourceFile corresponding to this. const cmSourceFile& cFile = *(info->SourceFile); diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 85f0fa3..124fb6a 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -57,9 +57,9 @@ static const char* idToString(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return 0; + return CM_NULLPTR; } - return 0; + return CM_NULLPTR; } static const char* idToVersion(cmPolicies::PolicyID id) @@ -71,9 +71,9 @@ static const char* idToVersion(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID_VERSION(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return 0; + return CM_NULLPTR; } - return 0; + return CM_NULLPTR; } static bool isPolicyNewerThan(cmPolicies::PolicyID id, unsigned int majorV, @@ -102,9 +102,9 @@ const char* idToShortDescription(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID_DOC(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return 0; + return CM_NULLPTR; } - return 0; + return CM_NULLPTR; } static void DiagnoseAncientPolicies( diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx index 446752e..34b8df2 100644 --- a/Source/cmProcessTools.cxx +++ b/Source/cmProcessTools.cxx @@ -17,27 +17,27 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, OutputParser* err) { cmsysProcess_Execute(cp); - char* data = 0; + char* data = CM_NULLPTR; int length = 0; int p; while ((out || err) && - (p = cmsysProcess_WaitForData(cp, &data, &length, 0), p)) { + (p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { if (out && p == cmsysProcess_Pipe_STDOUT) { if (!out->Process(data, length)) { - out = 0; + out = CM_NULLPTR; } } else if (err && p == cmsysProcess_Pipe_STDERR) { if (!err->Process(data, length)) { - err = 0; + err = CM_NULLPTR; } } } - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); } cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR) - : Log(0) - , Prefix(0) + : Log(CM_NULLPTR) + , Prefix(CM_NULLPTR) , Separator(sep) , LineEnd('\0') , IgnoreCR(ignoreCR) diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index 9d082b2..61bfc64 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -73,7 +73,7 @@ public: class OutputLogger : public LineParser { public: - OutputLogger(std::ostream& log, const char* prefix = 0) + OutputLogger(std::ostream& log, const char* prefix = CM_NULLPTR) { this->SetLog(&log, prefix); } @@ -84,7 +84,7 @@ public: /** Run a process and send output to given parsers. */ static void RunProcess(struct cmsysProcess_s* cp, OutputParser* out, - OutputParser* err = 0); + OutputParser* err = CM_NULLPTR); }; #endif diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx index 4910616..133258f 100644 --- a/Source/cmProperty.cxx +++ b/Source/cmProperty.cxx @@ -33,5 +33,5 @@ const char* cmProperty::GetValue() const if (this->ValueHasBeenSet) { return this->Value.c_str(); } - return 0; + return CM_NULLPTR; } diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index de1281e..1e1ff91 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -70,7 +70,7 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const cmPropertyMap::const_iterator it = this->find(name); if (it == this->end()) { - return 0; + return CM_NULLPTR; } return it->second.GetValue(); } diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index f63672b..ef8255a 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -80,7 +80,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector const& args, depends.push_back(hname); std::string no_main_dependency = ""; - const char* no_working_dir = 0; + const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( newName, depends, no_main_dependency, commandLines, "Qt Wrapped File", no_working_dir); diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index 4c1da36..a948dd6 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -111,8 +111,8 @@ bool cmQTWrapUICommand::InitialPass(std::vector const& args, std::vector depends; depends.push_back(uiName); std::string no_main_dependency = ""; - const char* no_comment = 0; - const char* no_working_dir = 0; + const char* no_comment = CM_NULLPTR; + const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( hName, depends, no_main_dependency, hCommandLines, no_comment, no_working_dir); diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 98851d6..4a63aad 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -195,7 +195,7 @@ static void SetupAutoMocTarget( cmMakefile* makefile = target->Target->GetMakefile(); const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); - std::string _moc_options = (tmp != 0 ? tmp : ""); + std::string _moc_options = (tmp != CM_NULLPTR ? tmp : ""); makefile->AddDefinition( "_moc_options", cmOutputConverter::EscapeForCMake(_moc_options).c_str()); makefile->AddDefinition( @@ -484,8 +484,9 @@ static std::string ListQt5RccInputs(cmSourceFile* sf, std::string rccStdOut; std::string rccStdErr; int retVal = 0; - bool result = cmSystemTools::RunSingleCommand( - command, &rccStdOut, &rccStdErr, &retVal, 0, cmSystemTools::OUTPUT_NONE); + bool result = + cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal, + CM_NULLPTR, cmSystemTools::OUTPUT_NONE); if (result && retVal == 0 && rccStdOut.find("--list") != std::string::npos) { hasDashDashList = true; @@ -505,8 +506,9 @@ static std::string ListQt5RccInputs(cmSourceFile* sf, std::string rccStdOut; std::string rccStdErr; int retVal = 0; - bool result = cmSystemTools::RunSingleCommand( - command, &rccStdOut, &rccStdErr, &retVal, 0, cmSystemTools::OUTPUT_NONE); + bool result = + cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal, + CM_NULLPTR, cmSystemTools::OUTPUT_NONE); if (!result || retVal) { std::ostringstream err; err << "AUTOGEN: error: Rcc list process for " << sf->GetFullPath() diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 6a6d72f..7ada431 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -34,8 +34,8 @@ static bool requiresMocing(const std::string& text, std::string& macroName) { // this simple check is much much faster than the regexp - if (strstr(text.c_str(), "Q_OBJECT") == NULL && - strstr(text.c_str(), "Q_GADGET") == NULL) { + if (strstr(text.c_str(), "Q_OBJECT") == CM_NULLPTR && + strstr(text.c_str(), "Q_GADGET") == CM_NULLPTR) { return false; } @@ -88,7 +88,7 @@ static std::string extractSubDir(const std::string& absPath, } cmQtAutoGenerators::cmQtAutoGenerators() - : Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != 0) + : Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != CM_NULLPTR) , ColorOutput(true) , RunMocFailed(false) , RunUicFailed(false) @@ -588,7 +588,7 @@ void cmQtAutoGenerators::ParseCppFile( // first a simple string check for "moc" is *much* faster than the regexp, // and if the string search already fails, we don't have to try the // expensive regexp - if ((strstr(contentsString.c_str(), "moc") != NULL) && + if ((strstr(contentsString.c_str(), "moc") != CM_NULLPTR) && (mocIncludeRegExp.find(contentsString))) { // for every moc include in the file do { @@ -765,7 +765,7 @@ void cmQtAutoGenerators::StrictParseCppFile( // first a simple string check for "moc" is *much* faster than the regexp, // and if the string search already fails, we don't have to try the // expensive regexp - if ((strstr(contentsString.c_str(), "moc") != NULL) && + if ((strstr(contentsString.c_str(), "moc") != CM_NULLPTR) && (mocIncludeRegExp.find(contentsString))) { // for every moc include in the file do { @@ -879,7 +879,7 @@ void cmQtAutoGenerators::ParseForUic( const std::string realName = cmsys::SystemTools::GetRealPath(absFilename); matchOffset = 0; - if ((strstr(contentsString.c_str(), "ui_") != NULL) && + if ((strstr(contentsString.c_str(), "ui_") != CM_NULLPTR) && (uiIncludeRegExp.find(contentsString))) { do { const std::string currentUi = uiIncludeRegExp.match(1); diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index 5fed107..b8aae5d 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -19,7 +19,7 @@ cmScriptGenerator::cmScriptGenerator( : RuntimeConfigVariable(config_var) , Configurations(configurations) , ConfigurationName("") - , ConfigurationTypes(0) + , ConfigurationTypes(CM_NULLPTR) , ActionsPerConfig(false) { } @@ -36,7 +36,7 @@ void cmScriptGenerator::Generate( this->ConfigurationTypes = &configurationTypes; this->GenerateScript(os); this->ConfigurationName = ""; - this->ConfigurationTypes = 0; + this->ConfigurationTypes = CM_NULLPTR; } static void cmScriptGeneratorEncodeConfig(const std::string& config, diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index a0cce12..ca3a57f 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -45,7 +45,7 @@ void cmSearchPath::AddPath(const std::string& path) void cmSearchPath::AddUserPath(const std::string& path) { - assert(this->FC != NULL); + assert(this->FC != CM_NULLPTR); std::vector outPaths; @@ -80,7 +80,7 @@ void cmSearchPath::AddUserPath(const std::string& path) void cmSearchPath::AddCMakePath(const std::string& variable) { - assert(this->FC != NULL); + assert(this->FC != CM_NULLPTR); // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { @@ -107,7 +107,7 @@ void cmSearchPath::AddEnvPath(const std::string& variable) void cmSearchPath::AddCMakePrefixPath(const std::string& variable) { - assert(this->FC != NULL); + assert(this->FC != CM_NULLPTR); // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { @@ -172,7 +172,7 @@ void cmSearchPath::AddSuffixes(const std::vector& suffixes) void cmSearchPath::AddPrefixPaths(const std::vector& paths, const char* base) { - assert(this->FC != NULL); + assert(this->FC != CM_NULLPTR); // default for programs std::string subdir = "bin"; @@ -213,7 +213,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector& paths, void cmSearchPath::AddPathInternal(const std::string& path, const char* base) { - assert(this->FC != NULL); + assert(this->FC != CM_NULLPTR); std::string collapsed = cmSystemTools::CollapseFullPath(path, base); diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 835196f..65f703f 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -28,7 +28,7 @@ public: // cmSearchPath must be initialized from a valid pointer. The only reason // for the default is to allow it to be easily used in stl containers. // Attempting to initialize with a NULL value will fail an assertion - cmSearchPath(cmFindCommon* findCmd = 0); + cmSearchPath(cmFindCommon* findCmd = CM_NULLPTR); ~cmSearchPath(); const std::vector& GetPaths() const { return this->Paths; } @@ -47,8 +47,8 @@ public: protected: void AddPrefixPaths(const std::vector& paths, - const char* base = 0); - void AddPathInternal(const std::string& path, const char* base = 0); + const char* base = CM_NULLPTR); + void AddPathInternal(const std::string& path, const char* base = CM_NULLPTR); cmFindCommon* FC; std::vector Paths; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 5f4cfee..1484368 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -59,7 +59,7 @@ bool cmSetCommand::InitialPass(std::vector const& args, // SET (VAR PARENT_SCOPE) // Removes the definition of VAR // in the parent scope. else if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") { - this->Makefile->RaiseScope(variable, 0); + this->Makefile->RaiseScope(variable, CM_NULLPTR); return true; } @@ -73,7 +73,7 @@ bool cmSetCommand::InitialPass(std::vector const& args, bool force = false; // optional bool parentScope = false; cmState::CacheEntryType type = cmState::STRING; // required if cache - const char* docstring = 0; // required if cache + const char* docstring = CM_NULLPTR; // required if cache unsigned int ignoreLastArgs = 0; // look for PARENT_SCOPE argument diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 73f7437..8fe8ade 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -139,7 +139,7 @@ bool cmSetPropertyCommand::HandleGlobalMode() const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = 0; + value = CM_NULLPTR; } if (this->AppendMode) { cm->AppendProperty(name, value ? value : "", this->AppendAsString); @@ -189,7 +189,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode() const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = 0; + value = CM_NULLPTR; } if (this->AppendMode) { mf->AppendProperty(name, value ? value : "", this->AppendAsString); @@ -230,7 +230,7 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target) const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = 0; + value = CM_NULLPTR; } if (this->AppendMode) { target->AppendProperty(name, value, this->AppendAsString); @@ -269,7 +269,7 @@ bool cmSetPropertyCommand::HandleSource(cmSourceFile* sf) const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = 0; + value = CM_NULLPTR; } if (this->AppendMode) { @@ -317,7 +317,7 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test) const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = 0; + value = CM_NULLPTR; } if (this->AppendMode) { test->AppendProperty(name, value, this->AppendAsString); diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 702af4d..5c14991 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -55,7 +55,8 @@ bool cmSiteNameCommand::InitialPass(std::vector const& args, // try to find the hostname for this computer if (!cmSystemTools::IsOff(hostname_cmd.c_str())) { std::string host; - cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, 0, 0, 0, + cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, CM_NULLPTR, + CM_NULLPTR, CM_NULLPTR, cmSystemTools::OUTPUT_NONE); // got the hostname diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 5b0acee..04727b2 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -19,7 +19,7 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { - this->CustomCommand = 0; + this->CustomCommand = CM_NULLPTR; this->FindFullPathFailed = false; this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension( this->Location.GetName())); @@ -27,7 +27,7 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) cmSourceFile::~cmSourceFile() { - this->SetCustomCommand(0); + this->SetCustomCommand(CM_NULLPTR); } std::string const& cmSourceFile::GetExtension() const @@ -135,7 +135,7 @@ bool cmSourceFile::FindFullPath(std::string* error) // The file is not generated. It must exist on disk. cmMakefile const* mf = this->Location.GetMakefile(); - const char* tryDirs[3] = { 0, 0, 0 }; + const char* tryDirs[3] = { CM_NULLPTR, CM_NULLPTR, CM_NULLPTR }; if (this->Location.DirectoryIsAmbiguous()) { tryDirs[0] = mf->GetCurrentSourceDirectory(); tryDirs[1] = mf->GetCurrentBinaryDirectory(); @@ -294,7 +294,7 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const // Check for computed properties. if (prop == "LOCATION") { if (this->FullPath.empty()) { - return 0; + return CM_NULLPTR; } else { return this->FullPath.c_str(); } diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index b1623bd..a3808f7 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -62,7 +62,7 @@ public: * horrible interface, but is necessary for backwards * compatibility). */ - std::string const& GetFullPath(std::string* error = 0); + std::string const& GetFullPath(std::string* error = CM_NULLPTR); std::string const& GetFullPath() const; /** diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index a89d1e8..099a6f0 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -19,7 +19,7 @@ #include "assert.h" cmSourceFileLocation::cmSourceFileLocation() - : Makefile(0) + : Makefile(CM_NULLPTR) , AmbiguousDirectory(true) , AmbiguousExtension(true) { diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index f27b572..d9529a2 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -123,7 +123,7 @@ cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const } // if no child with this name was found return NULL - return NULL; + return CM_NULLPTR; } cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) @@ -143,7 +143,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) return result; } } - return 0; + return CM_NULLPTR; } cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name) @@ -164,7 +164,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name) return this; } - return 0; + return CM_NULLPTR; } std::vector const& cmSourceGroup::GetGroupChildren() const diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 8603e95..1f5232e 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -34,7 +34,7 @@ class cmSourceGroup { public: cmSourceGroup(const char* name, const char* regex, - const char* parentName = 0); + const char* parentName = CM_NULLPTR); cmSourceGroup(cmSourceGroup const& r); ~cmSourceGroup(); cmSourceGroup& operator=(cmSourceGroup const&); diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 252819c..6db14c0 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -28,7 +28,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector const& args, std::vector folders = cmSystemTools::tokenize(args[0], delimiter); - cmSourceGroup* sg = 0; + cmSourceGroup* sg = CM_NULLPTR; sg = this->Makefile->GetSourceGroup(folders); if (!sg) { this->Makefile->AddSourceGroup(folders); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index d2cfaba..f2fe134 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -135,12 +135,12 @@ const char* cmState::GetTargetTypeName(cmState::TargetType targetType) return "UNKNOWN_LIBRARY"; } assert(0 && "Unexpected target type"); - return 0; + return CM_NULLPTR; } const char* cmCacheEntryTypes[] = { "BOOL", "PATH", "FILEPATH", "STRING", "INTERNAL", "STATIC", - "UNINITIALIZED", 0 }; + "UNINITIALIZED", CM_NULLPTR }; const char* cmState::CacheEntryTypeToString(cmState::CacheEntryType type) { @@ -204,7 +204,7 @@ const char* cmState::GetCacheEntryValue(std::string const& key) const { cmCacheManager::CacheEntry* e = this->CacheManager->GetCacheEntry(key); if (!e) { - return 0; + return CM_NULLPTR; } return e->Value.c_str(); } @@ -260,7 +260,7 @@ const char* cmState::GetCacheEntryProperty(std::string const& key, cmCacheManager::CacheIterator it = this->CacheManager->GetCacheIterator(key.c_str()); if (!it.PropertyExists(propertyName)) { - return 0; + return CM_NULLPTR; } return it.GetProperty(propertyName); } @@ -296,7 +296,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, std::string const& propertyName) { this->CacheManager->GetCacheIterator(key.c_str()) - .SetProperty(propertyName, (void*)0); + .SetProperty(propertyName, (void*)CM_NULLPTR); } cmState::Snapshot cmState::Reset() @@ -374,7 +374,7 @@ cmPropertyDefinition const* cmState::GetPropertyDefinition( this->PropertyDefinitions.find(scope)->second; return &defs.find(name)->second; } - return 0; + return CM_NULLPTR; } bool cmState::IsPropertyDefined(const std::string& name, @@ -491,7 +491,7 @@ void cmState::RemoveUnscriptableCommands() cmCommand* cmState::GetCommand(std::string const& name) const { - cmCommand* command = 0; + cmCommand* command = CM_NULLPTR; std::string sName = cmSystemTools::LowerCase(name); std::map::const_iterator pos = this->Commands.find(sName); @@ -1197,7 +1197,7 @@ void cmState::Snapshot::SetDefinition(std::string const& name, void cmState::Snapshot::RemoveDefinition(std::string const& name) { - this->Position->Vars->Set(name, 0); + this->Position->Vars->Set(name, CM_NULLPTR); } std::vector cmState::Snapshot::UnusedKeys() const diff --git a/Source/cmState.h b/Source/cmState.h index 935faec..e5f9917 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -55,7 +55,7 @@ public: class Snapshot { public: - Snapshot(cmState* state = 0); + Snapshot(cmState* state = CM_NULLPTR); Snapshot(cmState* state, PositionType position); const char* GetDefinition(std::string const& name) const; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 26cbfb6..2d463f3 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -583,7 +583,7 @@ bool cmSystemTools::RunSingleCommand(std::vector const& command, a != command.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(0); + argv.push_back(CM_NULLPTR); cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetCommand(cp, &*argv.begin()); @@ -595,12 +595,12 @@ bool cmSystemTools::RunSingleCommand(std::vector const& command, if (outputflag == OUTPUT_PASSTHROUGH) { cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1); cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1); - captureStdOut = 0; - captureStdErr = 0; + captureStdOut = CM_NULLPTR; + captureStdErr = CM_NULLPTR; } else if (outputflag == OUTPUT_MERGE || (captureStdErr && captureStdErr == captureStdOut)) { cmsysProcess_SetOption(cp, cmsysProcess_Option_MergeOutput, 1); - captureStdErr = 0; + captureStdErr = CM_NULLPTR; } assert(!captureStdErr || captureStdErr != captureStdOut); @@ -614,7 +614,8 @@ bool cmSystemTools::RunSingleCommand(std::vector const& command, int pipe; if (outputflag != OUTPUT_PASSTHROUGH && (captureStdOut || captureStdErr || outputflag != OUTPUT_NONE)) { - while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0) { + while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) > + 0) { // Translate NULL characters in the output into valid text. // Visual Studio 7 puts these characters in the output of its // build process. @@ -642,7 +643,7 @@ bool cmSystemTools::RunSingleCommand(std::vector const& command, } } - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); if (captureStdOut) { captureStdOut->assign(tempStdOut.begin(), tempStdOut.end()); } @@ -1432,7 +1433,7 @@ void list_item_verbose(FILE* out, struct archive_entry* entry) /* Use uname if it's present, else uid. */ p = archive_entry_uname(entry); - if ((p == NULL) || (*p == '\0')) { + if ((p == CM_NULLPTR) || (*p == '\0')) { sprintf(tmp, "%lu ", (unsigned long)archive_entry_uid(entry)); p = tmp; } @@ -1443,7 +1444,7 @@ void list_item_verbose(FILE* out, struct archive_entry* entry) fprintf(out, "%-*s ", (int)u_width, p); /* Use gname if it's present, else gid. */ p = archive_entry_gname(entry); - if (p != NULL && p[0] != '\0') { + if (p != CM_NULLPTR && p[0] != '\0') { fprintf(out, "%s", p); w = strlen(p); } else { @@ -1875,7 +1876,7 @@ unsigned int cmSystemTools::RandomSeed() // Try using a real random source. cmsys::ifstream fin; - fin.rdbuf()->pubsetbuf(0, 0); // Unbuffered read. + fin.rdbuf()->pubsetbuf(CM_NULLPTR, 0); // Unbuffered read. fin.open("/dev/urandom"); if (fin.good() && fin.read(seed.bytes, sizeof(seed)) && fin.gcount() == sizeof(seed)) { @@ -1884,7 +1885,7 @@ unsigned int cmSystemTools::RandomSeed() // Fall back to the time and pid. struct timeval t; - gettimeofday(&t, 0); + gettimeofday(&t, CM_NULLPTR); unsigned int pid = static_cast(getpid()); unsigned int tv_sec = static_cast(t.tv_sec); unsigned int tv_usec = static_cast(t.tv_usec); @@ -2199,8 +2200,8 @@ bool cmSystemTools::ChangeRPath(std::string const& file, // Get the RPATH and RUNPATH entries from it. int se_count = 0; - cmELF::StringEntry const* se[2] = { 0, 0 }; - const char* se_name[2] = { 0, 0 }; + cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR }; + const char* se_name[2] = { CM_NULLPTR, CM_NULLPTR }; if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) { se[se_count] = se_rpath; se_name[se_count] = "RPATH"; @@ -2430,7 +2431,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg, // Get the RPATH and RUNPATH entries from it and sort them by index // in the dynamic section header. int se_count = 0; - cmELF::StringEntry const* se[2] = { 0, 0 }; + cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR }; if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) { se[se_count++] = se_rpath; } diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index df2c1f7..39e7994 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -64,33 +64,35 @@ public: * title as a const char*, and a reference to bool that when * set to false, will disable furthur messages (cancel). */ - static void SetMessageCallback(MessageCallback f, void* clientData = 0); + static void SetMessageCallback(MessageCallback f, + void* clientData = CM_NULLPTR); /** * Display an error message. */ - static void Error(const char* m, const char* m2 = 0, const char* m3 = 0, - const char* m4 = 0); + static void Error(const char* m, const char* m2 = CM_NULLPTR, + const char* m3 = CM_NULLPTR, const char* m4 = CM_NULLPTR); /** * Display a message. */ - static void Message(const char* m, const char* title = 0); + static void Message(const char* m, const char* title = CM_NULLPTR); typedef void (*OutputCallback)(const char*, size_t length, void*); ///! Send a string to stdout static void Stdout(const char* s); static void Stdout(const char* s, size_t length); - static void SetStdoutCallback(OutputCallback, void* clientData = 0); + static void SetStdoutCallback(OutputCallback, void* clientData = CM_NULLPTR); ///! Send a string to stderr static void Stderr(const char* s); static void Stderr(const char* s, size_t length); - static void SetStderrCallback(OutputCallback, void* clientData = 0); + static void SetStderrCallback(OutputCallback, void* clientData = CM_NULLPTR); typedef bool (*InterruptCallback)(void*); - static void SetInterruptCallback(InterruptCallback f, void* clientData = 0); + static void SetInterruptCallback(InterruptCallback f, + void* clientData = CM_NULLPTR); static bool GetInterruptFlag(); ///! Return true if there was an error at any point. @@ -220,9 +222,10 @@ public: OUTPUT_PASSTHROUGH }; static bool RunSingleCommand(const char* command, - std::string* captureStdOut = 0, - std::string* captureStdErr = 0, int* retVal = 0, - const char* dir = 0, + std::string* captureStdOut = CM_NULLPTR, + std::string* captureStdErr = CM_NULLPTR, + int* retVal = CM_NULLPTR, + const char* dir = CM_NULLPTR, OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0); /** @@ -231,9 +234,10 @@ public: * be in comand[1]...command[command.size()] */ static bool RunSingleCommand(std::vector const& command, - std::string* captureStdOut = 0, - std::string* captureStdErr = 0, int* retVal = 0, - const char* dir = 0, + std::string* captureStdOut = CM_NULLPTR, + std::string* captureStdErr = CM_NULLPTR, + int* retVal = CM_NULLPTR, + const char* dir = CM_NULLPTR, OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0); @@ -435,12 +439,14 @@ public: /** Try to set the RPATH in an ELF binary. */ static bool ChangeRPath(std::string const& file, std::string const& oldRPath, - std::string const& newRPath, std::string* emsg = 0, - bool* changed = 0); + std::string const& newRPath, + std::string* emsg = CM_NULLPTR, + bool* changed = CM_NULLPTR); /** Try to remove the RPATH from an ELF binary. */ - static bool RemoveRPath(std::string const& file, std::string* emsg = 0, - bool* removed = 0); + static bool RemoveRPath(std::string const& file, + std::string* emsg = CM_NULLPTR, + bool* removed = CM_NULLPTR); /** Check whether the RPATH in an ELF binary contains the path given. */ diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 5e5ed2b..ceebf93 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -57,7 +57,7 @@ public: cmTarget::cmTarget() { - this->Makefile = 0; + this->Makefile = CM_NULLPTR; this->HaveInstallRule = false; this->DLLPlatform = false; this->IsAndroid = false; @@ -97,64 +97,64 @@ void cmTarget::SetMakefile(cmMakefile* mf) // Setup default property values. if (this->GetType() != cmState::INTERFACE_LIBRARY && this->GetType() != cmState::UTILITY) { - this->SetPropertyDefault("ANDROID_API", 0); - this->SetPropertyDefault("ANDROID_API_MIN", 0); - this->SetPropertyDefault("ANDROID_ARCH", 0); - this->SetPropertyDefault("ANDROID_STL_TYPE", 0); - this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", 0); - this->SetPropertyDefault("ANDROID_PROCESS_MAX", 0); - this->SetPropertyDefault("ANDROID_PROGUARD", 0); - this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", 0); - this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", 0); - this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", 0); - this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", 0); - this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", 0); - this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", 0); - this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", 0); - this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", 0); - this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", 0); - this->SetPropertyDefault("INSTALL_NAME_DIR", 0); + this->SetPropertyDefault("ANDROID_API", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_API_MIN", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_ARCH", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_STL_TYPE", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_PROCESS_MAX", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_PROGUARD", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", CM_NULLPTR); + this->SetPropertyDefault("INSTALL_NAME_DIR", CM_NULLPTR); this->SetPropertyDefault("INSTALL_RPATH", ""); this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF"); this->SetPropertyDefault("SKIP_BUILD_RPATH", "OFF"); this->SetPropertyDefault("BUILD_WITH_INSTALL_RPATH", "OFF"); - this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", 0); - this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", 0); - this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0); - this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", 0); - this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", 0); - this->SetPropertyDefault("Fortran_FORMAT", 0); - this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0); - this->SetPropertyDefault("GNUtoMS", 0); - this->SetPropertyDefault("OSX_ARCHITECTURES", 0); - this->SetPropertyDefault("IOS_INSTALL_COMBINED", 0); - this->SetPropertyDefault("AUTOMOC", 0); - this->SetPropertyDefault("AUTOUIC", 0); - this->SetPropertyDefault("AUTORCC", 0); - this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0); - this->SetPropertyDefault("AUTOUIC_OPTIONS", 0); - this->SetPropertyDefault("AUTORCC_OPTIONS", 0); - this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", 0); - this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0); - this->SetPropertyDefault("WIN32_EXECUTABLE", 0); - this->SetPropertyDefault("MACOSX_BUNDLE", 0); - this->SetPropertyDefault("MACOSX_RPATH", 0); - this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", 0); - this->SetPropertyDefault("C_CLANG_TIDY", 0); - this->SetPropertyDefault("C_COMPILER_LAUNCHER", 0); - this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", 0); - this->SetPropertyDefault("LINK_WHAT_YOU_USE", 0); - this->SetPropertyDefault("C_STANDARD", 0); - this->SetPropertyDefault("C_STANDARD_REQUIRED", 0); - this->SetPropertyDefault("C_EXTENSIONS", 0); - this->SetPropertyDefault("CXX_CLANG_TIDY", 0); - this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", 0); - this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", 0); - this->SetPropertyDefault("CXX_STANDARD", 0); - this->SetPropertyDefault("CXX_STANDARD_REQUIRED", 0); - this->SetPropertyDefault("CXX_EXTENSIONS", 0); - this->SetPropertyDefault("LINK_SEARCH_START_STATIC", 0); - this->SetPropertyDefault("LINK_SEARCH_END_STATIC", 0); + this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("Fortran_FORMAT", CM_NULLPTR); + this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", CM_NULLPTR); + this->SetPropertyDefault("GNUtoMS", CM_NULLPTR); + this->SetPropertyDefault("OSX_ARCHITECTURES", CM_NULLPTR); + this->SetPropertyDefault("IOS_INSTALL_COMBINED", CM_NULLPTR); + this->SetPropertyDefault("AUTOMOC", CM_NULLPTR); + this->SetPropertyDefault("AUTOUIC", CM_NULLPTR); + this->SetPropertyDefault("AUTORCC", CM_NULLPTR); + this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", CM_NULLPTR); + this->SetPropertyDefault("AUTOUIC_OPTIONS", CM_NULLPTR); + this->SetPropertyDefault("AUTORCC_OPTIONS", CM_NULLPTR); + this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", CM_NULLPTR); + this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", CM_NULLPTR); + this->SetPropertyDefault("WIN32_EXECUTABLE", CM_NULLPTR); + this->SetPropertyDefault("MACOSX_BUNDLE", CM_NULLPTR); + this->SetPropertyDefault("MACOSX_RPATH", CM_NULLPTR); + this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", CM_NULLPTR); + this->SetPropertyDefault("C_CLANG_TIDY", CM_NULLPTR); + this->SetPropertyDefault("C_COMPILER_LAUNCHER", CM_NULLPTR); + this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", CM_NULLPTR); + this->SetPropertyDefault("LINK_WHAT_YOU_USE", CM_NULLPTR); + this->SetPropertyDefault("C_STANDARD", CM_NULLPTR); + this->SetPropertyDefault("C_STANDARD_REQUIRED", CM_NULLPTR); + this->SetPropertyDefault("C_EXTENSIONS", CM_NULLPTR); + this->SetPropertyDefault("CXX_CLANG_TIDY", CM_NULLPTR); + this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", CM_NULLPTR); + this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", CM_NULLPTR); + this->SetPropertyDefault("CXX_STANDARD", CM_NULLPTR); + this->SetPropertyDefault("CXX_STANDARD_REQUIRED", CM_NULLPTR); + this->SetPropertyDefault("CXX_EXTENSIONS", CM_NULLPTR); + this->SetPropertyDefault("LINK_SEARCH_START_STATIC", CM_NULLPTR); + this->SetPropertyDefault("LINK_SEARCH_END_STATIC", CM_NULLPTR); } // Collect the set of configuration types. @@ -171,7 +171,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) "PDB_OUTPUT_DIRECTORY_", "COMPILE_PDB_OUTPUT_DIRECTORY_", "MAP_IMPORTED_CONFIG_", - 0 + CM_NULLPTR }; for (std::vector::iterator ci = configNames.begin(); ci != configNames.end(); ++ci) { @@ -183,7 +183,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) } std::string property = *p; property += configUpper; - this->SetPropertyDefault(property, 0); + this->SetPropertyDefault(property, CM_NULLPTR); } // Initialize per-configuration name postfix property from the @@ -195,7 +195,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->TargetTypeValue != cmState::INTERFACE_LIBRARY) { std::string property = cmSystemTools::UpperCase(*ci); property += "_POSTFIX"; - this->SetPropertyDefault(property, 0); + this->SetPropertyDefault(property, CM_NULLPTR); } } } @@ -239,27 +239,27 @@ void cmTarget::SetMakefile(cmMakefile* mf) if (this->GetType() != cmState::INTERFACE_LIBRARY && this->GetType() != cmState::UTILITY) { - this->SetPropertyDefault("C_VISIBILITY_PRESET", 0); - this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0); - this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0); + this->SetPropertyDefault("C_VISIBILITY_PRESET", CM_NULLPTR); + this->SetPropertyDefault("CXX_VISIBILITY_PRESET", CM_NULLPTR); + this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", CM_NULLPTR); } if (this->TargetTypeValue == cmState::EXECUTABLE) { - this->SetPropertyDefault("ANDROID_GUI", 0); - this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0); - this->SetPropertyDefault("ENABLE_EXPORTS", 0); + this->SetPropertyDefault("ANDROID_GUI", CM_NULLPTR); + this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", CM_NULLPTR); + this->SetPropertyDefault("ENABLE_EXPORTS", CM_NULLPTR); } if (this->TargetTypeValue == cmState::SHARED_LIBRARY || this->TargetTypeValue == cmState::MODULE_LIBRARY) { this->SetProperty("POSITION_INDEPENDENT_CODE", "True"); } if (this->TargetTypeValue == cmState::SHARED_LIBRARY) { - this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", 0); + this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", CM_NULLPTR); } if (this->GetType() != cmState::INTERFACE_LIBRARY && this->GetType() != cmState::UTILITY) { - this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0); + this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", CM_NULLPTR); } // Record current policies for later use. @@ -274,8 +274,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) if (this->GetType() != cmState::INTERFACE_LIBRARY && this->GetType() != cmState::UTILITY) { - this->SetPropertyDefault("JOB_POOL_COMPILE", 0); - this->SetPropertyDefault("JOB_POOL_LINK", 0); + this->SetPropertyDefault("JOB_POOL_COMPILE", CM_NULLPTR); + this->SetPropertyDefault("JOB_POOL_LINK", CM_NULLPTR); } } @@ -293,7 +293,7 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace( std::map::const_iterator i = this->UtilityBacktraces.find(u); if (i == this->UtilityBacktraces.end()) { - return 0; + return CM_NULLPTR; } return &i->second; @@ -409,7 +409,7 @@ cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) { std::string src = this->ProcessSourceItemCMP0049(s); if (!s.empty() && src.empty()) { - return 0; + return CM_NULLPTR; } return this->AddSource(src); } @@ -480,7 +480,7 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) this->Internal->SourceBacktraces.push_back(lfbt); } if (cmGeneratorExpression::Find(src) != std::string::npos) { - return 0; + return CM_NULLPTR; } return this->Makefile->GetOrCreateSource(src); } @@ -1064,7 +1064,7 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const return true; } std::ostringstream e; - const char* modal = 0; + const char* modal = CM_NULLPTR; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (context->GetPolicyStatus(cmPolicies::CMP0026)) { case cmPolicies::WARN: @@ -1106,7 +1106,7 @@ const char* cmTarget::GetProperty(const std::string& prop, "The property \"" << prop << "\" is not allowed."; context->IssueMessage(cmake::FATAL_ERROR, e.str()); - return 0; + return CM_NULLPTR; } // Watch for special "computed" properties that are dependent on @@ -1119,7 +1119,7 @@ const char* cmTarget::GetProperty(const std::string& prop, static const std::string propLOCATION = "LOCATION"; if (prop == propLOCATION) { if (!this->HandleLocationPropertyPolicy(context)) { - return 0; + return CM_NULLPTR; } // Set the LOCATION property of the target. @@ -1148,7 +1148,7 @@ const char* cmTarget::GetProperty(const std::string& prop, // Support "LOCATION_". else if (cmHasLiteralPrefix(prop, "LOCATION_")) { if (!this->HandleLocationPropertyPolicy(context)) { - return 0; + return CM_NULLPTR; } const char* configName = prop.c_str() + 9; @@ -1170,7 +1170,7 @@ const char* cmTarget::GetProperty(const std::string& prop, std::string configName(prop.c_str(), prop.size() - 9); if (configName != "IMPORTED") { if (!this->HandleLocationPropertyPolicy(context)) { - return 0; + return CM_NULLPTR; } if (this->IsImported()) { this->Properties.SetProperty( @@ -1217,7 +1217,7 @@ const char* cmTarget::GetProperty(const std::string& prop, if (specialProps.count(prop)) { if (prop == propLINK_LIBRARIES) { if (this->Internal->LinkImplementationPropertyEntries.empty()) { - return 0; + return CM_NULLPTR; } static std::string output; @@ -1229,7 +1229,7 @@ const char* cmTarget::GetProperty(const std::string& prop, return cmState::GetTargetTypeName(this->GetType()); } else if (prop == propINCLUDE_DIRECTORIES) { if (this->Internal->IncludeDirectoriesEntries.empty()) { - return 0; + return CM_NULLPTR; } static std::string output; @@ -1237,7 +1237,7 @@ const char* cmTarget::GetProperty(const std::string& prop, return output.c_str(); } else if (prop == propCOMPILE_FEATURES) { if (this->Internal->CompileFeaturesEntries.empty()) { - return 0; + return CM_NULLPTR; } static std::string output; @@ -1245,7 +1245,7 @@ const char* cmTarget::GetProperty(const std::string& prop, return output.c_str(); } else if (prop == propCOMPILE_OPTIONS) { if (this->Internal->CompileOptionsEntries.empty()) { - return 0; + return CM_NULLPTR; } static std::string output; @@ -1253,7 +1253,7 @@ const char* cmTarget::GetProperty(const std::string& prop, return output.c_str(); } else if (prop == propCOMPILE_DEFINITIONS) { if (this->Internal->CompileDefinitionsEntries.empty()) { - return 0; + return CM_NULLPTR; } static std::string output; @@ -1269,7 +1269,7 @@ const char* cmTarget::GetProperty(const std::string& prop, return this->GetMakefile()->GetCurrentSourceDirectory(); } else if (prop == propSOURCES) { if (this->Internal->SourceEntries.empty()) { - return 0; + return CM_NULLPTR; } std::ostringstream ss; @@ -1434,8 +1434,8 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config, std::string result; - const char* loc = 0; - const char* imp = 0; + const char* loc = CM_NULLPTR; + const char* imp = CM_NULLPTR; std::string suffix; if (this->GetType() != cmState::INTERFACE_LIBRARY && diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9e095c2..5829d4f 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -195,7 +195,7 @@ public: * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE * commands. It is not a full path nor does it have an extension. */ - void AddUtility(const std::string& u, cmMakefile* makefile = 0); + void AddUtility(const std::string& u, cmMakefile* makefile = CM_NULLPTR); ///! Get the utilities used by this target std::set const& GetUtilities() const { return this->Utilities; } cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 774577a..1c4a9ce 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -91,7 +91,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( if (this->Target->GetType() == cmState::UTILITY) { std::ostringstream e; - const char* modal = 0; + const char* modal = CM_NULLPTR; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) { case cmPolicies::WARN: @@ -307,7 +307,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, if (!this->Target->PushTLLCommandTrace( sig, this->Makefile->GetExecutionContext())) { std::ostringstream e; - const char* modal = 0; + const char* modal = CM_NULLPTR; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) { case cmPolicies::WARN: diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index e599825..462edf9 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -24,7 +24,7 @@ cmTestGenerator::cmTestGenerator( { this->ActionsPerConfig = !test->GetOldStyle(); this->TestGenerated = false; - this->LG = 0; + this->LG = CM_NULLPTR; } cmTestGenerator::~cmTestGenerator() @@ -83,7 +83,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // Prepend with the emulator when cross compiling if required. const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); - if (emulator != 0) { + if (emulator != CM_NULLPTR) { std::vector emulatorWithArgs; cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); std::string emulatorExe(emulatorWithArgs[0]); diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 2a70ed0..c3c1d17 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -22,7 +22,7 @@ std::string cmTimestamp::CurrentTime(const std::string& formatString, bool utcFlag) { - time_t currentTimeT = time(0); + time_t currentTimeT = time(CM_NULLPTR); if (currentTimeT == time_t(-1)) { return std::string(); } @@ -56,14 +56,14 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT, struct tm timeStruct; memset(&timeStruct, 0, sizeof(timeStruct)); - struct tm* ptr = (struct tm*)0; + struct tm* ptr = (struct tm*)CM_NULLPTR; if (utcFlag) { ptr = gmtime(&timeT); } else { ptr = localtime(&timeT); } - if (ptr == 0) { + if (ptr == CM_NULLPTR) { return std::string(); } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 19837a7..7b19048 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -124,8 +124,9 @@ bool cmTryRunCommand::InitialPass(std::vector const& argv, std::string runOutputContents; if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) { - this->DoNotRunExecutable(runArgs, argv[3], - captureRunOutput ? &runOutputContents : 0); + this->DoNotRunExecutable(runArgs, argv[3], captureRunOutput + ? &runOutputContents + : CM_NULLPTR); } else { this->RunExecutable(runArgs, &runOutputContents); } @@ -186,9 +187,9 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, finalCommand += runArgs; } int timeout = 0; - bool worked = - cmSystemTools::RunSingleCommand(finalCommand.c_str(), out, out, &retVal, 0, - cmSystemTools::OUTPUT_NONE, timeout); + bool worked = cmSystemTools::RunSingleCommand( + finalCommand.c_str(), out, out, &retVal, CM_NULLPTR, + cmSystemTools::OUTPUT_NONE, timeout); // set the run var char retChar[1000]; if (worked) { @@ -230,7 +231,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->RunResultVariable + "__TRYRUN_OUTPUT"; bool error = false; - if (this->Makefile->GetDefinition(this->RunResultVariable) == 0) { + if (this->Makefile->GetDefinition(this->RunResultVariable) == CM_NULLPTR) { // if the variables doesn't exist, create it with a helpful error text // and mark it as advanced std::string comment; @@ -252,8 +253,8 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, } // is the output from the executable used ? - if (out != 0) { - if (this->Makefile->GetDefinition(internalRunOutputName) == 0) { + if (out != CM_NULLPTR) { + if (this->Makefile->GetDefinition(internalRunOutputName) == CM_NULLPTR) { // if the variables doesn't exist, create it with a helpful error text // and mark it as advanced std::string comment; @@ -301,7 +302,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment += " to\n" " the exit code (in many cases 0 for success), otherwise " "enter \"FAILED_TO_RUN\".\n"; - if (out != 0) { + if (out != CM_NULLPTR) { comment += internalRunOutputName; comment += "\n contains the text the executable " @@ -332,7 +333,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, << this->Makefile->GetDefinition(this->RunResultVariable) << "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n"; - if (out != 0) { + if (out != CM_NULLPTR) { file << "set( " << internalRunOutputName << " \n \"" << this->Makefile->GetDefinition(internalRunOutputName) << "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n"; @@ -345,7 +346,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "please set the following cache variables " "appropriately:\n"; errorMessage += " " + this->RunResultVariable + " (advanced)\n"; - if (out != 0) { + if (out != CM_NULLPTR) { errorMessage += " " + internalRunOutputName + " (advanced)\n"; } errorMessage += detailsString; @@ -353,7 +354,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, return; } - if (out != 0) { + if (out != CM_NULLPTR) { (*out) = this->Makefile->GetDefinition(internalRunOutputName); } } diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index c04c44a..05ba65a 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -47,7 +47,7 @@ bool cmUnsetCommand::InitialPass(std::vector const& args, } // unset(VAR PARENT_SCOPE) else if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) { - this->Makefile->RaiseScope(variable, 0); + this->Makefile->RaiseScope(variable, CM_NULLPTR); return true; } // ERROR: second argument isn't CACHE or PARENT_SCOPE diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index f7d766e..c50cbfb 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -38,7 +38,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector const& args, bool haveCacheValue = false; if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) { - haveCacheValue = (cacheValue != 0); + haveCacheValue = (cacheValue != CM_NULLPTR); if (!haveCacheValue) { std::string msg = "UTILITY_SOURCE is used in cross compiling mode for "; msg += cacheEntry; @@ -50,7 +50,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector const& args, } else { cmState* state = this->Makefile->GetState(); haveCacheValue = - (cacheValue && (strstr(cacheValue, "(IntDir)") == 0 || + (cacheValue && (strstr(cacheValue, "(IntDir)") == CM_NULLPTR || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && (state->GetCacheMajorVersion() != 0 && state->GetCacheMinorVersion() != 0)); diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index be8f72f..5ddb907 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -36,9 +36,10 @@ public: * Add watch to the variable */ bool AddWatch(const std::string& variable, WatchMethod method, - void* client_data = 0, DeleteData delete_data = 0); + void* client_data = CM_NULLPTR, + DeleteData delete_data = CM_NULLPTR); void RemoveWatch(const std::string& variable, WatchMethod method, - void* client_data = 0); + void* client_data = CM_NULLPTR); /** * This method is called when variable is accessed @@ -71,9 +72,9 @@ protected: void* ClientData; DeleteData DeleteDataCall; Pair() - : Method(0) - , ClientData(0) - , DeleteDataCall(0) + : Method(CM_NULLPTR) + , ClientData(CM_NULLPTR) + , DeleteDataCall(CM_NULLPTR) { } ~Pair() diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 654100b..79e7c2b 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -145,9 +145,9 @@ cmake::cmake() } #endif - this->GlobalGenerator = 0; - this->ProgressCallback = 0; - this->ProgressCallbackClientData = 0; + this->GlobalGenerator = CM_NULLPTR; + this->ProgressCallback = CM_NULLPTR; + this->ProgressCallbackClientData = CM_NULLPTR; this->CurrentWorkingMode = NORMAL_MODE; #ifdef CMAKE_BUILD_WITH_CMAKE @@ -191,7 +191,7 @@ cmake::~cmake() delete this->State; if (this->GlobalGenerator) { delete this->GlobalGenerator; - this->GlobalGenerator = 0; + this->GlobalGenerator = CM_NULLPTR; } cmDeleteAll(this->Generators); #ifdef CMAKE_BUILD_WITH_CMAKE @@ -463,7 +463,8 @@ bool cmake::FindPackage(const std::vector& args) gg->CreateGenerationObjects(); cmLocalGenerator* lg = gg->LocalGenerators[0]; - std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language); + std::string includeFlags = + lg->GetIncludeFlags(includeDirs, CM_NULLPTR, language); std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS"); printf("%s %s\n", includeFlags.c_str(), definitions.c_str()); @@ -870,7 +871,7 @@ void cmake::GetRegisteredGenerators(std::vector& generators) cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) { - cmExternalMakefileProjectGenerator* extraGenerator = 0; + cmExternalMakefileProjectGenerator* extraGenerator = CM_NULLPTR; std::string name = gname; RegisteredExtraGeneratorsMap::const_iterator extraGenIt = this->ExtraGenerators.find(name); @@ -879,7 +880,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) name = extraGenerator->GetGlobalGeneratorName(name); } - cmGlobalGenerator* generator = 0; + cmGlobalGenerator* generator = CM_NULLPTR; for (RegisteredGeneratorsVector::const_iterator i = this->Generators.begin(); i != this->Generators.end(); ++i) { generator = (*i)->CreateGlobalGenerator(name, this); @@ -1707,8 +1708,8 @@ int cmake::CheckBuildSystem() // the make system's VERBOSE environment variable to enable verbose // output. This can be skipped by setting CMAKE_NO_VERBOSE (which is set // by the Eclipse and KDevelop generators). - bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0) && - (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0)); + bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != CM_NULLPTR) && + (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == CM_NULLPTR)); // This method will check the integrity of the build system if the // option was given on the command line. It reads the given file to @@ -1973,7 +1974,7 @@ cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const cmInstalledFile const& file = i->second; return &file; } else { - return 0; + return CM_NULLPTR; } } diff --git a/Source/cmake.h b/Source/cmake.h index 9ac6935..4a5376d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -250,7 +250,8 @@ public: * number provided may be negative in cases where a message is * to be displayed without any progress percentage. */ - void SetProgressCallback(ProgressCallbackType f, void* clientData = 0); + void SetProgressCallback(ProgressCallbackType f, + void* clientData = CM_NULLPTR); ///! this is called by generators to update the progress void UpdateProgress(const char* msg, float prog); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 495aae5..521a5bf 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -29,22 +29,23 @@ #ifdef CMAKE_BUILD_WITH_CMAKE static const char* cmDocumentationName[][2] = { - { 0, " cmake - Cross-Platform Makefile Generator." }, - { 0, 0 } + { CM_NULLPTR, " cmake - Cross-Platform Makefile Generator." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsage[][2] = { - { 0, " cmake [options] \n" - " cmake [options] " }, - { 0, "Specify a source directory to (re-)generate a build system for " - "it in the current working directory. Specify an existing build " - "directory to re-generate its build system." }, - { 0, 0 } + { CM_NULLPTR, " cmake [options] \n" + " cmake [options] " }, + { CM_NULLPTR, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system." }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsageNote[][2] = { - { 0, "Run 'cmake --help' for more information." }, - { 0, 0 } + { CM_NULLPTR, "Run 'cmake --help' for more information." }, + { CM_NULLPTR, CM_NULLPTR } }; #define CMAKE_BUILD_OPTIONS \ @@ -80,7 +81,7 @@ static const char* cmDocumentationOptions[][2] = { { "--no-warn-unused-cli", "Don't warn about command line options." }, { "--check-system-vars", "Find problems with variable usage in system " "files." }, - { 0, 0 } + { CM_NULLPTR, CM_NULLPTR } }; #endif @@ -106,7 +107,7 @@ static cmMakefile* cmakemainGetMakefile(void* clientdata) return gg->GetCurrentMakefile(); } } - return 0; + return CM_NULLPTR; } static std::string cmakemainGetStack(void* clientdata) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 161256e..2427286 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -315,7 +315,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Run the iwyu command line. Capture its stderr and hide its stdout. std::string stdErr; - if (!cmSystemTools::RunSingleCommand(iwyu_cmd, 0, &stdErr, &ret, 0, + if (!cmSystemTools::RunSingleCommand(iwyu_cmd, CM_NULLPTR, &stdErr, + &ret, CM_NULLPTR, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << iwyu_cmd[0] << "': " << stdErr << "\n"; @@ -343,7 +344,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Run the tidy command line. Capture its stdout and hide its stderr. std::string stdOut; - if (!cmSystemTools::RunSingleCommand(tidy_cmd, &stdOut, 0, &ret, 0, + if (!cmSystemTools::RunSingleCommand(tidy_cmd, &stdOut, CM_NULLPTR, + &ret, CM_NULLPTR, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << tidy_cmd[0] << "'\n"; return 1; @@ -363,7 +365,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Run the ldd -u -r command line. // Capture its stdout and hide its stderr. std::string stdOut; - if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, 0, &ret, 0, + if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, CM_NULLPTR, + &ret, CM_NULLPTR, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << lwyu_cmd[0] << "'\n"; return 1; @@ -379,7 +382,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Now run the real compiler command and return its result value. if (lwyu.empty() && !cmSystemTools::RunSingleCommand( - orig_cmd, 0, 0, &ret, 0, cmSystemTools::OUTPUT_PASSTHROUGH)) { + orig_cmd, CM_NULLPTR, CM_NULLPTR, &ret, CM_NULLPTR, + cmSystemTools::OUTPUT_PASSTHROUGH)) { std::cerr << "Error running '" << orig_cmd[0] << "'\n"; return 1; } @@ -429,7 +433,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Execute command from remaining arguments. std::vector cmd(ai, ae); int retval; - if (cmSystemTools::RunSingleCommand(cmd, 0, 0, &retval, NULL, + if (cmSystemTools::RunSingleCommand(cmd, CM_NULLPTR, CM_NULLPTR, &retval, + CM_NULLPTR, cmSystemTools::OUTPUT_PASSTHROUGH)) { return retval; } @@ -537,7 +542,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) time(&time_start); clock_start = clock(); int ret = 0; - cmSystemTools::RunSingleCommand(command, 0, 0, &ret); + cmSystemTools::RunSingleCommand(command, CM_NULLPTR, CM_NULLPTR, &ret); clock_finish = clock(); time(&time_finish); @@ -588,8 +593,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) int retval = 0; int timeout = 0; if (cmSystemTools::RunSingleCommand( - command.c_str(), 0, 0, &retval, directory.c_str(), - cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) { + command.c_str(), CM_NULLPTR, CM_NULLPTR, &retval, + directory.c_str(), cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) { return retval; } @@ -695,8 +700,9 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Use the make system's VERBOSE environment variable to enable // verbose output. This can be skipped by also setting CMAKE_NO_VERBOSE // (which is set by the Eclipse and KDevelop generators). - bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0) && - (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0)); + bool verbose = + ((cmSystemTools::GetEnv("VERBOSE") != CM_NULLPTR) && + (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == CM_NULLPTR)); // Create a cmake object instance to process dependencies. cmake cm; @@ -1146,7 +1152,7 @@ int cmcmd::ExecuteLinkScript(std::vector& args) } // Setup this command line. - const char* cmd[2] = { command.c_str(), 0 }; + const char* cmd[2] = { command.c_str(), CM_NULLPTR }; cmsysProcess_SetCommand(cp, cmd); // Report the command if verbose output is enabled. @@ -1156,7 +1162,7 @@ int cmcmd::ExecuteLinkScript(std::vector& args) // Run the command and wait for it to exit. cmsysProcess_Execute(cp); - cmsysProcess_WaitForExit(cp, 0); + cmsysProcess_WaitForExit(cp, CM_NULLPTR); // Report failure if any. switch (cmsysProcess_GetState(cp)) { @@ -1249,7 +1255,7 @@ int cmcmd::VisualStudioLink(std::vector& args, int type) if (args.size() < 2) { return -1; } - bool verbose = cmSystemTools::GetEnv("VERBOSE") != NULL; + bool verbose = cmSystemTools::GetEnv("VERBOSE") != CM_NULLPTR; std::vector expandedArgs; for (std::vector::iterator i = args.begin(); i != args.end(); ++i) { @@ -1273,7 +1279,7 @@ int cmcmd::VisualStudioLink(std::vector& args, int type) } static bool RunCommand(const char* comment, std::vector& command, - bool verbose, int* retCodeOut = 0) + bool verbose, int* retCodeOut = CM_NULLPTR) { if (verbose) { std::cout << comment << ":\n"; @@ -1282,8 +1288,9 @@ static bool RunCommand(const char* comment, std::vector& command, std::string output; int retCode = 0; // use rc command to create .res file - bool res = cmSystemTools::RunSingleCommand( - command, &output, &output, &retCode, 0, cmSystemTools::OUTPUT_NONE); + bool res = + cmSystemTools::RunSingleCommand(command, &output, &output, &retCode, + CM_NULLPTR, cmSystemTools::OUTPUT_NONE); // always print the output of the command, unless // it is the dumb rc command banner, but if the command // returned an error code then print the output anyway as diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 4edd62e..38ff64f 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -21,12 +21,13 @@ #include "cmsys/Encoding.hxx" static const char* cmDocumentationName[][2] = { - { 0, " ctest - Testing driver provided by CMake." }, - { 0, 0 } + { CM_NULLPTR, " ctest - Testing driver provided by CMake." }, + { CM_NULLPTR, CM_NULLPTR } }; -static const char* cmDocumentationUsage[][2] = { { 0, " ctest [options]" }, - { 0, 0 } }; +static const char* cmDocumentationUsage[][2] = { { CM_NULLPTR, + " ctest [options]" }, + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationOptions[][2] = { { "-C , --build-config ", "Choose configuration to test." }, @@ -108,7 +109,7 @@ static const char* cmDocumentationOptions[][2] = { { "--http1.0", "Submit using HTTP 1.0." }, { "--no-compress-output", "Do not compress test output when submitting." }, { "--print-labels", "Print all available test labels." }, - { 0, 0 } + { CM_NULLPTR, CM_NULLPTR } }; // this is a test driver program for cmCTest. -- cgit v0.12