瀏覽代碼

use CM_NULLPTR

Daniel Pfeifer 9 年之前
父節點
當前提交
1d6909a287
共有 100 個文件被更改,包括 442 次插入416 次删除
  1. 9 7
      Source/CPack/IFW/cmCPackIFWGenerator.cxx
  2. 2 2
      Source/CPack/IFW/cmCPackIFWInstaller.cxx
  3. 4 4
      Source/CPack/IFW/cmCPackIFWPackage.cxx
  4. 2 2
      Source/CPack/IFW/cmCPackIFWRepository.cxx
  5. 3 3
      Source/CPack/cmCPackArchiveGenerator.cxx
  6. 2 2
      Source/CPack/cmCPackComponentGroup.h
  7. 5 5
      Source/CPack/cmCPackDebGenerator.cxx
  8. 12 10
      Source/CPack/cmCPackGenerator.cxx
  9. 1 1
      Source/CPack/cmCPackGenerator.h
  10. 2 2
      Source/CPack/cmCPackGeneratorFactory.cxx
  11. 4 4
      Source/CPack/cmCPackLog.cxx
  12. 8 6
      Source/CPack/cmCPackNSISGenerator.cxx
  13. 2 2
      Source/CPack/cmCPackRPMGenerator.cxx
  14. 6 6
      Source/CPack/cpack.cxx
  15. 8 6
      Source/CTest/cmCTestBZR.cxx
  16. 9 9
      Source/CTest/cmCTestBuildAndTestHandler.cxx
  17. 8 8
      Source/CTest/cmCTestBuildCommand.cxx
  18. 12 11
      Source/CTest/cmCTestBuildHandler.cxx
  19. 3 2
      Source/CTest/cmCTestCVS.cxx
  20. 2 2
      Source/CTest/cmCTestCommand.h
  21. 9 8
      Source/CTest/cmCTestConfigureCommand.cxx
  22. 1 1
      Source/CTest/cmCTestCoverageCommand.cxx
  23. 5 5
      Source/CTest/cmCTestCoverageHandler.cxx
  24. 1 1
      Source/CTest/cmCTestCurl.cxx
  25. 23 16
      Source/CTest/cmCTestGIT.cxx
  26. 2 2
      Source/CTest/cmCTestGenericHandler.cxx
  27. 6 5
      Source/CTest/cmCTestHG.cxx
  28. 2 2
      Source/CTest/cmCTestHandlerCommand.cxx
  29. 6 6
      Source/CTest/cmCTestLaunch.cxx
  30. 9 9
      Source/CTest/cmCTestMemCheckHandler.cxx
  31. 7 7
      Source/CTest/cmCTestP4.cxx
  32. 3 3
      Source/CTest/cmCTestRunTest.cxx
  33. 1 1
      Source/CTest/cmCTestSVN.cxx
  34. 8 8
      Source/CTest/cmCTestScriptHandler.cxx
  35. 3 3
      Source/CTest/cmCTestStartCommand.cxx
  36. 2 2
      Source/CTest/cmCTestSubmitCommand.cxx
  37. 7 7
      Source/CTest/cmCTestSubmitHandler.cxx
  38. 1 1
      Source/CTest/cmCTestSubmitHandler.h
  39. 1 1
      Source/CTest/cmCTestTestCommand.cxx
  40. 8 7
      Source/CTest/cmCTestTestHandler.cxx
  41. 2 2
      Source/CTest/cmCTestUpdateCommand.cxx
  42. 1 1
      Source/CTest/cmCTestUpdateHandler.cxx
  43. 1 1
      Source/CTest/cmCTestUploadCommand.cxx
  44. 1 1
      Source/CTest/cmCTestVC.cxx
  45. 4 4
      Source/CTest/cmCTestVC.h
  46. 2 2
      Source/CTest/cmParseMumpsCoverage.cxx
  47. 2 2
      Source/CTest/cmProcess.cxx
  48. 14 13
      Source/CursesDialog/ccmake.cxx
  49. 3 3
      Source/CursesDialog/cmCursesCacheEntryComposite.cxx
  50. 2 2
      Source/CursesDialog/cmCursesForm.cxx
  51. 4 4
      Source/CursesDialog/cmCursesLongMessageForm.cxx
  52. 17 17
      Source/CursesDialog/cmCursesMainForm.cxx
  53. 1 1
      Source/CursesDialog/cmCursesMainForm.h
  54. 1 1
      Source/CursesDialog/cmCursesStringWidget.cxx
  55. 1 1
      Source/CursesDialog/cmCursesWidget.cxx
  56. 1 1
      Source/cmAddCustomCommandCommand.cxx
  57. 1 1
      Source/cmAddCustomTargetCommand.cxx
  58. 4 3
      Source/cmArchiveWrite.cxx
  59. 2 2
      Source/cmArchiveWrite.h
  60. 2 2
      Source/cmBuildCommand.cxx
  61. 11 11
      Source/cmCPluginAPI.cxx
  62. 25 25
      Source/cmCTest.cxx
  63. 4 4
      Source/cmCTest.h
  64. 5 5
      Source/cmCacheManager.cxx
  65. 4 3
      Source/cmCacheManager.h
  66. 1 1
      Source/cmCommand.h
  67. 5 5
      Source/cmCommandArgumentParserHelper.cxx
  68. 14 14
      Source/cmCommandArgumentsHelper.cxx
  69. 5 5
      Source/cmCommandArgumentsHelper.h
  70. 1 1
      Source/cmCommonTargetGenerator.cxx
  71. 3 3
      Source/cmComputeLinkDepends.cxx
  72. 1 1
      Source/cmComputeLinkDepends.h
  73. 9 9
      Source/cmComputeLinkInformation.cxx
  74. 3 2
      Source/cmComputeLinkInformation.h
  75. 2 2
      Source/cmComputeTargetDepends.cxx
  76. 1 1
      Source/cmConditionEvaluator.cxx
  77. 1 1
      Source/cmCoreTryCompile.cxx
  78. 1 1
      Source/cmCryptoHash.cxx
  79. 1 1
      Source/cmCurl.h
  80. 2 2
      Source/cmCustomCommand.cxx
  81. 1 1
      Source/cmCustomCommandGenerator.cxx
  82. 1 1
      Source/cmDefinitions.cxx
  83. 6 6
      Source/cmDepends.cxx
  84. 1 1
      Source/cmDepends.h
  85. 5 5
      Source/cmDependsC.cxx
  86. 1 1
      Source/cmDependsFortran.cxx
  87. 5 5
      Source/cmDependsJavaParserHelper.cxx
  88. 8 8
      Source/cmDocumentation.cxx
  89. 1 1
      Source/cmDocumentation.h
  90. 2 2
      Source/cmDynamicLoader.cxx
  91. 10 10
      Source/cmELF.cxx
  92. 4 4
      Source/cmExecProgramCommand.cxx
  93. 2 1
      Source/cmExecProgramCommand.h
  94. 3 3
      Source/cmExecuteProcessCommand.cxx
  95. 2 2
      Source/cmExportBuildFileGenerator.cxx
  96. 3 3
      Source/cmExportCommand.cxx
  97. 2 1
      Source/cmExportTryCompileFileGenerator.cxx
  98. 1 1
      Source/cmExprParserHelper.cxx
  99. 7 7
      Source/cmExtraCodeBlocksGenerator.cxx
  100. 3 3
      Source/cmExtraEclipseCDT4Generator.cxx

+ 9 - 7
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<cmCPackComponentGroup*, cmCPackIFWPackage*>::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<cmCPackComponent*, cmCPackIFWPackage*>::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."

+ 2 - 2
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

+ 4 - 4
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

+ 2 - 2
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

+ 3 - 3
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]

+ 2 - 2
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)
   {
   }
 

+ 5 - 5
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<std::string>::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;
         }

+ 12 - 10
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;

+ 1 - 1
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

+ 2 - 2
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)();
 }

+ 4 - 4
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) {

+ 8 - 6
Source/CPack/cmCPackNSISGenerator.cxx

@@ -212,7 +212,7 @@ int cmCPackNSISGenerator::PackageFiles()
     std::map<std::string, cmCPackComponentGroup>::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 ||

+ 2 - 2
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;

+ 6 - 6
Source/CPack/cpack.cxx

@@ -27,13 +27,13 @@
 #include <cmsys/SystemTools.hxx>
 
 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 <generator> [options]" },
-  { 0, 0 }
+  { CM_NULLPTR, "  cpack -G <generator> [options]" },
+  { CM_NULLPTR, CM_NULLPTR }
 };
 
 static const char* cmDocumentationOptions[][2] = {
@@ -47,7 +47,7 @@ static const char* cmDocumentationOptions[][2] = {
   { "-R <package version>", "override/define CPACK_PACKAGE_VERSION" },
   { "-B <package directory>", "override/define CPACK_PACKAGE_DIRECTORY" },
   { "--vendor <vendor name>", "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();

+ 8 - 6
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<XML_Parser>(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);

+ 9 - 9
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";

+ 8 - 8
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;
     }
   }
 

+ 12 - 11
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) {

+ 3 - 2
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> ");

+ 2 - 2
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;

+ 9 - 8
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;

+ 1 - 1
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.

+ 5 - 5
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);

+ 1 - 1
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<char> responseData;
   std::vector<char> debugData;

+ 23 - 16
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);

+ 2 - 2
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();
 }

+ 6 - 5
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>{file_dels}</file_dels>\n"
                               "</logentry>\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);

+ 2 - 2
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<std::string> 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;

+ 6 - 6
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";

+ 9 - 9
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);

+ 7 - 7
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> ");

+ 3 - 3
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(&current_time);
   int gm_hour = lctime->tm_hour;
   time_t gm_time = mktime(lctime);

+ 1 - 1
Source/CTest/cmCTestSVN.cxx

@@ -291,7 +291,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> 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);

+ 8 - 8
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));
   }
 

+ 3 - 3
Source/CTest/cmCTestStartCommand.cxx

@@ -32,12 +32,12 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> 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++;

+ 2 - 2
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.

+ 7 - 7
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);
 

+ 1 - 1
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

+ 1 - 1
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;
 }
 

+ 8 - 7
Source/CTest/cmCTestTestHandler.cxx

@@ -336,7 +336,7 @@ cmCTestTestHandler::cmCTestTestHandler()
 
   this->MemCheck = false;
 
-  this->LogFile = 0;
+  this->LogFile = CM_NULLPTR;
 
   // regex to detect <DartMeasurement>...</DartMeasurement>
   this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
@@ -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<std::string>& 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<std::string>& 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) {

+ 2 - 2
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);

+ 1 - 1
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";

+ 1 - 1
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<cmCTestUploadHandler*>(handler)->SetFiles(this->Files);
 

+ 1 - 1
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";

+ 4 - 4
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,

+ 2 - 2
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()) {

+ 2 - 2
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()) {

+ 14 - 13
Source/CursesDialog/ccmake.cxx

@@ -24,29 +24,30 @@
 #include <form.h>
 
 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 <path-to-source>\n"
-       "  ccmake <path-to-existing-build>" },
-  { 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 <path-to-source>\n"
+                "  ccmake <path-to-existing-build>" },
+  { 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;
 

+ 3 - 3
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;
   }
 }

+ 2 - 2
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;
   }
 }
 

+ 4 - 4
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);

+ 17 - 17
Source/CursesDialog/cmCursesMainForm.cxx

@@ -36,8 +36,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> 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<cmCursesWidget*>(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<cmCursesWidget*>(
       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<std::string>();
@@ -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<cmCursesWidget*>(
           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<cmCursesCacheEntryComposite*>::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<cmCursesWidget*>(
           field_userptr(this->Fields[findex - 2]));

+ 1 - 1
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);
 
   /**

+ 1 - 1
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];

+ 1 - 1
Source/CursesDialog/cmCursesWidget.cxx

@@ -23,7 +23,7 @@ cmCursesWidget::~cmCursesWidget()
 {
   if (this->Field) {
     free_field(this->Field);
-    this->Field = 0;
+    this->Field = CM_NULLPTR;
   }
 }
 

+ 1 - 1
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<std::string> depends, outputs, output, byproducts;
   bool verbatim = false;
   bool append = false;

+ 1 - 1
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<std::string> sources;
 
   // Keep track of parser state.

+ 4 - 3
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<archive_write_callback*>(&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 += "': ";

+ 2 - 2
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.  */

+ 2 - 2
Source/cmBuildCommand.cxx

@@ -36,8 +36,8 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> 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
   {

+ 11 - 11
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<std::string> no_byproducts;
   std::vector<std::string> 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<int>(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<cmMakefile*>(arg);
   cmCPluginAPISourceFile* osf = static_cast<cmCPluginAPISourceFile*>(arg2);
   if (osf->FullPath.empty()) {
-    return 0;
+    return CM_NULLPTR;
   }
 
   // Create the real cmSourceFile instance and copy over saved information.

+ 25 - 25
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(&currenttime);
   // return ::CleanString(ctime(&currenttime));
   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<const char*> 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<const char*> 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<std::string>& 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(&current_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

+ 4 - 4
Source/cmCTest.h

@@ -120,7 +120,7 @@ public:
   typedef std::set<std::string> SetOfStrings;
 
   ///! Process Command line arguments
-  int Run(std::vector<std::string>&, std::string* output = 0);
+  int Run(std::vector<std::string>&, 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<char> const& process_output);

+ 5 - 5
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;
 }

+ 4 - 3
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,

+ 1 - 1
Source/cmCommand.h

@@ -38,7 +38,7 @@ public:
    */
   cmCommand()
   {
-    this->Makefile = 0;
+    this->Makefile = CM_NULLPTR;
     this->Enabled = true;
   }
 

+ 5 - 5
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<int>(strlen(str));
   }

+ 14 - 14
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<cmCommandArgument*>::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<std::string>* args,
                                      std::vector<std::string>* unconsumedArgs)
 {
-  if (args == 0) {
+  if (args == CM_NULLPTR) {
     return;
   }
 
@@ -227,8 +227,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
     (*argIt)->Reset();
   }
 
-  cmCommandArgument* activeArgument = 0;
-  const cmCommandArgument* previousArgument = 0;
+  cmCommandArgument* activeArgument = CM_NULLPTR;
+  const cmCommandArgument* previousArgument = CM_NULLPTR;
   for (std::vector<std::string>::const_iterator it = args->begin();
        it != args->end(); ++it) {
     for (std::vector<cmCommandArgument*>::iterator argIt =
@@ -246,10 +246,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* 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);
       }
     }

+ 5 - 5
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<std::string>& 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; }

+ 1 - 1
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";

+ 3 - 3
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<std::string, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
   std::map<std::string, int>::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 <item>_LIB_DEPENDS variable.

+ 1 - 1
Source/cmComputeLinkDepends.h

@@ -44,7 +44,7 @@ public:
     bool IsFlag;
     LinkEntry()
       : Item()
-      , Target(0)
+      , Target(CM_NULLPTR)
       , IsSharedDep(false)
       , IsFlag(false)
     {

+ 9 - 9
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<std::string>::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);

+ 3 - 2
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)

+ 2 - 2
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) {

+ 1 - 1
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());

+ 1 - 1
Source/cmCoreTryCompile.cxx

@@ -77,7 +77,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
   }
 
   const char* sourceDirectory = argv[2].c_str();
-  const char* projectName = 0;
+  const char* projectName = CM_NULLPTR;
   std::string targetName;
   std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0]
   std::vector<std::string> compileDefs;

+ 1 - 1
Source/cmCryptoHash.cxx

@@ -30,7 +30,7 @@ cmsys::auto_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo)
   } else if (strcmp(algo, "SHA512") == 0) {
     return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA512);
   } else {
-    return cmsys::auto_ptr<cmCryptoHash>(0);
+    return cmsys::auto_ptr<cmCryptoHash>(CM_NULLPTR);
   }
 }
 

+ 1 - 1
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

+ 2 - 2
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;
 }
 

+ 1 - 1
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;
 }

+ 1 - 1
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,

+ 6 - 6
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";

+ 1 - 1
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; }

+ 5 - 5
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<std::string>& sources,
   std::set<std::string> dependencies;
   bool haveDeps = false;
 
-  if (this->ValidDeps != 0) {
+  if (this->ValidDeps != CM_NULLPTR) {
     std::map<std::string, DependencyVector>::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)) {

+ 1 - 1
Source/cmDependsFortran.cxx

@@ -53,7 +53,7 @@ public:
 };
 
 cmDependsFortran::cmDependsFortran()
-  : Internal(0)
+  : Internal(CM_NULLPTR)
 {
 }
 

+ 5 - 5
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<std::string> cmDependsJavaParserHelper::GetFilesProduced()
   std::vector<CurrentClass>::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 += ".";

+ 8 - 8
Source/cmDocumentation.cxx

@@ -49,12 +49,12 @@ static const char* cmDocumentationStandardOptions[][2] = {
   { "--help-variable-list [<f>]",
     "List variables with help available and exit." },
   { "--help-variables [<f>]", "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<cmDocumentationEntry>& 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<cmDocumentationEntry>& 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());

+ 1 - 1
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

+ 2 - 2
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()

+ 10 - 10
Source/cmELF.cxx

@@ -672,7 +672,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::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<Types>::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<Types>::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<Types>::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<Types>::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<cmsys::ifstream> 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;
   }
 }
 

+ 4 - 4
Source/cmExecProgramCommand.cxx

@@ -90,7 +90,7 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> 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;

+ 2 - 1
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

+ 3 - 3
Source/cmExecuteProcessCommand.cxx

@@ -161,7 +161,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> 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<std::string> 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<std::string> 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);

+ 2 - 2
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)

+ 3 - 3
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<std::string> 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);
   }
 

+ 2 - 1
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<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
 

+ 1 - 1
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()

+ 7 - 7
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;
         }
       }

+ 3 - 3
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 {

部分文件因文件數量過多而無法顯示