diff options
235 files changed, 1167 insertions, 1214 deletions
diff --git a/.clang-tidy b/.clang-tidy index a9d121a..5171207 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -24,7 +24,4 @@ readability-*,\ -readability-simplify-boolean-expr,\ " HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$' -CheckOptions: - - key: modernize-use-nullptr.NullMacros - value: 'CM_NULLPTR' ... diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx index e8f05bd..1e72641 100644 --- a/Source/CPack/IFW/cmCPackIFWCommon.cxx +++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx @@ -15,14 +15,14 @@ #include <vector> cmCPackIFWCommon::cmCPackIFWCommon() - : Generator(CM_NULLPTR) + : Generator(nullptr) { } const char* cmCPackIFWCommon::GetOption(const std::string& op) const { return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op) - : CM_NULLPTR; + : nullptr; } bool cmCPackIFWCommon::IsOn(const std::string& op) const diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 6861623..a1df32c 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -73,7 +73,7 @@ int cmCPackIFWGenerator::PackageFiles() int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl); bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, CM_NULLPTR, + &output, &retVal, nullptr, this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); @@ -171,7 +171,7 @@ int cmCPackIFWGenerator::PackageFiles() int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl); bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, CM_NULLPTR, + &output, &retVal, nullptr, this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); @@ -534,7 +534,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage( { std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit = this->GroupPackages.find(group); - return pit != this->GroupPackages.end() ? pit->second : CM_NULLPTR; + return pit != this->GroupPackages.end() ? pit->second : nullptr; } cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( @@ -542,7 +542,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( { std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit = this->ComponentPackages.find(component); - return pit != this->ComponentPackages.end() ? pit->second : CM_NULLPTR; + return pit != this->ComponentPackages.end() ? pit->second : nullptr; } cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( @@ -564,7 +564,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( } } else { this->Repositories.erase(repositoryName); - repository = CM_NULLPTR; + repository = nullptr; cmCPackIFWLogger(WARNING, "Invalid repository \"" << repositoryName << "\"" << " configuration. Repository will be skipped." diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index c5311c3..8461309 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -92,7 +92,7 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const //------------------------------------------------------ cmCPackIFWPackage --- cmCPackIFWPackage::cmCPackIFWPackage() - : Installer(CM_NULLPTR) + : Installer(nullptr) { } diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx index 0dcc74a..b050b85 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.cxx +++ b/Source/CPack/WiX/cmWIXPatchParser.cxx @@ -72,7 +72,7 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts) void cmWIXPatchParser::StartFragment(const char** attributes) { - cmWIXPatchElement* new_element = CM_NULLPTR; + cmWIXPatchElement* new_element = nullptr; /* find the id of for fragment */ for (size_t i = 0; attributes[i]; i += 2) { const std::string key = attributes[i]; diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 575c949..1e45b48 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -79,7 +79,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( ++fileIt) { std::string rp = filePrefix + *fileIt; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl); - archive.Add(rp, 0, CM_NULLPTR, false); + archive.Add(rp, 0, nullptr, false); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " << archive.GetError() << std::endl); @@ -146,7 +146,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 == CM_NULLPTR) { + if (compIt->second.Group == nullptr) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -255,7 +255,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, CM_NULLPTR, false); + archive.Add(rp, 0, nullptr, false); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " << *fileIt << "> to archive <" << packageFileNames[0] diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index 26d69ba..96c9bca 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -36,7 +36,7 @@ class cmCPackComponent { public: cmCPackComponent() - : Group(CM_NULLPTR) + : Group(nullptr) , IsRequired(true) , IsHidden(false) , IsDisabledByDefault(false) @@ -114,7 +114,7 @@ class cmCPackComponentGroup { public: cmCPackComponentGroup() - : ParentGroup(CM_NULLPTR) + : ParentGroup(nullptr) { } diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 0705460..01306e2 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -129,7 +129,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 == CM_NULLPTR) { + if (compIt->second.Group == nullptr) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -713,7 +713,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix( // the current COMPONENT belongs to. std::string groupVar = "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; - if (CM_NULLPTR != GetOption(groupVar)) { + if (nullptr != GetOption(groupVar)) { return std::string(GetOption(groupVar)); } return componentName; @@ -928,18 +928,18 @@ static int ar_append(const char* archive, { int eval = 0; FILE* aFile = cmSystemTools::Fopen(archive, "wb+"); - if (aFile != CM_NULLPTR) { + if (aFile != 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(CM_NULLPTR, CM_NULLPTR, aFile, archive, WPAD); + SETCF(nullptr, 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 == CM_NULLPTR) { + if (file == nullptr) { eval = -1; continue; } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index d8e2753..b65eb64 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -28,14 +28,14 @@ cmCPackGenerator::cmCPackGenerator() { this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE; - this->MakefileMap = CM_NULLPTR; - this->Logger = CM_NULLPTR; + this->MakefileMap = nullptr; + this->Logger = nullptr; this->componentPackageMethod = ONE_PACKAGE_PER_GROUP; } cmCPackGenerator::~cmCPackGenerator() { - this->MakefileMap = CM_NULLPTR; + this->MakefileMap = nullptr; } void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr) @@ -156,7 +156,7 @@ int cmCPackGenerator::PrepareNames() } const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM"); if (algoSignature) { - if (cmCryptoHash::New(algoSignature).get() == CM_NULLPTR) { + if (cmCryptoHash::New(algoSignature).get() == nullptr) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: " << algoSignature << std::endl); return 0; @@ -256,7 +256,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( int retVal = 1; bool resB = cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal, - CM_NULLPTR, this->GeneratorVerbose, 0); + nullptr, this->GeneratorVerbose, 0); if (!resB || retVal) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/InstallOutput.log"; @@ -820,8 +820,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( } } - if (CM_NULLPTR != - mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { + if (nullptr != mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { if (!absoluteDestFiles.empty()) { absoluteDestFiles += ";"; } @@ -835,7 +834,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( std::string absoluteDestFileComponent = std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" + GetComponentInstallDirNameSuffix(installComponent); - if (CM_NULLPTR != this->GetOption(absoluteDestFileComponent)) { + if (nullptr != this->GetOption(absoluteDestFileComponent)) { std::string absoluteDestFilesListComponent = this->GetOption(absoluteDestFileComponent); absoluteDestFilesListComponent += ";"; @@ -1016,7 +1015,7 @@ int cmCPackGenerator::DoPackage() << packageFileName << " generated." << std::endl); /* Generate checksum file */ - if (crypto.get() != CM_NULLPTR) { + if (crypto.get() != nullptr) { std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX")); hashFile += "/" + filename.substr(0, filename.rfind(this->GetOutputExtension())); @@ -1225,7 +1224,7 @@ int cmCPackGenerator::PrepareGroupingKind() std::string groupingType; // Second way to specify grouping - if (CM_NULLPTR != this->GetOption("CPACK_COMPONENTS_GROUPING")) { + if (nullptr != this->GetOption("CPACK_COMPONENTS_GROUPING")) { groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING"); } @@ -1407,7 +1406,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( component->Group = GetComponentGroup(projectName, groupName); component->Group->Components.push_back(component); } else { - component->Group = CM_NULLPTR; + component->Group = nullptr; } const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); @@ -1475,7 +1474,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup( group->ParentGroup = GetComponentGroup(projectName, parentGroupName); group->ParentGroup->Subgroups.push_back(group); } else { - group->ParentGroup = CM_NULLPTR; + group->ParentGroup = nullptr; } } return group; diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 45777fa..ed77c0c 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -105,7 +105,7 @@ protected: cmInstalledFile const* GetInstalledFile(std::string const& name) const; virtual const char* GetOutputExtension() { return ".cpack"; } - virtual const char* GetOutputPostfix() { return CM_NULLPTR; } + virtual const char* GetOutputPostfix() { return nullptr; } /** * Prepare requested grouping kind from CPACK_xxx vars diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 834913d..1036037 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -153,7 +153,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator( { cmCPackGenerator* gen = this->NewGeneratorInternal(name); if (!gen) { - return CM_NULLPTR; + return nullptr; } this->Generators.push_back(gen); gen->SetLogger(this->Logger); @@ -166,7 +166,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal( cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it = this->GeneratorCreators.find(name); if (it == this->GeneratorCreators.end()) { - return CM_NULLPTR; + return nullptr; } return (it->second)(); } diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 5c71239..5da889d 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -19,13 +19,13 @@ cmCPackLog::cmCPackLog() this->DefaultOutput = &std::cout; this->DefaultError = &std::cerr; - this->LogOutput = CM_NULLPTR; + this->LogOutput = nullptr; this->LogOutputCleanup = false; } cmCPackLog::~cmCPackLog() { - this->SetLogOutputStream(CM_NULLPTR); + this->SetLogOutputStream(nullptr); } void cmCPackLog::SetLogOutputStream(std::ostream* os) @@ -39,13 +39,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os) bool cmCPackLog::SetLogOutputFile(const char* fname) { - cmGeneratedFileStream* cg = CM_NULLPTR; + cmGeneratedFileStream* cg = nullptr; if (fname) { cg = new cmGeneratedFileStream(fname); } if (cg && !*cg) { delete cg; - cg = CM_NULLPTR; + cg = nullptr; } this->SetLogOutputStream(cg); if (!cg) { diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 9697a38..d04ea13 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -222,7 +222,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 == CM_NULLPTR) { + if (groupIt->second.ParentGroup == nullptr) { componentCode += this->CreateComponentGroupDescription(&groupIt->second, macrosOut); } @@ -313,7 +313,7 @@ int cmCPackNSISGenerator::PackageFiles() int retVal = 1; bool res = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, - CM_NULLPTR, this->GeneratorVerbose, 0); + nullptr, this->GeneratorVerbose, 0); if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << nsisCmd << std::endl @@ -337,7 +337,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", CM_NULLPTR); + this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr); } cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" @@ -412,7 +412,7 @@ int cmCPackNSISGenerator::InitializeInternal() int retVal = 1; bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, - CM_NULLPTR, this->GeneratorVerbose, 0); + nullptr, this->GeneratorVerbose, 0); cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)"); cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); if (!resS || retVal || diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 8ec03c2..e40b74d 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -148,7 +148,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 == CM_NULLPTR) { + if (compIt->second.Group == nullptr) { std::string component(compIt->first); std::transform(component.begin(), component.end(), component.begin(), ::toupper); @@ -214,7 +214,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 == CM_NULLPTR) { + if (compIt->second.Group == nullptr) { std::string component(compIt->first); std::transform(component.begin(), component.end(), component.begin(), ::toupper); @@ -299,7 +299,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 == CM_NULLPTR) { + if (compIt->second.Group == nullptr) { cmCPackLogger( cmCPackLog::LOG_VERBOSE, "Component <" << compIt->second.Name @@ -430,7 +430,7 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix( // the current COMPONENT belongs to. std::string groupVar = "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; - if (CM_NULLPTR != GetOption(groupVar)) { + if (nullptr != GetOption(groupVar)) { return std::string(GetOption(groupVar)); } return componentName; diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index a44bc3d..cfa5c26 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -29,13 +29,13 @@ #include "cmake.h" static const char* cmDocumentationName[][2] = { - { CM_NULLPTR, " cpack - Packaging driver provided by CMake." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " cpack - Packaging driver provided by CMake." }, + { nullptr, nullptr } }; static const char* cmDocumentationUsage[][2] = { - { CM_NULLPTR, " cpack -G <generator> [options]" }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " cpack -G <generator> [options]" }, + { nullptr, nullptr } }; static const char* cmDocumentationOptions[][2] = { @@ -49,7 +49,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" }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, nullptr } }; int cpackUnknownArgument(const char* /*unused*/, void* /*unused*/) @@ -208,7 +208,7 @@ int main(int argc, char const* const* argv) cmCPackGeneratorFactory generators; generators.SetLogger(&log); - cmCPackGenerator* cpackGenerator = CM_NULLPTR; + cmCPackGenerator* cpackGenerator = nullptr; cmDocumentation doc; doc.addCPackStandardDocSections(); diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 94f39c2..4c9c5ca 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -136,13 +136,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", CM_NULLPTR }; + const char* bzr_info[] = { bzr, "info", 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", CM_NULLPTR }; + const char* bzr_revno[] = { bzr, "revno", nullptr }; std::string rev; RevnoParser rout(this, "revno-out> ", rev); OutputLogger rerr(this->Log, "revno-err> "); @@ -190,7 +190,7 @@ public: if (res) { XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser), cmBZRXMLParserUnknownEncodingHandler, - CM_NULLPTR); + nullptr); } return res; } @@ -380,7 +380,7 @@ bool cmCTestBZR::UpdateImpl() bzr_update.push_back(this->URL.c_str()); - bzr_update.push_back(CM_NULLPTR); + bzr_update.push_back(nullptr); // For some reason bzr uses stderr to display the update status. OutputLogger out(this->Log, "pull-out> "); @@ -408,8 +408,7 @@ bool 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(), - CM_NULLPTR + bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), nullptr }; { LogParser out(this, "log-out> "); @@ -467,7 +466,7 @@ bool cmCTestBZR::LoadModifications() { // Run "bzr status" which reports local modifications. const char* bzr = this->CommandLineTool.c_str(); - const char* bzr_status[] = { bzr, "status", "-SV", CM_NULLPTR }; + const char* bzr_status[] = { bzr, "status", "-SV", nullptr }; StatusParser out(this, "status-out> "); OutputLogger err(this->Log, "status-err> "); this->RunChild(bzr_status, &out, &err); diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index cc29071..466fc78 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -65,7 +65,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, args.push_back(toolset); } - const char* config = CM_NULLPTR; + const char* config = nullptr; if (!this->CTest->GetConfigType().empty()) { config = this->CTest->GetConfigType().c_str(); } @@ -148,10 +148,10 @@ public: } ~cmCTestBuildAndTestCaptureRAII() { - 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); + this->CM.SetProgressCallback(nullptr, nullptr); + cmSystemTools::SetStderrCallback(nullptr, nullptr); + cmSystemTools::SetStdoutCallback(nullptr, nullptr); + cmSystemTools::SetMessageCallback(nullptr, nullptr); } }; @@ -236,7 +236,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } } std::string output; - const char* config = CM_NULLPTR; + const char* config = nullptr; if (!this->CTest->GetConfigType().empty()) { config = this->CTest->GetConfigType().c_str(); } @@ -308,7 +308,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(CM_NULLPTR); + testCommand.push_back(nullptr); std::string outs; int retval = 0; // run the test from the this->BuildRunDir if set @@ -334,8 +334,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } } - int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, - CM_NULLPTR, remainingTime, CM_NULLPTR); + int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, nullptr, + remainingTime, nullptr); if (runTestRes != cmsysProcess_State_Exited || retval != 0) { out << "Test command failed: " << testCommand[0] << "\n"; diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 64ef8de..074f085 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -17,14 +17,14 @@ class cmExecutionStatus; cmCTestBuildCommand::cmCTestBuildCommand() { - this->GlobalGenerator = CM_NULLPTR; + this->GlobalGenerator = 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] = CM_NULLPTR; + this->Arguments[ctb_LAST] = nullptr; this->Last = ctb_LAST; } @@ -32,7 +32,7 @@ cmCTestBuildCommand::~cmCTestBuildCommand() { if (this->GlobalGenerator) { delete this->GlobalGenerator; - this->GlobalGenerator = CM_NULLPTR; + this->GlobalGenerator = nullptr; } } @@ -41,7 +41,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() cmCTestGenericHandler* handler = this->CTest->GetInitializedHandler("build"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate build handler"); - return CM_NULLPTR; + return nullptr; } this->Handler = (cmCTestBuildHandler*)handler; @@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() if (this->GlobalGenerator) { if (this->GlobalGenerator->GetName() != cmakeGeneratorName) { delete this->GlobalGenerator; - this->GlobalGenerator = CM_NULLPTR; + this->GlobalGenerator = nullptr; } } if (!this->GlobalGenerator) { @@ -102,11 +102,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() e += "\""; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e); cmSystemTools::SetFatalErrorOccured(); - return CM_NULLPTR; + return nullptr; } } if (strlen(cmakeBuildConfiguration) == 0) { - const char* config = CM_NULLPTR; + const char* config = nullptr; #ifdef CMAKE_INTDIR config = CMAKE_INTDIR; #endif @@ -143,7 +143,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() "with a custom command line."; /* clang-format on */ this->SetError(ostr.str()); - return CM_NULLPTR; + return nullptr; } } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index f9116e3..3762e13 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -74,7 +74,7 @@ static const char* cmCTestErrorMatches[] = { "^The project cannot be built\\.", "^\\[ERROR\\]", "^Command .* failed with exit code", - CM_NULLPTR + nullptr }; static const char* cmCTestErrorExceptions[] = { @@ -89,7 +89,7 @@ static const char* cmCTestErrorExceptions[] = { ":[ \\t]+Where:", "([^ :]+):([0-9]+): Warning", "------ Build started: .* ------", - CM_NULLPTR + nullptr }; static const char* cmCTestWarningMatches[] = { @@ -114,7 +114,7 @@ static const char* cmCTestWarningMatches[] = { "cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*", "^CMake Warning.*:", "^\\[WARNING\\]", - CM_NULLPTR + nullptr }; static const char* cmCTestWarningExceptions[] = { @@ -134,7 +134,7 @@ static const char* cmCTestWarningExceptions[] = { "ld32: WARNING 85: definition of dataKey in", "cc: warning 422: Unknown option \"\\+b", "_with_warning_C", - CM_NULLPTR + nullptr }; struct cmCTestBuildCompileErrorWarningRex @@ -152,7 +152,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 }, - { CM_NULLPTR, 0, 0 } + { nullptr, 0, 0 } }; cmCTestBuildHandler::cmCTestBuildHandler() @@ -504,7 +504,7 @@ public: { } FragmentCompare() - : FTC(CM_NULLPTR) + : FTC(nullptr) { } bool operator()(std::string const& l, std::string const& r) const @@ -781,7 +781,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(CM_NULLPTR); + argv.push_back(nullptr); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:", this->Quiet); @@ -835,7 +835,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, // For every chunk of data int res; - while ((res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR))) { + while ((res = cmsysProcess_WaitForData(cp, &data, &length, 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) { @@ -866,9 +866,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, &this->BuildProcessingQueue); } - this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs, + this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs, &this->BuildProcessingQueue); - this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs, + this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs, &this->BuildProcessingErrorQueue); cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" @@ -876,7 +876,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, this->Quiet); // Properly handle output of the build command - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); int result = cmsysProcess_GetState(cp); if (result == cmsysProcess_State_Exited) { diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index fad360b..f2a9a85 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -96,7 +96,7 @@ bool cmCTestCVS::UpdateImpl() ai != args.end(); ++ai) { cvs_update.push_back(ai->c_str()); } - cvs_update.push_back(CM_NULLPTR); + cvs_update.push_back(nullptr); UpdateParser out(this, "up-out> "); UpdateParser err(this, "up-err> "); @@ -221,8 +221,9 @@ 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(), CM_NULLPTR }; + const char* cvs_log[] = { + cvs, "log", "-N", branchFlag, file.c_str(), nullptr + }; LogParser out(this, "log-out> ", revisions); OutputLogger err(this->Log, "log-err> "); diff --git a/Source/CTest/cmCTestCommand.h b/Source/CTest/cmCTestCommand.h index 6fc237a..8efb419 100644 --- a/Source/CTest/cmCTestCommand.h +++ b/Source/CTest/cmCTestCommand.h @@ -20,8 +20,8 @@ class cmCTestCommand : public cmCommand public: cmCTestCommand() { - this->CTest = CM_NULLPTR; - this->CTestScriptHandler = CM_NULLPTR; + this->CTest = nullptr; + this->CTestScriptHandler = nullptr; } cmCTest* CTest; diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index aca5bd3..faa75d3 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -16,7 +16,7 @@ cmCTestConfigureCommand::cmCTestConfigureCommand() { this->Arguments[ctc_OPTIONS] = "OPTIONS"; - this->Arguments[ctc_LAST] = CM_NULLPTR; + this->Arguments[ctc_LAST] = nullptr; this->Last = ctc_LAST; } @@ -33,7 +33,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() "Build directory not specified. Either use BUILD " "argument to CTEST_CONFIGURE command or set CTEST_BINARY_DIRECTORY " "variable"); - return CM_NULLPTR; + return nullptr; } const char* ctestConfigureCommand = @@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() "Source directory not specified. Either use SOURCE " "argument to CTEST_CONFIGURE command or set CTEST_SOURCE_DIRECTORY " "variable"); - return CM_NULLPTR; + return nullptr; } const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; @@ -61,7 +61,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() std::ostringstream e; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; this->SetError(e.str()); - return CM_NULLPTR; + return nullptr; } bool multiConfig = false; @@ -88,9 +88,8 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() cmakeConfigureCommand += option; cmakeConfigureCommand += "\""; - if ((CM_NULLPTR != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) || - (CM_NULLPTR != - strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) { + if ((nullptr != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) || + (nullptr != strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) { cmakeBuildTypeInOptions = true; } } @@ -137,7 +136,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 CM_NULLPTR; + return nullptr; } } @@ -152,7 +151,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() if (!handler) { this->SetError( "internal CTest error. Cannot instantiate configure handler"); - return CM_NULLPTR; + return nullptr; } handler->SetQuiet(this->Quiet); return handler; diff --git a/Source/CTest/cmCTestCoverageCommand.cxx b/Source/CTest/cmCTestCoverageCommand.cxx index 535da58..d2003ba 100644 --- a/Source/CTest/cmCTestCoverageCommand.cxx +++ b/Source/CTest/cmCTestCoverageCommand.cxx @@ -23,7 +23,7 @@ cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler() this->CTest->GetInitializedHandler("coverage")); if (!handler) { this->SetError("internal CTest error. Cannot instantiate test handler"); - return CM_NULLPTR; + return nullptr; } // If a LABELS option was given, select only files with the labels. diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 877cd24..e3d68c6 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -72,7 +72,7 @@ public: i != this->CommandLineStrings.end(); ++i) { args.push_back(i->c_str()); } - args.push_back(CM_NULLPTR); // null terminate + args.push_back(nullptr); // null terminate cmsysProcess_SetCommand(this->Process, &*args.begin()); if (!this->WorkingDirectory.empty()) { cmsysProcess_SetWorkingDirectory(this->Process, @@ -97,7 +97,7 @@ public: { cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname); } - int WaitForExit(double* timeout = CM_NULLPTR) + int WaitForExit(double* timeout = nullptr) { this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout); return this->PipeState; @@ -1759,7 +1759,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. ", - CM_NULLPTR + nullptr }; } @@ -1787,7 +1787,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "run covbr: " << std::endl, this->Quiet); - if (!this->RunBullseyeCommand(cont, "covbr", CM_NULLPTR, outputFile)) { + if (!this->RunBullseyeCommand(cont, "covbr", nullptr, outputFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." << "\n"); return -1; @@ -1860,7 +1860,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( covLogXML.StartElement("Report"); // write the bullseye header line = 0; - for (int k = 0; bullseyeHelp[k] != CM_NULLPTR; ++k) { + for (int k = 0; bullseyeHelp[k] != nullptr; ++k) { covLogXML.StartElement("Line"); covLogXML.Attribute("Number", line); covLogXML.Attribute("Count", -1); diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b80ea5a..b0b9923 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -145,7 +145,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback); // Set Content-Type to satisfy fussy modsecurity rules. struct curl_slist* headers = - ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml"); + ::curl_slist_append(nullptr, "Content-Type: text/xml"); // Add any additional headers that the user specified. for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin(); h != this->HttpHeaders.end(); ++h) { @@ -212,7 +212,7 @@ bool cmCTestCurl::HttpRequest(std::string const& url, ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); // Add headers if any were specified. - struct curl_slist* headers = CM_NULLPTR; + struct curl_slist* headers = nullptr; if (!this->HttpHeaders.empty()) { for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin(); diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 230aedf..8c27045 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -58,8 +58,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", "--", CM_NULLPTR }; + const char* git_rev_list[] = { git, "rev-list", "-n", "1", + "HEAD", "--", nullptr }; std::string rev; OneLineParser out(this, "rl-out> ", rev); OutputLogger err(this->Log, "rl-err> "); @@ -90,11 +90,11 @@ 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", CM_NULLPTR }; + char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", 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> "); - if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR, + if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr, cmProcessOutput::UTF8)) { git_dir = git_dir_line; } @@ -118,7 +118,7 @@ std::string cmCTestGIT::FindGitDir() 0 }; OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line); OutputLogger cygpath_err(this->Log, "cygpath-err> "); - if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, CM_NULLPTR, + if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, nullptr, cmProcessOutput::UTF8)) { git_dir = git_dir_line; } @@ -134,12 +134,11 @@ 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", - CM_NULLPTR }; + char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", nullptr }; std::string cdup; OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup); OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); - if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR, + if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr, cmProcessOutput::UTF8) && !cdup.empty()) { top_dir += "/"; @@ -170,7 +169,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() } // Sentinel argument. - git_fetch.push_back(CM_NULLPTR); + git_fetch.push_back(nullptr); // Fetch upstream refs. OutputLogger fetch_out(this->Log, "fetch-out> "); @@ -205,8 +204,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() } // Reset the local branch to point at that tracked from upstream. - char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), - CM_NULLPTR }; + char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), 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); @@ -221,7 +219,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(CM_NULLPTR); + git_custom.push_back(nullptr); OutputLogger custom_out(this->Log, "custom-out> "); OutputLogger custom_err(this->Log, "custom-err> "); @@ -250,7 +248,7 @@ bool cmCTestGIT::UpdateImpl() // Git < 1.6.5 did not support submodule --recursive if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) { - recursive = CM_NULLPTR; + recursive = 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"; @@ -259,7 +257,7 @@ bool cmCTestGIT::UpdateImpl() // Git < 1.8.1 did not support sync --recursive if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) { - sync_recursive = CM_NULLPTR; + sync_recursive = 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"; @@ -274,8 +272,7 @@ 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", - CM_NULLPTR }; + char const* git_submodule_init[] = { git, "submodule", "init", nullptr }; ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err, top_dir.c_str()); @@ -285,7 +282,7 @@ bool cmCTestGIT::UpdateImpl() } char const* git_submodule_sync[] = { git, "submodule", "sync", - sync_recursive, CM_NULLPTR }; + sync_recursive, nullptr }; ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err, top_dir.c_str()); @@ -294,7 +291,7 @@ bool cmCTestGIT::UpdateImpl() } char const* git_submodule[] = { git, "submodule", "update", recursive, - CM_NULLPTR }; + nullptr }; return this->RunChild(git_submodule, &submodule_out, &submodule_err, top_dir.c_str()); } @@ -303,7 +300,7 @@ unsigned int cmCTestGIT::GetGitVersion() { if (!this->CurrentGitVersion) { const char* git = this->CommandLineTool.c_str(); - char const* git_version[] = { git, "--version", CM_NULLPTR }; + char const* git_version[] = { git, "--version", nullptr }; std::string version; OneLineParser version_out(this, "version-out> ", version); OutputLogger version_err(this->Log, "version-err> "); @@ -615,10 +612,10 @@ bool 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(), "--", CM_NULLPTR }; + range.c_str(), "--", nullptr }; const char* git_diff_tree[] = { git, "diff-tree", "--stdin", "--always", "-z", - "-r", "--pretty=raw", "--encoding=utf-8", CM_NULLPTR + "-r", "--pretty=raw", "--encoding=utf-8", nullptr }; this->Log << this->ComputeCommandLine(git_rev_list) << " | " << this->ComputeCommandLine(git_diff_tree) << "\n"; @@ -645,19 +642,18 @@ bool cmCTestGIT::LoadModifications() // Use 'git update-index' to refresh the index w.r.t. the work tree. const char* git_update_index[] = { git, "update-index", "--refresh", - CM_NULLPTR }; + nullptr }; OutputLogger ui_out(this->Log, "ui-out> "); OutputLogger ui_err(this->Log, "ui-err> "); - this->RunChild(git_update_index, &ui_out, &ui_err, CM_NULLPTR, + this->RunChild(git_update_index, &ui_out, &ui_err, nullptr, cmProcessOutput::UTF8); // Use 'git diff-index' to get modified files. const char* git_diff_index[] = { git, "diff-index", "-z", - "HEAD", "--", CM_NULLPTR }; + "HEAD", "--", nullptr }; DiffParser out(this, "di-out> "); OutputLogger err(this->Log, "di-err> "); - this->RunChild(git_diff_index, &out, &err, CM_NULLPTR, - cmProcessOutput::UTF8); + this->RunChild(git_diff_index, &out, &err, nullptr, cmProcessOutput::UTF8); for (std::vector<Change>::const_iterator ci = out.Changes.begin(); ci != out.Changes.end(); ++ci) { diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 19034c0..5729012 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -12,7 +12,7 @@ cmCTestGenericHandler::cmCTestGenericHandler() { this->HandlerVerbose = cmSystemTools::OUTPUT_NONE; - this->CTest = CM_NULLPTR; + this->CTest = nullptr; this->SubmitIndex = 0; this->AppendXML = false; this->Quiet = false; @@ -70,7 +70,7 @@ const char* cmCTestGenericHandler::GetOption(const std::string& op) cmCTestGenericHandler::t_StringToString::iterator remit = this->Options.find(op); if (remit == this->Options.end()) { - return CM_NULLPTR; + return nullptr; } return remit->second.c_str(); } diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 49f9a65..7bf5b67 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -96,7 +96,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", CM_NULLPTR }; + const char* hg_identify[] = { hg, "identify", "-i", nullptr }; std::string rev; IdentifyParser out(this, "rev-out> ", rev); OutputLogger err(this->Log, "rev-err> "); @@ -126,7 +126,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", CM_NULLPTR }; + const char* hg_pull[] = { hg, "pull", "-v", nullptr }; OutputLogger out(this->Log, "pull-out> "); OutputLogger err(this->Log, "pull-err> "); this->RunChild(&hg_pull[0], &out, &err); @@ -151,7 +151,7 @@ bool cmCTestHG::UpdateImpl() } // Sentinel argument. - hg_update.push_back(CM_NULLPTR); + hg_update.push_back(nullptr); OutputLogger out(this->Log, "update-out> "); OutputLogger err(this->Log, "update-err> "); @@ -286,7 +286,7 @@ bool cmCTestHG::LoadRevisions() "</logentry>\n"; const char* hg_log[] = { hg, "log", "--removed", "-r", range.c_str(), - "--template", hgXMLTemplate, CM_NULLPTR + "--template", hgXMLTemplate, nullptr }; LogParser out(this, "log-out> "); @@ -302,7 +302,7 @@ bool cmCTestHG::LoadModifications() { // Use 'hg status' to get modified files. const char* hg = this->CommandLineTool.c_str(); - const char* hg_status[] = { hg, "status", CM_NULLPTR }; + const char* hg_status[] = { hg, "status", nullptr }; StatusParser out(this, "status-out> "); OutputLogger err(this->Log, "status-err> "); this->RunChild(hg_status, &out, &err); diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index c99e450..9266d1f 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -20,7 +20,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand() size_t cc; this->Arguments.reserve(INIT_SIZE); for (cc = 0; cc < INIT_SIZE; ++cc) { - this->Arguments.push_back(CM_NULLPTR); + this->Arguments.push_back(nullptr); } this->Arguments[ct_RETURN_VALUE] = "RETURN_VALUE"; this->Arguments[ct_CAPTURE_CMAKE_ERROR] = "CAPTURE_CMAKE_ERROR"; @@ -89,7 +89,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args, SaveRestoreErrorState errorState; // Allocate space for argument values. this->Values.clear(); - this->Values.resize(this->Last, CM_NULLPTR); + this->Values.resize(this->Last, nullptr); // Process input arguments. this->ArgumentDoing = ArgumentDoingNone; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 9be8696..8d32f2e 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -31,7 +31,7 @@ cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) { this->Passthru = true; - this->Process = CM_NULLPTR; + this->Process = nullptr; this->ExitCode = 1; this->CWD = cmSystemTools::GetCurrentWorkingDirectory(); @@ -129,7 +129,7 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv) return true; } this->RealArgC = 0; - this->RealArgV = CM_NULLPTR; + this->RealArgV = nullptr; std::cerr << "No launch/command separator ('--') found!\n"; return false; } @@ -224,11 +224,11 @@ void cmCTestLaunch::RunChild() // Record child stdout and stderr if necessary. if (!this->Passthru) { - char* data = CM_NULLPTR; + char* data = nullptr; int length = 0; cmProcessOutput processOutput; std::string strdata; - while (int p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { + while (int p = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { if (p == cmsysProcess_Pipe_STDOUT) { processOutput.DecodeText(data, length, strdata, 1); fout.write(strdata.c_str(), strdata.size()); @@ -254,7 +254,7 @@ void cmCTestLaunch::RunChild() } // Wait for the real command to finish. - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); this->ExitCode = cmsysProcess_GetExitValue(cp); } @@ -396,7 +396,7 @@ void cmCTestLaunch::WriteXMLAction(cmXMLWriter& xml) } // OutputType - const char* outputType = CM_NULLPTR; + const char* outputType = nullptr; if (!this->OptionTargetType.empty()) { if (this->OptionTargetType == "EXECUTABLE") { outputType = "executable"; diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index b9cae3b..a5d5995 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -14,7 +14,7 @@ cmCTestMemCheckCommand::cmCTestMemCheckCommand() { this->Arguments[ctm_DEFECT_COUNT] = "DEFECT_COUNT"; - this->Arguments[ctm_LAST] = CM_NULLPTR; + this->Arguments[ctm_LAST] = nullptr; this->Last = ctm_LAST; } diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 6026a2a..848e505 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -28,7 +28,7 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = { { "Allocation Conflict", cmCTestMemCheckHandler::FMM }, { "Bad Pointer Use", cmCTestMemCheckHandler::FMW }, { "Dangling Pointer", cmCTestMemCheckHandler::FMR }, - { CM_NULLPTR, 0 } + { nullptr, 0 } }; static void xmlReportError(int line, const char* msg, void* data) @@ -58,7 +58,7 @@ public: std::ostringstream ostr; ostr << name << ":\n"; int i = 0; - for (; atts[i] != CM_NULLPTR; i += 2) { + for (; atts[i] != nullptr; i += 2) { ostr << " " << atts[i] << " - " << atts[i + 1] << "\n"; } ostr << "\n"; @@ -69,12 +69,12 @@ public: const char* GetAttribute(const char* name, const char** atts) { int i = 0; - for (; atts[i] != CM_NULLPTR; ++i) { + for (; atts[i] != nullptr; ++i) { if (strcmp(name, atts[i]) == 0) { return atts[i + 1]; } } - return CM_NULLPTR; + return nullptr; } void ParseError(const char** atts) { @@ -228,9 +228,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", CM_NULLPTR + "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM", + "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK", + "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", nullptr }; static const char* cmCTestMemCheckResultLongStrings[] = { "Threading Problem", @@ -255,10 +255,10 @@ void cmCTestMemCheckHandler::InitializeResultsVectors() "PLK", "Uninitialized Memory Conditional", "Uninitialized Memory Read", - CM_NULLPTR + nullptr }; this->GlobalResults.clear(); - for (int i = 0; cmCTestMemCheckResultStrings[i] != CM_NULLPTR; ++i) { + for (int i = 0; cmCTestMemCheckResultStrings[i] != nullptr; ++i) { this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]); this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]); this->GlobalResults.push_back(0); diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index c802216..ab057ad 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -155,7 +155,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(CM_NULLPTR); + p4_users.push_back(nullptr); UserParser out(this, "users-out> "); OutputLogger err(this->Log, "users-err> "); @@ -350,7 +350,7 @@ std::string cmCTestP4::GetWorkingRevision() std::string source = this->SourceDirectory + "/...#have"; p4_identify.push_back(source.c_str()); - p4_identify.push_back(CM_NULLPTR); + p4_identify.push_back(nullptr); std::string rev; IdentifyParser out(this, "p4_changes-out> ", rev); @@ -411,7 +411,7 @@ bool cmCTestP4::LoadRevisions() p4_changes.push_back("changes"); p4_changes.push_back(range.c_str()); - p4_changes.push_back(CM_NULLPTR); + p4_changes.push_back(nullptr); ChangesParser out(this, "p4_changes-out> "); OutputLogger err(this->Log, "p4_changes-err> "); @@ -431,7 +431,7 @@ bool cmCTestP4::LoadRevisions() p4_describe.push_back("describe"); p4_describe.push_back("-s"); p4_describe.push_back(i->c_str()); - p4_describe.push_back(CM_NULLPTR); + p4_describe.push_back(nullptr); DescribeParser outDescribe(this, "p4_describe-out> "); OutputLogger errDescribe(this->Log, "p4_describe-err> "); @@ -451,7 +451,7 @@ bool cmCTestP4::LoadModifications() p4_diff.push_back("-dn"); std::string source = this->SourceDirectory + "/..."; p4_diff.push_back(source.c_str()); - p4_diff.push_back(CM_NULLPTR); + p4_diff.push_back(nullptr); DiffParser out(this, "p4_diff-out> "); OutputLogger err(this->Log, "p4_diff-err> "); @@ -469,7 +469,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(CM_NULLPTR); + p4_custom.push_back(nullptr); OutputLogger custom_out(this->Log, "p4_customsync-out> "); OutputLogger custom_err(this->Log, "p4_customsync-err> "); @@ -520,7 +520,7 @@ bool cmCTestP4::UpdateImpl() } p4_sync.push_back(source.c_str()); - p4_sync.push_back(CM_NULLPTR); + p4_sync.push_back(nullptr); OutputLogger out(this->Log, "p4_sync-out> "); OutputLogger err(this->Log, "p4_sync-err> "); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 9274c01..2c1198f 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -25,12 +25,12 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler) { this->CTest = handler->CTest; this->TestHandler = handler; - this->TestProcess = CM_NULLPTR; + this->TestProcess = nullptr; this->TestResult.ExecutionTime = 0; this->TestResult.ReturnValue = 0; this->TestResult.Status = cmCTestTestHandler::NOT_RUN; this->TestResult.TestCount = 0; - this->TestResult.Properties = CM_NULLPTR; + this->TestResult.Properties = nullptr; this->ProcessOutput = ""; this->CompressedOutput = ""; this->CompressionRatio = 2; @@ -621,7 +621,7 @@ double cmCTestRunTest::ResolveTimeout() return timeout; } struct tm* lctime; - time_t current_time = time(CM_NULLPTR); + time_t current_time = time(nullptr); lctime = gmtime(¤t_time); int gm_hour = lctime->tm_hour; time_t gm_time = mktime(lctime); diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index f60f78c..36582a2 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -290,7 +290,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters, args.push_back(i->c_str()); } - args.push_back(CM_NULLPTR); + args.push_back(nullptr); if (strcmp(parameters[0], "update") == 0) { return RunUpdateCommand(&args[0], out, err); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index c566c5c..6fd24a5 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -75,9 +75,9 @@ cmCTestScriptHandler::cmCTestScriptHandler() this->Backup = false; this->EmptyBinDir = false; this->EmptyBinDirOnce = false; - this->Makefile = CM_NULLPTR; - this->CMake = CM_NULLPTR; - this->GlobalGenerator = CM_NULLPTR; + this->Makefile = nullptr; + this->CMake = nullptr; + this->GlobalGenerator = nullptr; this->ScriptStartTime = 0; @@ -114,10 +114,10 @@ void cmCTestScriptHandler::Initialize() this->ScriptStartTime = 0; delete this->Makefile; - this->Makefile = CM_NULLPTR; + this->Makefile = nullptr; delete this->GlobalGenerator; - this->GlobalGenerator = CM_NULLPTR; + this->GlobalGenerator = nullptr; delete this->CMake; } @@ -193,7 +193,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(CM_NULLPTR); + argv.push_back(nullptr); // Now create process object cmsysProcess* cp = cmsysProcess_New(); @@ -219,7 +219,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) } // Properly handle output of the build command - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); int result = cmsysProcess_GetState(cp); int retVal = 0; bool failed = false; @@ -852,7 +852,7 @@ bool cmCTestScriptHandler::WriteInitialCache(const char* directory, return false; } - if (text != CM_NULLPTR) { + if (text != nullptr) { fout.write(text, strlen(text)); } diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 01a874b..4f0d87b 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -29,12 +29,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 = CM_NULLPTR; - const char* bld_dir = CM_NULLPTR; + const char* src_dir = nullptr; + const char* bld_dir = nullptr; cnt++; - this->CTest->SetSpecificTrack(CM_NULLPTR); + this->CTest->SetSpecificTrack(nullptr); if (cnt < args.size() - 1) { if (args[cnt] == "TRACK") { cnt++; diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 409eb51..1794ca6 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() extraFiles.end()); if (!this->CTest->SubmitExtraFiles(newExtraFiles)) { this->SetError("problem submitting extra files."); - return CM_NULLPTR; + return nullptr; } } @@ -94,7 +94,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() this->CTest->GetInitializedHandler("submit"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate submit handler"); - return CM_NULLPTR; + return nullptr; } // If no FILES or PARTS given, *all* PARTS are submitted by default. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 689668d..5c67816 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -145,7 +145,7 @@ void cmCTestSubmitHandler::Initialize() this->HTTPProxyAuth = ""; this->FTPProxy = ""; this->FTPProxyType = 0; - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; this->Files.clear(); } @@ -304,7 +304,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, char error_buffer[1024]; // Set Content-Type to satisfy fussy modsecurity rules. struct curl_slist* headers = - ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml"); + ::curl_slist_append(nullptr, "Content-Type: text/xml"); // Add any additional headers that the user specified. for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin(); @@ -495,10 +495,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") == CM_NULLPTR + std::string retryDelay = this->GetOption("RetryDelay") == nullptr ? "" : this->GetOption("RetryDelay"); - std::string retryCount = this->GetOption("RetryCount") == CM_NULLPTR + std::string retryCount = this->GetOption("RetryCount") == nullptr ? "" : this->GetOption("RetryCount"); @@ -764,7 +764,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(CM_NULLPTR); + argv.push_back(nullptr); cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); @@ -797,7 +797,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, cmProcessOutput processOutput; std::string strdata; - while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { + while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { processOutput.DecodeText(data, length, strdata); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(strdata.c_str(), strdata.size()), @@ -810,7 +810,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, this->Quiet); } - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); int result = cmsysProcess_GetState(cp); @@ -1036,10 +1036,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, bool internalTest = cmSystemTools::IsOn(this->GetOption("InternalTest")); // Get RETRY_COUNT and RETRY_DELAY values if they were set. - std::string retryDelayString = this->GetOption("RetryDelay") == CM_NULLPTR + std::string retryDelayString = this->GetOption("RetryDelay") == nullptr ? "" : this->GetOption("RetryDelay"); - std::string retryCountString = this->GetOption("RetryCount") == CM_NULLPTR + std::string retryCountString = this->GetOption("RetryCount") == nullptr ? "" : this->GetOption("RetryCount"); unsigned long retryDelay = 0; diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index 2923f4f..318920e 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -25,7 +25,7 @@ public: typedef cmCTestGenericHandler Superclass; cmCTestSubmitHandler(); - ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = CM_NULLPTR; } + ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = nullptr; } /* * The main entry point for this class diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 3346d86..febd39e 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -27,7 +27,7 @@ cmCTestTestCommand::cmCTestTestCommand() this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM"; this->Arguments[ctt_STOP_TIME] = "STOP_TIME"; this->Arguments[ctt_TEST_LOAD] = "TEST_LOAD"; - this->Arguments[ctt_LAST] = CM_NULLPTR; + this->Arguments[ctt_LAST] = nullptr; this->Last = ctt_LAST; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ef0fac8..91c2fdc 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -334,7 +334,7 @@ cmCTestTestHandler::cmCTestTestHandler() this->MemCheck = false; - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; // regex to detect <DartMeasurement>...</DartMeasurement> this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)"); @@ -600,7 +600,7 @@ int cmCTestTestHandler::ProcessHandler() cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; return 1; } cmXMLWriter xml(xmlfile); @@ -608,15 +608,15 @@ int cmCTestTestHandler::ProcessHandler() } if (!this->PostProcessHandler()) { - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; return -1; } if (!failed.empty()) { - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; return -1; } - this->LogFile = CM_NULLPTR; + this->LogFile = nullptr; return 0; } @@ -1327,7 +1327,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed, bool randomSchedule = this->CTest->GetScheduleType() == "Random"; if (randomSchedule) { - srand((unsigned)time(CM_NULLPTR)); + srand((unsigned)time(nullptr)); } for (ListOfTests::iterator it = this->TestList.begin(); @@ -1556,8 +1556,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(), CM_NULLPTR, CM_NULLPTR, - &retVal, CM_NULLPTR, + if (!cmSystemTools::RunSingleCommand(it->c_str(), nullptr, nullptr, + &retVal, nullptr, cmSystemTools::OUTPUT_MERGE /*this->Verbose*/) || retVal != 0) { diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index 8c03754..3d800f8 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -78,12 +78,12 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() this->CTest->GetInitializedHandler("update"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate update handler"); - return CM_NULLPTR; + return nullptr; } handler->SetCommand(this); if (source_dir.empty()) { this->SetError("source directory not specified. Please use SOURCE tag"); - return CM_NULLPTR; + return nullptr; } handler->SetOption("SourceDirectory", source_dir.c_str()); handler->SetQuiet(this->Quiet); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index e08a9b7..0504f90 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -309,7 +309,7 @@ bool cmCTestUpdateHandler::SelectVCS() // If no update command was specified, lookup one for this VCS tool. if (this->UpdateCommand.empty()) { - const char* key = CM_NULLPTR; + const char* key = nullptr; switch (this->UpdateType) { case e_CVS: key = "CVSCommand"; diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index 717117a..d85f35f 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -18,7 +18,7 @@ cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler() this->CTest->GetInitializedHandler("upload"); if (!handler) { this->SetError("internal CTest error. Cannot instantiate upload handler"); - return CM_NULLPTR; + return nullptr; } static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index fb2742e..186d2d4 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -60,7 +60,7 @@ bool cmCTestVC::InitialCheckout(const char* command) ai != args.end(); ++ai) { vc_co.push_back(ai->c_str()); } - vc_co.push_back(CM_NULLPTR); + vc_co.push_back(nullptr); // Run the initial checkout command and log its output. this->Log << "--- Begin Initial Checkout ---\n"; @@ -113,7 +113,7 @@ bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out, } // Run the command. - return this->RunChild(cmd, out, err, CM_NULLPTR, encoding); + return this->RunChild(cmd, out, err, nullptr, encoding); } std::string cmCTestVC::GetNightlyTime() diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h index 6400bcd..e04cb48 100644 --- a/Source/CTest/cmCTestVC.h +++ b/Source/CTest/cmCTestVC.h @@ -100,8 +100,8 @@ protected: Revision const* PriorRev; File() : Status(PathUpdated) - , Rev(CM_NULLPTR) - , PriorRev(CM_NULLPTR) + , Rev(nullptr) + , PriorRev(nullptr) { } File(PathStatus status, Revision const* rev, Revision const* priorRev) @@ -117,12 +117,12 @@ protected: /** Run a command line and send output to given parsers. */ bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err, - const char* workDir = CM_NULLPTR, + const char* workDir = nullptr, Encoding encoding = cmProcessOutput::Auto); /** Run VC update command line and send output to given parsers. */ bool RunUpdateCommand(char const* const* cmd, OutputParser* out, - OutputParser* err = CM_NULLPTR, + OutputParser* err = nullptr, Encoding encoding = cmProcessOutput::Auto); /** Write xml element for one file. */ diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index eb29f55..8802f15 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -135,8 +135,8 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, return true; } // try some alternate names - const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR }; - for (int k = 0; tryname[k] != CM_NULLPTR; k++) { + const char* tryname[] = { "GUX", "GTM", "ONT", nullptr }; + for (int k = 0; tryname[k] != nullptr; k++) { std::string routine2 = routine + tryname[k]; i = this->RoutineToDirectory.find(routine2); if (i != this->RoutineToDirectory.end()) { diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 9680a69..a7f0f4b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -9,7 +9,7 @@ cmProcess::cmProcess() { - this->Process = CM_NULLPTR; + this->Process = nullptr; this->Timeout = 0; this->TotalTime = 0; this->ExitValue = 0; @@ -45,7 +45,7 @@ bool cmProcess::StartProcess() i != this->Arguments.end(); ++i) { this->ProcessArgs.push_back(i->c_str()); } - this->ProcessArgs.push_back(CM_NULLPTR); // null terminate the list + this->ProcessArgs.push_back(nullptr); // null terminate the list this->Process = cmsysProcess_New(); cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin()); if (!this->WorkingDirectory.empty()) { diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index e75a7ef..7f2b8a0 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -51,6 +51,5 @@ cm_check_cxx_feature(make_unique) if(CMake_HAVE_CXX_MAKE_UNIQUE) set(CMake_HAVE_CXX_UNIQUE_PTR 1) endif() -cm_check_cxx_feature(nullptr) cm_check_cxx_feature(override) cm_check_cxx_feature(unique_ptr) diff --git a/Source/Checks/cm_cxx_nullptr.cxx b/Source/Checks/cm_cxx_nullptr.cxx deleted file mode 100644 index 500684a..0000000 --- a/Source/Checks/cm_cxx_nullptr.cxx +++ /dev/null @@ -1,14 +0,0 @@ -int test(int) -{ - return -1; -} - -int test(int*) -{ - return 0; -} - -int main() -{ - return test(nullptr); -} diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 28a0e95..768c460 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -18,30 +18,29 @@ #include <vector> static const char* cmDocumentationName[][2] = { - { CM_NULLPTR, " ccmake - Curses Interface for CMake." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " ccmake - Curses Interface for CMake." }, + { nullptr, nullptr } }; static const char* cmDocumentationUsage[][2] = { - { 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 } + { nullptr, " ccmake <path-to-source>\n" + " ccmake <path-to-existing-build>" }, + { 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." }, + { nullptr, nullptr } }; static const char* cmDocumentationUsageNote[][2] = { - { CM_NULLPTR, "Run 'ccmake --help' for more information." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, "Run 'ccmake --help' for more information." }, + { nullptr, nullptr } }; static const char* cmDocumentationOptions[] [2] = { CMAKE_STANDARD_OPTIONS_TABLE, - { CM_NULLPTR, CM_NULLPTR } }; + { nullptr, nullptr } }; -cmCursesForm* cmCursesForm::CurrentForm = CM_NULLPTR; +cmCursesForm* cmCursesForm::CurrentForm = nullptr; extern "C" { @@ -169,7 +168,7 @@ int main(int argc, char const* const* argv) touchwin(stdscr); endwin(); delete cmCursesForm::CurrentForm; - cmCursesForm::CurrentForm = CM_NULLPTR; + cmCursesForm::CurrentForm = nullptr; std::cout << std::endl << std::endl; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index d071c91..8596281 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -25,7 +25,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( { this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); - this->Entry = CM_NULLPTR; + this->Entry = nullptr; this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); } @@ -43,7 +43,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); } - this->Entry = CM_NULLPTR; + this->Entry = nullptr; const char* value = cm->GetState()->GetCacheEntryValue(key); assert(value); switch (cm->GetState()->GetCacheEntryType(key)) { @@ -104,5 +104,5 @@ const char* cmCursesCacheEntryComposite::GetValue() if (this->Label) { return this->Label->GetValue(); } - return CM_NULLPTR; + return nullptr; } diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx index 06c1e9c..bd65c4a 100644 --- a/Source/CursesDialog/cmCursesForm.cxx +++ b/Source/CursesDialog/cmCursesForm.cxx @@ -7,7 +7,7 @@ bool cmCursesForm::Debug = false; cmCursesForm::cmCursesForm() { - this->Form = CM_NULLPTR; + this->Form = nullptr; } cmCursesForm::~cmCursesForm() @@ -15,7 +15,7 @@ cmCursesForm::~cmCursesForm() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = CM_NULLPTR; + this->Form = nullptr; } } diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 7fb065d..9bd1c11 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -26,8 +26,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm( this->Messages += "\n\n"; } this->Title = title; - this->Fields[0] = CM_NULLPTR; - this->Fields[1] = CM_NULLPTR; + this->Fields[0] = nullptr; + this->Fields[1] = nullptr; } cmCursesLongMessageForm::~cmCursesLongMessageForm() @@ -105,7 +105,7 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = CM_NULLPTR; + this->Form = nullptr; } const char* msg = this->Messages.c_str(); @@ -114,7 +114,7 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, if (this->Fields[0]) { free_field(this->Fields[0]); - this->Fields[0] = CM_NULLPTR; + this->Fields[0] = nullptr; } this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 026320a..6bcc5bd 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -31,8 +31,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args, , InitialWidth(initWidth) { this->NumberOfPages = 0; - this->Fields = CM_NULLPTR; - this->Entries = CM_NULLPTR; + this->Fields = nullptr; + this->Entries = nullptr; this->AdvancedMode = false; this->NumberOfVisibleEntries = 0; this->OkToGenerate = false; @@ -59,7 +59,7 @@ cmCursesMainForm::~cmCursesMainForm() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = CM_NULLPTR; + this->Form = nullptr; } delete[] this->Fields; @@ -70,7 +70,7 @@ cmCursesMainForm::~cmCursesMainForm() delete this->Entries; if (this->CMakeInstance) { delete this->CMakeInstance; - this->CMakeInstance = CM_NULLPTR; + this->CMakeInstance = nullptr; } } @@ -180,7 +180,7 @@ void cmCursesMainForm::RePost() if (this->Form) { unpost_form(this->Form); free_form(this->Form); - this->Form = CM_NULLPTR; + this->Form = nullptr; } delete[] this->Fields; if (this->AdvancedMode) { @@ -210,7 +210,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] = CM_NULLPTR; + this->Fields[cc] = nullptr; } // Assign fields @@ -239,7 +239,7 @@ void cmCursesMainForm::RePost() this->NumberOfVisibleEntries = 1; } // Has to be null terminated. - this->Fields[3 * this->NumberOfVisibleEntries] = CM_NULLPTR; + this->Fields[3 * this->NumberOfVisibleEntries] = nullptr; } void cmCursesMainForm::Render(int left, int top, int width, int height) @@ -259,7 +259,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 = CM_NULLPTR; + this->Form = nullptr; } // Wrong window size @@ -341,14 +341,14 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) } // Give the current widget (if it exists), a chance to print keys - cmCursesWidget* cw = CM_NULLPTR; + cmCursesWidget* cw = nullptr; if (this->Form) { FIELD* currentField = current_field(this->Form); cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField)); } char fmt_s[] = "%s"; - if (cw == CM_NULLPTR || !cw->PrintKeys()) { + if (cw == nullptr || !cw->PrintKeys()) { char firstLine[512] = ""; char secondLine[512] = ""; char thirdLine[512] = ""; @@ -425,7 +425,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 = CM_NULLPTR; + cmCursesWidget* lbl = nullptr; if (findex >= 0) { lbl = reinterpret_cast<cmCursesWidget*>( field_userptr(this->Fields[findex - 2])); @@ -557,7 +557,7 @@ int cmCursesMainForm::Configure(int noconfigure) this->FillCacheManagerFromUI(); this->CMakeInstance->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); - this->LoadCache(CM_NULLPTR); + this->LoadCache(nullptr); // Get rid of previous errors this->Errors = std::vector<std::string>(); @@ -574,7 +574,7 @@ int cmCursesMainForm::Configure(int noconfigure) } else { retVal = this->CMakeInstance->Configure(); } - this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR); + this->CMakeInstance->SetProgressCallback(nullptr, nullptr); keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ @@ -628,7 +628,7 @@ int cmCursesMainForm::Generate() // run the generate process int retVal = this->CMakeInstance->Generate(); - this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR); + this->CMakeInstance->SetProgressCallback(nullptr, nullptr); keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ if (retVal != 0 || !this->Errors.empty()) { @@ -877,7 +877,7 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>( field_userptr(this->Fields[findex - 2])); const char* curField = lbl->GetValue(); - const char* helpString = CM_NULLPTR; + const char* helpString = nullptr; const char* existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(curField); @@ -962,7 +962,7 @@ void cmCursesMainForm::HandleInput() // (findex always corresponds to the value field) FIELD* nextCur; if (findex == 2) { - nextCur = CM_NULLPTR; + nextCur = nullptr; } else if (findex == 3 * this->NumberOfVisibleEntries - 1) { nextCur = this->Fields[findex - 5]; } else { @@ -992,7 +992,7 @@ void cmCursesMainForm::HandleInput() if (nextCur) { // make the next or prev. current field after deletion - nextCur = CM_NULLPTR; + nextCur = nullptr; std::vector<cmCursesCacheEntryComposite*>::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { @@ -1041,7 +1041,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) int findex = start_index; for (;;) { if (!str.empty()) { - cmCursesWidget* lbl = CM_NULLPTR; + cmCursesWidget* lbl = nullptr; if (findex >= 0) { lbl = reinterpret_cast<cmCursesWidget*>( field_userptr(this->Fields[findex - 2])); diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index e35cf3e..404a971 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -64,7 +64,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(CM_NULLPTR); } + void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(nullptr); } virtual void UpdateStatusBar(const char* message); /** diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index ff189f0..8cb9c1f 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -74,7 +74,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, return false; } - this->OriginalString = CM_NULLPTR; + this->OriginalString = nullptr; this->Done = false; char debugMessage[128]; diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx index 054f27e..cc07411 100644 --- a/Source/CursesDialog/cmCursesWidget.cxx +++ b/Source/CursesDialog/cmCursesWidget.cxx @@ -14,7 +14,7 @@ cmCursesWidget::~cmCursesWidget() { if (this->Field) { free_field(this->Field); - this->Field = CM_NULLPTR; + this->Field = nullptr; } } diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 7fa2ac6..9f881e2 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -22,19 +22,18 @@ #include "cmSystemTools.h" // IWYU pragma: keep -static const char* cmDocumentationName[][2] = { { CM_NULLPTR, +static const char* cmDocumentationName[][2] = { { nullptr, " cmake-gui - CMake GUI." }, - { CM_NULLPTR, CM_NULLPTR } }; + { nullptr, nullptr } }; static const char* cmDocumentationUsage[][2] = { - { CM_NULLPTR, " cmake-gui [options]\n" - " cmake-gui [options] <path-to-source>\n" - " cmake-gui [options] <path-to-existing-build>" }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " cmake-gui [options]\n" + " cmake-gui [options] <path-to-source>\n" + " cmake-gui [options] <path-to-existing-build>" }, + { nullptr, nullptr } }; -static const char* cmDocumentationOptions[] - [2] = { { CM_NULLPTR, CM_NULLPTR } }; +static const char* cmDocumentationOptions[][2] = { { nullptr, nullptr } }; #if defined(Q_OS_MAC) static int cmOSXInstall(std::string dir); diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 5290afe..bbb2395 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -32,7 +32,7 @@ QCMakeThread::QCMakeThread(QObject* p) : QThread(p) - , CMakeInstance(CM_NULLPTR) + , CMakeInstance(nullptr) { } @@ -48,7 +48,7 @@ void QCMakeThread::run() emit this->cmakeInitialized(); this->exec(); delete this->CMakeInstance; - this->CMakeInstance = CM_NULLPTR; + this->CMakeInstance = nullptr; } CMakeSetupDialog::CMakeSetupDialog() diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h index 6c8c8f5..7605e26 100644 --- a/Source/QtDialog/Compilers.h +++ b/Source/QtDialog/Compilers.h @@ -13,7 +13,7 @@ class Compilers : public QWidget, public Ui::Compilers { Q_OBJECT public: - Compilers(QWidget* p = CM_NULLPTR) + Compilers(QWidget* p = nullptr) : QWidget(p) { this->setupUi(this); diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index e14cdf2..9980390 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -63,7 +63,7 @@ class QCMake : public QObject { Q_OBJECT public: - QCMake(QObject* p = CM_NULLPTR); + QCMake(QObject* p = nullptr); ~QCMake(); public slots: /// load the cache file in a directory diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 08c2d58..c6b007d 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -539,7 +539,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor( QModelIndex var = idx.sibling(idx.row(), 0); int type = var.data(QCMakeCacheModel::TypeRole).toInt(); if (type == QCMakeProperty::BOOL) { - return CM_NULLPTR; + return nullptr; } if (type == QCMakeProperty::PATH) { QCMakePathEditor* editor = @@ -642,7 +642,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, QStyleOptionButton opt; opt.QStyleOption::operator=(option); sz = sz.expandedTo( - style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, CM_NULLPTR) + style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, nullptr) .size()); return sz; diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index 7f0cafa..b544b86 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -57,7 +57,7 @@ void QCMakeFilePathEditor::chooseFile() emit this->fileDialogExists(true); path = QFileDialog::getOpenFileName(this, title, info.absolutePath(), QString(), - CM_NULLPTR, QFileDialog::DontResolveSymlinks); + nullptr, QFileDialog::DontResolveSymlinks); emit this->fileDialogExists(false); if (!path.isEmpty()) { @@ -89,7 +89,7 @@ void QCMakePathEditor::chooseFile() // use same QDirModel for all completers static QDirModel* fileDirModel() { - static QDirModel* m = CM_NULLPTR; + static QDirModel* m = nullptr; if (!m) { m = new QDirModel(); } @@ -97,7 +97,7 @@ static QDirModel* fileDirModel() } static QDirModel* pathDirModel() { - static QDirModel* m = CM_NULLPTR; + static QDirModel* m = nullptr; if (!m) { m = new QDirModel(); m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot); diff --git a/Source/QtDialog/QCMakeWidgets.h b/Source/QtDialog/QCMakeWidgets.h index 1ec666f..87475b2 100644 --- a/Source/QtDialog/QCMakeWidgets.h +++ b/Source/QtDialog/QCMakeWidgets.h @@ -35,7 +35,7 @@ class QCMakePathEditor : public QCMakeFileEditor { Q_OBJECT public: - QCMakePathEditor(QWidget* p = CM_NULLPTR, const QString& var = QString()); + QCMakePathEditor(QWidget* p = nullptr, const QString& var = QString()); void chooseFile(); }; @@ -44,8 +44,7 @@ class QCMakeFilePathEditor : public QCMakeFileEditor { Q_OBJECT public: - QCMakeFilePathEditor(QWidget* p = CM_NULLPTR, - const QString& var = QString()); + QCMakeFilePathEditor(QWidget* p = nullptr, const QString& var = QString()); void chooseFile(); }; diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index b5e7c9e..bd054e8 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -31,7 +31,7 @@ bool cmAddCustomCommandCommand::InitialPass( std::string source, target, main_dependency, working, depfile; std::string comment_buffer; - const char* comment = CM_NULLPTR; + const char* comment = nullptr; std::vector<std::string> depends, outputs, output, byproducts; bool verbatim = false; bool append = false; diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 87e1147..a8d5b2e 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -49,7 +49,7 @@ bool cmAddCustomTargetCommand::InitialPass( bool uses_terminal = false; bool command_expand_lists = false; std::string comment_buffer; - const char* comment = CM_NULLPTR; + const char* comment = nullptr; std::vector<std::string> sources; // Keep track of parser state. diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 0f13b11..02408a1 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -146,9 +146,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, } if (archive_write_open( - this->Archive, this, CM_NULLPTR, + this->Archive, this, nullptr, reinterpret_cast<archive_write_callback*>(&Callback::Write), - CM_NULLPTR) != ARCHIVE_OK) { + nullptr) != ARCHIVE_OK) { this->Error = "archive_write_open: "; this->Error += cm_archive_error_string(this->Archive); return; @@ -224,7 +224,7 @@ 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, CM_NULLPTR) != + if (archive_read_disk_entry_from_file(this->Disk, e, -1, nullptr) != ARCHIVE_OK) { this->Error = "archive_read_disk_entry_from_file '"; this->Error += file; diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 4c85c0d..56dce2a 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -67,13 +67,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 = CM_NULLPTR, + bool Add(std::string path, size_t skip = 0, const char* prefix = nullptr, bool recursive = true); /** Returns true if there has been no error. */ operator safe_bool() const { - return this->Okay() ? &cmArchiveWrite::safe_bool_true : CM_NULLPTR; + return this->Okay() ? &cmArchiveWrite::safe_bool_true : nullptr; } /** Returns true if there has been an error. */ diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index e78f5fe..e0b1711 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -218,8 +218,8 @@ void CCONV cmAddUtilityCommand(void* arg, const char* utilityName, } // Pass the call to the makefile instance. - mf->AddUtilityCommand(utilityName, (all ? false : true), CM_NULLPTR, - depends2, commandLines); + mf->AddUtilityCommand(utilityName, (all ? false : true), 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 = CM_NULLPTR; + const char* no_comment = 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 = CM_NULLPTR; - const char* no_working_dir = CM_NULLPTR; + const char* no_comment = nullptr; + const char* no_working_dir = 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 = CM_NULLPTR; - const char* no_working_dir = CM_NULLPTR; + const char* no_comment = nullptr; + const char* no_working_dir = nullptr; mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines, cctype, no_comment, no_working_dir); } @@ -443,7 +443,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs, result.push_back(args[i]); } int resargc = static_cast<int>(result.size()); - char** resargv = CM_NULLPTR; + char** resargv = nullptr; if (resargc) { resargv = (char**)malloc(resargc * sizeof(char*)); } @@ -482,7 +482,7 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv) struct cmCPluginAPISourceFile { cmCPluginAPISourceFile() - : RealSourceFile(CM_NULLPTR) + : RealSourceFile(nullptr) { } cmSourceFile* RealSourceFile; @@ -554,7 +554,7 @@ void CCONV* cmGetSource(void* arg, const char* name) } return (void*)i->second; } - return CM_NULLPTR; + return nullptr; } void* CCONV cmAddSource(void* arg, void* arg2) @@ -562,7 +562,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 CM_NULLPTR; + return nullptr; } // Create the real cmSourceFile instance and copy over saved information. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index dfb1398..f948645 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -67,7 +67,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) { struct tm* lctime; - time_t tctime = time(CM_NULLPTR); + time_t tctime = time(nullptr); lctime = gmtime(&tctime); char buf[1024]; // add todays year day and month to the time in str because @@ -85,7 +85,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(CM_NULLPTR); + tctime = time(nullptr); cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl); const int dayLength = 24 * 60 * 60; @@ -131,7 +131,7 @@ std::string cmCTest::CleanString(const std::string& str) std::string cmCTest::CurrentTime() { - time_t currenttime = time(CM_NULLPTR); + time_t currenttime = time(nullptr); struct tm* t = localtime(¤ttime); // return ::CleanString(ctime(¤ttime)); char current_time[1024]; @@ -242,7 +242,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, CM_NULLPTR, 16))); + out.append(1, char(strtoul(buf, nullptr, 16))); c += 2; } else { out.append(1, *c); @@ -286,7 +286,7 @@ cmCTest::cmCTest() this->ScheduleType = ""; this->StopTime = ""; this->NextDayStopTime = false; - this->OutputLogFile = CM_NULLPTR; + this->OutputLogFile = nullptr; this->OutputLogFileLastTag = -1; this->SuppressUpdatingCTestConfiguration = false; this->DartVersion = 1; @@ -344,7 +344,7 @@ cmCTest::cmCTest() cmCTest::~cmCTest() { cmDeleteAll(this->TestingHandlers); - this->SetOutputLogFileName(CM_NULLPTR); + this->SetOutputLogFileName(nullptr); } void cmCTest::SetParallelLevel(int level) @@ -465,7 +465,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) std::string tag; if (createNewTag) { - time_t tctime = time(CM_NULLPTR); + time_t tctime = time(nullptr); if (this->TomorrowTag) { tctime += (24 * 60 * 60); } @@ -490,7 +490,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } tfin.close(); } - if (tag.empty() || (CM_NULLPTR != command) || this->Parts[PartStart]) { + if (tag.empty() || (nullptr != command) || this->Parts[PartStart]) { cmCTestOptionalLog( this, DEBUG, "TestModel: " << this->GetTestModelString() << std::endl, quiet); @@ -512,7 +512,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) ofs << this->GetTestModelString() << std::endl; } ofs.close(); - if (CM_NULLPTR == command) { + if (nullptr == command) { cmCTestOptionalLog(this, OUTPUT, "Create new tag: " << tag << " - " << this->GetTestModelString() << std::endl, @@ -808,7 +808,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if (it == this->TestingHandlers.end()) { - return CM_NULLPTR; + return nullptr; } it->second->Initialize(); return it->second; @@ -819,7 +819,7 @@ cmCTestGenericHandler* cmCTest::GetHandler(const char* handler) cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if (it == this->TestingHandlers.end()) { - return CM_NULLPTR; + return nullptr; } return it->second; } @@ -977,7 +977,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(CM_NULLPTR); + argv.push_back(nullptr); output = ""; cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:"); @@ -1007,7 +1007,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, CM_NULLPTR)) { + while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { processOutput.DecodeText(data, length, strdata); for (size_t cc = 0; cc < strdata.size(); ++cc) { if (strdata[cc] == 0) { @@ -1043,7 +1043,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, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); int result = cmsysProcess_GetState(cp); @@ -1172,7 +1172,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int length; cmProcessOutput processOutput(encoding); std::string strdata; - while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) { + while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { processOutput.DecodeText(data, length, strdata); if (output) { tempOutput.insert(tempOutput.end(), data, data + length); @@ -1192,7 +1192,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, } } - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); processOutput.DecodeText(tempOutput, tempOutput); if (output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); @@ -2229,7 +2229,7 @@ int cmCTest::ExecuteTests() it->second->SetSubmitIndex(this->SubmitIndex); } std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - if (!this->Initialize(cwd.c_str(), CM_NULLPTR)) { + if (!this->Initialize(cwd.c_str(), nullptr)) { res = 12; cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." << std::endl); @@ -2387,7 +2387,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname) bool inBld = bldRelpath.find("..") == std::string::npos; // TODO: Handle files with .. in their name - std::string* res = CM_NULLPTR; + std::string* res = nullptr; if (inSrc && inBld) { // If both have relative path with no dots, pick the shorter one @@ -2437,7 +2437,7 @@ void cmCTest::EmptyCTestConfiguration() void cmCTest::DetermineNextDayStop() { struct tm* lctime; - time_t current_time = time(CM_NULLPTR); + time_t current_time = time(nullptr); lctime = gmtime(¤t_time); int gm_hour = lctime->tm_hour; time_t gm_time = mktime(lctime); @@ -2521,7 +2521,7 @@ bool cmCTest::GetProduceXML() const char* cmCTest::GetSpecificTrack() { if (this->SpecificTrack.empty()) { - return CM_NULLPTR; + return nullptr; } return this->SpecificTrack.c_str(); } @@ -2596,7 +2596,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, a != args.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(CM_NULLPTR); + argv.push_back(nullptr); *stdOut = ""; *stdErr = ""; @@ -2619,7 +2619,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, int res; bool done = false; while (!done) { - res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR); + res = cmsysProcess_WaitForData(cp, &data, &length, nullptr); switch (res) { case cmsysProcess_Pipe_STDOUT: tempOutput.insert(tempOutput.end(), data, data + length); @@ -2643,7 +2643,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut, } } - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); if (!tempOutput.empty()) { processOutput.DecodeText(tempOutput, tempOutput); stdOut->append(&*tempOutput.begin(), tempOutput.size()); @@ -2687,7 +2687,7 @@ void cmCTest::SetOutputLogFileName(const char* name) { if (this->OutputLogFile) { delete this->OutputLogFile; - this->OutputLogFile = CM_NULLPTR; + this->OutputLogFile = nullptr; } if (name) { this->OutputLogFile = new cmGeneratedFileStream(name); @@ -2701,7 +2701,7 @@ static const char* cmCTestStringLogType[] = { "DEBUG", "HANDLER_VERBOSE_OUTPUT", "WARNING", "ERROR_MESSAGE", - CM_NULLPTR }; + nullptr }; #define cmCTestLogOutputFileLine(stream) \ if (this->ShowLineNumbers) { \ diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 0d2a903..10bc787 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -95,7 +95,7 @@ public: typedef std::set<std::string> SetOfStrings; /** Process Command line arguments */ - int Run(std::vector<std::string>&, std::string* output = CM_NULLPTR); + int Run(std::vector<std::string>&, std::string* output = nullptr); /** * Initialize and finalize testing @@ -252,8 +252,8 @@ public: * escaped for this to with spaces. */ bool RunCommand(const char* command, std::string* stdOut, - std::string* stdErr, int* retVal = CM_NULLPTR, - const char* dir = CM_NULLPTR, double timeout = 0.0, + std::string* stdErr, int* retVal = nullptr, + const char* dir = nullptr, double timeout = 0.0, Encoding encoding = cmProcessOutput::Auto); /** @@ -577,7 +577,7 @@ private: /** Check if the argument is the one specified */ bool CheckArgument(const std::string& arg, const char* varg1, - const char* varg2 = CM_NULLPTR); + const char* varg2 = nullptr); /** Output errors from a test */ void OutputTestErrors(std::vector<char> const& process_output); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 0b025ab..d599275 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -173,7 +173,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal, } const char* cmCacheManager::PersistentProperties[] = { "ADVANCED", "MODIFIED", - "STRINGS", CM_NULLPTR }; + "STRINGS", nullptr }; bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) @@ -440,7 +440,7 @@ cmCacheManager::CacheEntry* cmCacheManager::GetCacheEntry( if (i != this->Cache.end()) { return &i->second; } - return CM_NULLPTR; + return nullptr; } cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key) @@ -455,7 +455,7 @@ const char* cmCacheManager::GetInitializedCacheValue( if (i != this->Cache.end() && i->second.Initialized) { return i->second.Value.c_str(); } - return CM_NULLPTR; + return nullptr; } void cmCacheManager::PrintCache(std::ostream& out) const @@ -610,7 +610,7 @@ const char* cmCacheManager::CacheIterator::GetProperty( if (!this->IsAtEnd()) { return this->GetEntry().GetProperty(prop); } - return CM_NULLPTR; + return nullptr; } void cmCacheManager::CacheIterator::SetProperty(const std::string& p, @@ -647,5 +647,5 @@ void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v) bool cmCacheManager::CacheIterator::PropertyExists( const std::string& prop) const { - return this->GetProperty(prop) != CM_NULLPTR; + return this->GetProperty(prop) != nullptr; } diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index c464311..d215e10 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -117,7 +117,7 @@ public: void PrintCache(std::ostream&) const; ///! Get the iterator for an entry with a given key. - cmCacheManager::CacheIterator GetCacheIterator(const char* key = CM_NULLPTR); + cmCacheManager::CacheIterator GetCacheIterator(const char* key = nullptr); ///! Remove an entry from the cache void RemoveCacheEntry(const std::string& key); @@ -132,7 +132,7 @@ public: { cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); if (it.IsAtEnd()) { - return CM_NULLPTR; + return nullptr; } return it.GetValue(); } @@ -175,8 +175,7 @@ public: void RemoveCacheEntryProperty(std::string const& key, std::string const& propName) { - this->GetCacheIterator(key.c_str()) - .SetProperty(propName, (void*)CM_NULLPTR); + this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)nullptr); } void AppendCacheEntryProperty(std::string const& key, diff --git a/Source/cmCommand.h b/Source/cmCommand.h index ad72fe2..5f0f562 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -31,7 +31,7 @@ public: * Construct the command. By default it has no makefile. */ cmCommand() - : Makefile(CM_NULLPTR) + : Makefile(nullptr) { } diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 4eb4531..4764620 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -19,7 +19,7 @@ cmCommandArgumentParserHelper::cmCommandArgumentParserHelper() this->WarnUninitialized = false; this->CheckSystemVars = false; this->FileLine = -1; - this->FileName = CM_NULLPTR; + this->FileName = nullptr; this->RemoveEmpty = true; this->EmptyVariable[0] = 0; strcpy(this->DCURLYVariable, "${"); @@ -88,13 +88,13 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, e << "Syntax $" << key << "{} is not supported. " << "Only ${}, $ENV{}, and $CACHE{} are allowed."; this->SetError(e.str()); - return CM_NULLPTR; + return nullptr; } char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) { if (!var) { - return CM_NULLPTR; + return nullptr; } if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { std::ostringstream ostr; @@ -117,7 +117,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str()); } } - return CM_NULLPTR; + return nullptr; } if (this->EscapeQuotes && value) { return this->AddString(cmSystemTools::EscapeQuotes(value)); @@ -169,7 +169,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2) void cmCommandArgumentParserHelper::AllocateParserType( cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len) { - pt->str = CM_NULLPTR; + pt->str = nullptr; if (len == 0) { len = static_cast<int>(strlen(str)); } diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index babddbe..36d4da4 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -11,11 +11,11 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, , ArgumentsBeforeEmpty(true) , CurrentIndex(0) { - if (args != CM_NULLPTR) { + if (args != nullptr) { args->AddArgument(this); } - if (this->Group != CM_NULLPTR) { + if (this->Group != nullptr) { this->Group->ContainedArguments.push_back(this); } } @@ -35,7 +35,7 @@ void cmCommandArgument::Follows(const cmCommandArgument* arg) void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) { - if (group != CM_NULLPTR) { + if (group != nullptr) { this->ArgumentsBeforeEmpty = false; this->ArgumentsBefore.insert(group->ContainedArguments.begin(), group->ContainedArguments.end()); @@ -52,7 +52,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const bool cmCommandArgument::KeyMatches(const std::string& key) const { - if ((this->Key == CM_NULLPTR) || (this->Key[0] == '\0')) { + if ((this->Key == nullptr) || (this->Key[0] == '\0')) { return true; } return (key == this->Key); @@ -60,7 +60,7 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const void cmCommandArgument::ApplyOwnGroup() { - if (this->Group != CM_NULLPTR) { + if (this->Group != nullptr) { for (std::vector<cmCommandArgument*>::const_iterator it = this->Group->ContainedArguments.begin(); it != this->Group->ContainedArguments.end(); ++it) { @@ -88,9 +88,9 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) - , Ignore(CM_NULLPTR) + , Ignore(nullptr) { - if ((key == CM_NULLPTR) || (*key == 0)) { + if ((key == nullptr) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -100,7 +100,7 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index) { if (index >= this->DataStart) { - if ((this->Ignore == CM_NULLPTR) || (arg != this->Ignore)) { + if ((this->Ignore == nullptr) || (arg != this->Ignore)) { this->Vector.push_back(arg); } } @@ -117,7 +117,7 @@ cmCAString::cmCAString(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) { - if ((key == CM_NULLPTR) || (*key == 0)) { + if ((key == nullptr) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -199,7 +199,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group) void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs) { - if (args == CM_NULLPTR) { + if (args == nullptr) { return; } @@ -210,8 +210,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, (*argIt)->Reset(); } - cmCommandArgument* activeArgument = CM_NULLPTR; - const cmCommandArgument* previousArgument = CM_NULLPTR; + cmCommandArgument* activeArgument = nullptr; + const cmCommandArgument* previousArgument = nullptr; for (std::vector<std::string>::const_iterator it = args->begin(); it != args->end(); ++it) { for (std::vector<cmCommandArgument*>::iterator argIt = @@ -229,10 +229,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, bool argDone = activeArgument->Consume(*it); previousArgument = activeArgument; if (argDone) { - activeArgument = CM_NULLPTR; + activeArgument = nullptr; } } else { - if (unconsumedArgs != CM_NULLPTR) { + if (unconsumedArgs != nullptr) { unconsumedArgs->push_back(*it); } } diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 44db374..868c80f 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -38,7 +38,7 @@ class cmCommandArgument { public: cmCommandArgument(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = CM_NULLPTR); + cmCommandArgumentGroup* group = nullptr); virtual ~cmCommandArgument() {} /// this argument may follow after arg. 0 means it comes first. @@ -90,7 +90,7 @@ class cmCAStringVector : public cmCommandArgument { public: cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = CM_NULLPTR); + cmCommandArgumentGroup* group = nullptr); /// Return the vector of strings const std::vector<std::string>& GetVector() const { return this->Vector; } @@ -113,7 +113,7 @@ class cmCAString : public cmCommandArgument { public: cmCAString(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = CM_NULLPTR); + cmCommandArgumentGroup* group = nullptr); /// Return the string const std::string& GetString() const { return this->String; } @@ -132,7 +132,7 @@ class cmCAEnabler : public cmCommandArgument { public: cmCAEnabler(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = CM_NULLPTR); + cmCommandArgumentGroup* group = nullptr); /// Has it been enabled ? bool IsEnabled() const { return this->Enabled; } @@ -149,7 +149,7 @@ class cmCADisabler : public cmCommandArgument { public: cmCADisabler(cmCommandArgumentsHelper* args, const char* key, - cmCommandArgumentGroup* group = CM_NULLPTR); + cmCommandArgumentGroup* group = nullptr); /// Is it still enabled ? bool IsEnabled() const { return this->Enabled; } diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 6a007c8..ed5f64d 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -79,7 +79,7 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT"); format = cmOutputConverter::GetFortranFormat(tgtfmt); } - const char* var = CM_NULLPTR; + const char* var = nullptr; switch (format) { case cmOutputConverter::FortranFormatFixed: var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 9c516ee..2277bbe 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -194,7 +194,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, this->OldLinkDirMode = false; // No computation has been done. - this->CCG = CM_NULLPTR; + this->CCG = 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(CM_NULLPTR); + this->InferredDependSets.push_back(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, CM_NULLPTR }; + BFSEntry qe = { index, nullptr }; this->BFSQueue.push(qe); } else { // Look for an old-style <item>_LIB_DEPENDS variable. diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 84ee916..dd0e029 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -40,7 +40,7 @@ public: bool IsFlag; LinkEntry() : Item() - , Target(CM_NULLPTR) + , Target(nullptr) , IsSharedDep(false) , IsFlag(false) { diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b2deaaa..f348a7e 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -260,7 +260,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( this->GlobalGenerator, target, "linker search path"); this->OrderRuntimeSearchPath = new cmOrderDirectories( this->GlobalGenerator, target, "runtime search path"); - this->OrderDependentRPath = CM_NULLPTR; + this->OrderDependentRPath = nullptr; // Get the language used for linking this target. this->LinkLanguage = this->Target->GetLinkerLanguage(config); @@ -281,7 +281,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 = CM_NULLPTR; + this->LoaderFlag = nullptr; if (!this->UseImportLibrary && this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) { std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; @@ -562,7 +562,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, CM_NULLPTR); + this->AddItem(*i, nullptr); } } } @@ -616,7 +616,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // Also add the item the interface specifies to be used in its place. std::string const& libName = tgt->GetImportedLibName(config); if (!libName.empty()) { - this->AddItem(libName, CM_NULLPTR); + this->AddItem(libName, nullptr); } } else { // Decide whether to use an import library. @@ -710,7 +710,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, // Check if we need to include the dependent shared library in other // path ordering. - cmOrderDirectories* order = CM_NULLPTR; + cmOrderDirectories* order = nullptr; if (this->SharedDependencyMode == SharedDepModeLibDir && !this->LinkWithRuntimePath /* AddLibraryRuntimeInfo adds it */) { // Add the item to the linker search path. @@ -722,7 +722,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, if (order) { if (tgt) { std::string soName = tgt->GetSOName(this->Config); - const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str(); + const char* soname = soName.empty() ? nullptr : soName.c_str(); order->AddRuntimeLibrary(lib, soname); } else { order->AddRuntimeLibrary(lib); @@ -741,9 +741,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo() this->LinkTypeEnabled = false; // Lookup link type selection flags. - const char* static_link_type_flag = CM_NULLPTR; - const char* shared_link_type_flag = CM_NULLPTR; - const char* target_type_str = CM_NULLPTR; + const char* static_link_type_flag = nullptr; + const char* shared_link_type_flag = nullptr; + const char* target_type_str = nullptr; switch (this->Target->GetType()) { case cmStateEnums::EXECUTABLE: target_type_str = "EXE"; @@ -1623,7 +1623,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() ? CM_NULLPTR : soName.c_str(); + const char* soname = soName.empty() ? nullptr : soName.c_str(); // Include this library in the runtime path ordering. this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 00e3ad2..f8c6214 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -33,11 +33,11 @@ public: Item() : Value() , IsPath(true) - , Target(CM_NULLPTR) + , Target(nullptr) { } Item(std::string const& v, bool p, - cmGeneratorTarget const* target = CM_NULLPTR) + cmGeneratorTarget const* target = nullptr) : Value(v) , IsPath(p) , Target(target) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 8a3a671..ff0052b 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -290,7 +290,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( // within the project. if (dependee && dependee->GetType() == cmStateEnums::EXECUTABLE && !dependee->IsExecutableWithExports()) { - dependee = CM_NULLPTR; + dependee = nullptr; } if (dependee) { @@ -348,7 +348,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, // within the project. if (linking && dependee && dependee->GetType() == cmStateEnums::EXECUTABLE && !dependee->IsExecutableWithExports()) { - dependee = CM_NULLPTR; + dependee = nullptr; } if (dependee) { diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 2bacf73..5028e6b 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -139,7 +139,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted( if ((this->Policy54Status != cmPolicies::WARN && this->Policy54Status != cmPolicies::OLD) && argument.WasQuoted()) { - return CM_NULLPTR; + return nullptr; } const char* def = this->Makefile.GetDefinition(argument.GetValue()); @@ -455,7 +455,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, if (this->IsKeyword(keyCOMMAND, *arg) && argP1 != newArgs.end()) { cmCommand* command = this->Makefile.GetState()->GetCommand(argP1->c_str()); - this->HandlePredicate(command != CM_NULLPTR, reducible, arg, newArgs, + this->HandlePredicate(command != nullptr, reducible, arg, newArgs, argP1, argP2); } // does a policy exist @@ -467,7 +467,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, // does a target exist if (this->IsKeyword(keyTARGET, *arg) && argP1 != newArgs.end()) { this->HandlePredicate( - this->Makefile.FindTargetToUse(argP1->GetValue()) != CM_NULLPTR, + this->Makefile.FindTargetToUse(argP1->GetValue()) != nullptr, reducible, arg, newArgs, argP1, argP2); } // does a test exist @@ -475,8 +475,8 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, this->Policy64Status != cmPolicies::WARN) { if (this->IsKeyword(keyTEST, *arg) && argP1 != newArgs.end()) { const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str()); - this->HandlePredicate(haveTest != CM_NULLPTR, reducible, arg, - newArgs, argP1, argP2); + this->HandlePredicate(haveTest != nullptr, reducible, arg, newArgs, + argP1, argP2); } } else if (this->Policy64Status == cmPolicies::WARN && this->IsKeyword(keyTEST, *arg)) { diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index a920bf2..00b63a5 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -25,7 +25,6 @@ #cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH #cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE -#cmakedefine CMake_HAVE_CXX_NULLPTR #cmakedefine CMake_HAVE_CXX_OVERRIDE #cmakedefine CMake_HAVE_CXX_UNIQUE_PTR #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@" @@ -47,12 +46,6 @@ elif defined(CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH) #define CM_FALLTHROUGH #endif -#ifdef CMake_HAVE_CXX_NULLPTR -#define CM_NULLPTR nullptr -#else -#define CM_NULLPTR 0 -#endif - #ifdef CMake_HAVE_CXX_OVERRIDE #define CM_OVERRIDE override #else diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx index 00cf283..4d4daf3 100644 --- a/Source/cmConnection.cxx +++ b/Source/cmConnection.cxx @@ -69,7 +69,7 @@ void cmEventBasedConnection::on_new_connection(uv_stream_t* stream, int status) bool cmEventBasedConnection::IsOpen() const { - return this->WriteStream != CM_NULLPTR; + return this->WriteStream != nullptr; } void cmEventBasedConnection::WriteData(const std::string& data) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 9a4abf3..206620a 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -102,7 +102,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } const char* sourceDirectory = argv[2].c_str(); - const char* projectName = CM_NULLPTR; + const char* projectName = nullptr; std::string targetName; std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0] std::vector<std::string> compileDefs; diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 7995b2c..623c5e0 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -75,7 +75,7 @@ CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo) if (strcmp(algo, "SHA3_512") == 0) { return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHash(AlgoSHA3_512)); } - return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR); + return CM_AUTO_PTR<cmCryptoHash>(nullptr); } bool cmCryptoHash::IntFromHexDigit(char input, char& output) diff --git a/Source/cmCurl.h b/Source/cmCurl.h index a2fa4b1..c879ddd 100644 --- a/Source/cmCurl.h +++ b/Source/cmCurl.h @@ -8,6 +8,6 @@ #include "cm_curl.h" #include <string> -std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR); +std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = nullptr); #endif diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 5e377b5..e779468 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -30,7 +30,7 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf, , Backtrace() , Comment(comment ? comment : "") , WorkingDirectory(workingDirectory ? workingDirectory : "") - , HaveComment(comment != CM_NULLPTR) + , HaveComment(comment != nullptr) , EscapeAllowMakeVars(false) , EscapeOldStyle(true) , CommandExpandLists(false) @@ -62,7 +62,7 @@ const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const const char* cmCustomCommand::GetComment() const { - const char* no_comment = CM_NULLPTR; + const char* no_comment = nullptr; return this->HaveComment ? this->Comment.c_str() : no_comment; } diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index ef46b17..189d43a 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -75,7 +75,7 @@ const char* cmCustomCommandGenerator::GetCrossCompilingEmulator( unsigned int c) const { if (!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) { - return CM_NULLPTR; + return nullptr; } std::string const& argv0 = this->CommandLines[c][0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); @@ -83,7 +83,7 @@ const char* cmCustomCommandGenerator::GetCrossCompilingEmulator( !target->IsImported()) { return target->GetProperty("CROSSCOMPILING_EMULATOR"); } - return CM_NULLPTR; + return nullptr; } const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const @@ -96,7 +96,7 @@ const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { return target->GetLocation(this->Config); } - return CM_NULLPTR; + return nullptr; } std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const @@ -140,14 +140,13 @@ void cmCustomCommandGenerator::AppendArguments(unsigned int c, std::string& cmd) const { unsigned int offset = 1; - if (this->GetCrossCompilingEmulator(c) != CM_NULLPTR) { + if (this->GetCrossCompilingEmulator(c) != nullptr) { offset = 0; } cmCustomCommandLine const& commandLine = this->CommandLines[c]; for (unsigned int j = offset; j < commandLine.size(); ++j) { std::string arg; - if (const char* location = - j == 0 ? this->GetArgv0Location(c) : CM_NULLPTR) { + if (const char* location = j == 0 ? this->GetArgv0Location(c) : nullptr) { // GetCommand returned the emulator instead of the argv0 location, // so transform the latter now. arg = location; diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 7aa7641..0a95e8e 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -35,7 +35,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() : CM_NULLPTR; + return def.Exists ? def.c_str() : nullptr; } void cmDefinitions::Raise(const std::string& key, StackIter begin, diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index c898d12..a0775b3 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -18,7 +18,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir) : CompileDirectory() , LocalGenerator(lg) , Verbose(false) - , FileComparison(CM_NULLPTR) + , FileComparison(nullptr) , TargetDirectory(targetDir) , MaxPath(16384) , Dependee(new char[MaxPath]) @@ -125,7 +125,7 @@ bool cmDepends::CheckDependencies( // regenerated. bool okay = true; bool dependerExists = false; - DependencyVector* currentDependencies = CM_NULLPTR; + DependencyVector* currentDependencies = nullptr; while (internalDepends.getline(this->Dependee, this->MaxPath)) { if (this->Dependee[0] == 0 || this->Dependee[0] == '#' || @@ -167,7 +167,7 @@ bool cmDepends::CheckDependencies( bool regenerate = false; const char* dependee = this->Dependee + 1; const char* depender = this->Depender; - if (currentDependencies != CM_NULLPTR) { + if (currentDependencies != nullptr) { currentDependencies->push_back(dependee); } @@ -227,9 +227,9 @@ bool cmDepends::CheckDependencies( // Remove the information of this depender from the map, it needs // to be rescanned - if (currentDependencies != CM_NULLPTR) { + if (currentDependencies != nullptr) { validDeps.erase(this->Depender); - currentDependencies = CM_NULLPTR; + currentDependencies = nullptr; } // Remove the depender to be sure it is rebuilt. @@ -246,7 +246,7 @@ bool cmDepends::CheckDependencies( void cmDepends::SetIncludePathFromLanguage(const std::string& lang) { // Look for the new per "TARGET_" variant first: - const char* includePath = CM_NULLPTR; + const char* includePath = nullptr; std::string includePathVar = "CMAKE_"; includePathVar += lang; includePathVar += "_TARGET_INCLUDE_PATH"; diff --git a/Source/cmDepends.h b/Source/cmDepends.h index b33feb9..deeb663 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -29,7 +29,7 @@ class cmDepends public: /** Instances need to know the build directory name and the relative path from the build directory to the target file. */ - cmDepends(cmLocalGenerator* lg = CM_NULLPTR, const char* targetDir = ""); + cmDepends(cmLocalGenerator* lg = nullptr, const char* targetDir = ""); /** at what level will the compile be done from */ void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; } diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 2c464cc..39810f1 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -20,7 +20,7 @@ #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: " cmDependsC::cmDependsC() - : ValidDeps(CM_NULLPTR) + : ValidDeps(nullptr) { } @@ -96,7 +96,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, std::set<std::string> dependencies; bool haveDeps = false; - if (this->ValidDeps != CM_NULLPTR) { + if (this->ValidDeps != nullptr) { std::map<std::string, DependencyVector>::const_iterator tmpIt = this->ValidDeps->find(obj); if (tmpIt != this->ValidDeps->end()) { @@ -259,12 +259,12 @@ void cmDependsC::ReadCacheFile() } std::string line; - cmIncludeLines* cacheEntry = CM_NULLPTR; + cmIncludeLines* cacheEntry = nullptr; bool haveFileName = false; while (cmSystemTools::GetLineFromStream(fin, line)) { if (line.empty()) { - cacheEntry = CM_NULLPTR; + cacheEntry = nullptr; haveFileName = false; continue; } @@ -302,7 +302,7 @@ void cmDependsC::ReadCacheFile() } } } - } else if (cacheEntry != CM_NULLPTR) { + } else if (cacheEntry != nullptr) { UnscannedEntry entry; entry.FileName = line; if (cmSystemTools::GetLineFromStream(fin, line)) { diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 8b05fab..e149a19 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -52,7 +52,7 @@ public: }; cmDependsFortran::cmDependsFortran() - : Internal(CM_NULLPTR) + : Internal(nullptr) { } diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 7bc91bf..179c44a 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -57,7 +57,7 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt) if (!*pt) { return; } - *pt = CM_NULLPTR; + *pt = nullptr; this->UnionsAvailable--; } @@ -158,13 +158,13 @@ void cmDependsJavaParserHelper::PrepareElement( cmDependsJavaParserHelper::ParserType* me) { // Inititalize self - me->str = CM_NULLPTR; + me->str = nullptr; } void cmDependsJavaParserHelper::AllocateParserType( cmDependsJavaParserHelper::ParserType* pt, const char* str, int len) { - pt->str = CM_NULLPTR; + pt->str = nullptr; if (len == 0) { len = (int)strlen(str); } @@ -224,7 +224,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, CM_NULLPTR, "$"); + it->AddFileNamesForPrinting(&files, nullptr, "$"); } return files; } @@ -324,7 +324,7 @@ void cmDependsJavaParserHelper::Error(const char* str) void cmDependsJavaParserHelper::UpdateCombine(const char* str1, const char* str2) { - if (this->CurrentCombine == "" && str1 != CM_NULLPTR) { + if (this->CurrentCombine == "" && str1 != nullptr) { this->CurrentCombine = str1; } this->CurrentCombine += "."; diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index c6286b3..4af44b4 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -41,12 +41,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." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, nullptr } }; static const char* cmDocumentationGeneratorsHeader[][2] = { - { CM_NULLPTR, "The following generators are available on this platform:" }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, "The following generators are available on this platform:" }, + { nullptr, nullptr } }; cmDocumentation::cmDocumentation() @@ -403,7 +403,7 @@ void cmDocumentation::SetSections( void cmDocumentation::PrependSection(const char* name, const char* docs[][2]) { - cmDocumentationSection* sec = CM_NULLPTR; + cmDocumentationSection* sec = nullptr; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -417,7 +417,7 @@ void cmDocumentation::PrependSection(const char* name, const char* docs[][2]) void cmDocumentation::PrependSection(const char* name, std::vector<cmDocumentationEntry>& docs) { - cmDocumentationSection* sec = CM_NULLPTR; + cmDocumentationSection* sec = nullptr; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -430,7 +430,7 @@ void cmDocumentation::PrependSection(const char* name, void cmDocumentation::AppendSection(const char* name, const char* docs[][2]) { - cmDocumentationSection* sec = CM_NULLPTR; + cmDocumentationSection* sec = nullptr; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); @@ -444,7 +444,7 @@ void cmDocumentation::AppendSection(const char* name, const char* docs[][2]) void cmDocumentation::AppendSection(const char* name, std::vector<cmDocumentationEntry>& docs) { - cmDocumentationSection* sec = CM_NULLPTR; + cmDocumentationSection* sec = nullptr; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 2866fef..76b1fc5 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -32,7 +32,7 @@ public: * help arguments. */ bool CheckOptions(int argc, const char* const* argv, - const char* exitOpt = CM_NULLPTR); + const char* exitOpt = nullptr); /** * Print help requested on the command line. Call after diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index 7fbe75c..2fe0360 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -22,7 +22,7 @@ private: static cmDynamicLoaderCache* Instance; }; -cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = CM_NULLPTR; +cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = nullptr; cmDynamicLoaderCache::~cmDynamicLoaderCache() { @@ -71,7 +71,7 @@ void cmDynamicLoaderCache::FlushCache() cmsys::DynamicLoader::CloseLibrary(it->second); } delete cmDynamicLoaderCache::Instance; - cmDynamicLoaderCache::Instance = CM_NULLPTR; + cmDynamicLoaderCache::Instance = nullptr; } cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance() diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index fc97bf3..e2655e7 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -594,7 +594,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( if (dssi->second.Position > 0) { return &dssi->second; } - return CM_NULLPTR; + return nullptr; } // Create an entry for this tag. Assume it is missing until found. @@ -605,14 +605,14 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( // Try reading the dynamic section. if (!this->LoadDynamicSection()) { - return CM_NULLPTR; + return 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 CM_NULLPTR; + return nullptr; } ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link]; @@ -627,7 +627,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 CM_NULLPTR; + return nullptr; } // Seek to the position reported by the entry. @@ -656,7 +656,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( if (!this->Stream) { this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); se.Value = ""; - return CM_NULLPTR; + return nullptr; } // The value has been read successfully. Report it. @@ -667,7 +667,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( return &se; } } - return CM_NULLPTR; + return nullptr; } //============================================================================ @@ -683,7 +683,7 @@ const long cmELF::TagMipsRldMapRel = 0; #endif cmELF::cmELF(const char* fname) - : Internal(CM_NULLPTR) + : Internal(nullptr) { // Try to open the file. CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname)); @@ -811,7 +811,7 @@ cmELF::StringEntry const* cmELF::GetSOName() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) { return this->Internal->GetSOName(); } - return CM_NULLPTR; + return nullptr; } cmELF::StringEntry const* cmELF::GetRPath() @@ -821,7 +821,7 @@ cmELF::StringEntry const* cmELF::GetRPath() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRPath(); } - return CM_NULLPTR; + return nullptr; } cmELF::StringEntry const* cmELF::GetRunPath() @@ -831,7 +831,7 @@ cmELF::StringEntry const* cmELF::GetRunPath() this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRunPath(); } - return CM_NULLPTR; + return nullptr; } void cmELF::PrintInfo(std::ostream& os) const diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index fcc3c45..3c39816 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -86,7 +86,7 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args, args[1].c_str(), verbose); } else { result = cmExecProgramCommand::RunCommand(command.c_str(), output, retVal, - CM_NULLPTR, verbose); + nullptr, verbose); } if (!result) { retVal = -1; @@ -205,7 +205,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, } fflush(stdout); fflush(stderr); - const char* cmd[] = { "/bin/sh", "-c", command, CM_NULLPTR }; + const char* cmd[] = { "/bin/sh", "-c", command, nullptr }; cmsysProcess_SetCommand(cp, cmd); #endif @@ -217,7 +217,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, int p; cmProcessOutput processOutput(encoding); std::string strdata; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) { if (verbose) { processOutput.DecodeText(data, length, strdata); @@ -235,7 +235,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, } // All output has been read. Wait for the process to exit. - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); processOutput.DecodeText(output, output); // Check the result of running the process. diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 6463c4d..9f34799 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -38,8 +38,7 @@ public: private: static bool RunCommand(const char* command, std::string& output, int& retVal, - const char* directory = CM_NULLPTR, - bool verbose = true, + const char* directory = nullptr, bool verbose = true, Encoding encoding = cmProcessOutput::Auto); }; diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 435adca..0c76ce0 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -176,7 +176,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, return false; } // Add the null terminating pointer to the command argument list. - cmds[i].push_back(CM_NULLPTR); + cmds[i].push_back(nullptr); } // Parse the timeout string. @@ -244,7 +244,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, int p; cmProcessOutput processOutput(encoding); std::string strdata; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { // Put the output in the right place. if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) { if (output_variable.empty()) { @@ -276,7 +276,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, } // All output has been read. Wait for the process to exit. - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); processOutput.DecodeText(tempOutput, tempOutput); processOutput.DecodeText(tempError, tempError); diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index b443fb0..8662e8a 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -21,8 +21,8 @@ cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator() { - this->LG = CM_NULLPTR; - this->ExportSet = CM_NULLPTR; + this->LG = nullptr; + this->ExportSet = nullptr; } void cmExportBuildAndroidMKGenerator::GenerateImportHeaderCode( diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index a1c424a..1463c52 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -26,8 +26,8 @@ class cmSourceFile; cmExportBuildFileGenerator::cmExportBuildFileGenerator() { - this->LG = CM_NULLPTR; - this->ExportSet = CM_NULLPTR; + this->LG = nullptr; + this->ExportSet = nullptr; } void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 38cd511..64baa90 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -35,7 +35,7 @@ cmExportCommand::cmExportCommand() , ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup) , AndroidMKFile(&Helper, "ANDROID_MK") { - this->ExportSet = CM_NULLPTR; + this->ExportSet = nullptr; } // cmExportCommand @@ -51,10 +51,10 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args, return this->HandlePackage(args); } if (args[0] == "EXPORT") { - this->ExportSetName.Follows(CM_NULLPTR); + this->ExportSetName.Follows(nullptr); this->ArgumentGroup.Follows(&this->ExportSetName); } else { - this->Targets.Follows(CM_NULLPTR); + this->Targets.Follows(nullptr); this->ArgumentGroup.Follows(&this->Targets); } @@ -186,7 +186,7 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args, } // Setup export file generation. - cmExportBuildFileGenerator* ebfg = CM_NULLPTR; + cmExportBuildFileGenerator* ebfg = nullptr; if (android) { ebfg = new cmExportBuildAndroidMKGenerator; } else { diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index cd0a7e6..54e0e71 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -62,8 +62,8 @@ std::string cmExportTryCompileFileGenerator::FindTargets( cmGeneratorExpression ge; - cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, - CM_NULLPTR, CM_NULLPTR); + cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, nullptr, + nullptr); CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop); diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index c3f026a..d23b41b 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -14,7 +14,7 @@ int cmExpr_yyparse(yyscan_t yyscanner); cmExprParserHelper::cmExprParserHelper() { this->FileLine = -1; - this->FileName = CM_NULLPTR; + this->FileName = nullptr; } cmExprParserHelper::~cmExprParserHelper() diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index e7a8975..2054605 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -289,7 +289,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( xml.StartElement("Build"); - this->AppendTarget(xml, "all", CM_NULLPTR, make.c_str(), lgs[0], + this->AppendTarget(xml, "all", nullptr, make.c_str(), lgs[0], compiler.c_str(), makeArgs); // add all executable and library targets and some of the GLOBAL @@ -307,7 +307,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory()) == 0) { - this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, + this->AppendTarget(xml, targetName, nullptr, make.c_str(), *lg, compiler.c_str(), makeArgs); } } break; @@ -323,7 +323,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( break; } - this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, + this->AppendTarget(xml, targetName, nullptr, make.c_str(), *lg, compiler.c_str(), makeArgs); break; case cmStateEnums::EXECUTABLE: @@ -517,7 +517,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget( xml.StartElement("Target"); xml.Attribute("title", targetName); - if (target != CM_NULLPTR) { + if (target != nullptr) { int cbTargetType = this->GetCBTargetType(target); std::string workingDir = lg->GetCurrentBinaryDirectory(); if (target->GetType() == cmStateEnums::EXECUTABLE) { @@ -525,12 +525,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget( // set the working directory to this dir. const char* runtimeOutputDir = makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"); - if (runtimeOutputDir != CM_NULLPTR) { + if (runtimeOutputDir != nullptr) { workingDir = runtimeOutputDir; } else { const char* executableOutputDir = makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - if (executableOutputDir != CM_NULLPTR) { + if (executableOutputDir != nullptr) { workingDir = executableOutputDir; } } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 473af37..684d1f5 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -222,17 +222,17 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out, // now we have both, decide which one to use std::string valueToUse; - if (!envVarSet && cacheValue == CM_NULLPTR) { + if (!envVarSet && cacheValue == nullptr) { // nothing known, do nothing valueToUse = ""; - } else if (envVarSet && cacheValue == CM_NULLPTR) { + } else if (envVarSet && cacheValue == 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(), cmStateEnums::STRING, true); mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory()); - } else if (!envVarSet && cacheValue != CM_NULLPTR) { + } else if (!envVarSet && cacheValue != nullptr) { // It is already in the cache, but not in the env, so use it from the cache valueToUse = cacheValue; } else { diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 1380d18..a6a0c59 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -67,7 +67,7 @@ private: const std::string& make, const std::string& makeArguments, const std::string& path, const char* prefix = "", - const char* makeTarget = CM_NULLPTR); + const char* makeTarget = nullptr); static void AppendScannerProfile( cmXMLWriter& xml, const std::string& profileID, bool openActionEnabled, const std::string& openActionFilePath, bool pParserEnabled, diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index e366774..a75a400 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -135,9 +135,9 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, if (targetName == "edit_cache") { const char* editCommand = (*it)->GetMakefile()->GetDefinition("CMAKE_EDIT_COMMAND"); - if (editCommand == CM_NULLPTR) { + if (editCommand == nullptr) { insertTarget = false; - } else if (strstr(editCommand, "ccmake") != CM_NULLPTR) { + } else if (strstr(editCommand, "ccmake") != nullptr) { insertTarget = false; } } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index a62a546..5bb424b 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -174,9 +174,9 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::string compiler; if (!lgs.empty()) { - this->AppendTarget(fout, "all", lgs[0], CM_NULLPTR, make.c_str(), mf, + this->AppendTarget(fout, "all", lgs[0], nullptr, make.c_str(), mf, compiler.c_str(), sourceFileFlags, true); - this->AppendTarget(fout, "clean", lgs[0], CM_NULLPTR, make.c_str(), mf, + this->AppendTarget(fout, "clean", lgs[0], nullptr, make.c_str(), mf, compiler.c_str(), sourceFileFlags, false); } @@ -196,7 +196,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory()) == 0) { - this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(), + this->AppendTarget(fout, targetName, *lg, nullptr, make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); } @@ -213,7 +213,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( break; } - this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(), + this->AppendTarget(fout, targetName, *lg, nullptr, make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); break; @@ -245,7 +245,7 @@ void cmExtraSublimeTextGenerator::AppendTarget( MapSourceFileFlags& sourceFileFlags, bool firstTarget) { - if (target != CM_NULLPTR) { + if (target != nullptr) { std::vector<cmSourceFile*> sourceFiles; target->GetSourceFiles(sourceFiles, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index ff78f52..03d1ad1 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -72,8 +72,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args, // Add command for generating the .h and .cxx files std::string no_main_dependency; - const char* no_comment = CM_NULLPTR; - const char* no_working_dir = CM_NULLPTR; + const char* no_comment = nullptr; + const char* no_working_dir = nullptr; this->Makefile->AddCustomCommandToOutput( cxxres, depends, no_main_dependency, commandLines, no_comment, no_working_dir); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index b769a56..b68d4c0 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -269,17 +269,17 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args) cmCommandArgumentGroup group; cmCAString readArg(&argHelper, "READ"); - cmCAString fileNameArg(&argHelper, CM_NULLPTR); - cmCAString resultArg(&argHelper, CM_NULLPTR); + cmCAString fileNameArg(&argHelper, nullptr); + cmCAString resultArg(&argHelper, nullptr); cmCAString offsetArg(&argHelper, "OFFSET", &group); cmCAString limitArg(&argHelper, "LIMIT", &group); cmCAEnabler hexOutputArg(&argHelper, "HEX", &group); - readArg.Follows(CM_NULLPTR); + readArg.Follows(nullptr); fileNameArg.Follows(&readArg); resultArg.Follows(&fileNameArg); group.Follows(&resultArg); - argHelper.Parse(&args, CM_NULLPTR); + argHelper.Parse(&args, nullptr); std::string fileName = fileNameArg.GetString(); if (!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) { @@ -940,9 +940,9 @@ bool cmFileCommand::HandleDifferentCommand( */ // Evaluate arguments. - const char* file_lhs = CM_NULLPTR; - const char* file_rhs = CM_NULLPTR; - const char* var = CM_NULLPTR; + const char* file_lhs = nullptr; + const char* file_rhs = nullptr; + const char* var = nullptr; enum Doing { DoingNone, @@ -997,7 +997,7 @@ struct cmFileCopier , MatchlessFiles(true) , FilePermissions(0) , DirPermissions(0) - , CurrentMatchRule(CM_NULLPTR) + , CurrentMatchRule(nullptr) , UseGivenPermissionsFile(false) , UseGivenPermissionsDir(false) , UseSourcePermissions(true) @@ -2043,9 +2043,9 @@ bool cmFileCommand::HandleRPathChangeCommand( std::vector<std::string> const& args) { // Evaluate arguments. - const char* file = CM_NULLPTR; - const char* oldRPath = CM_NULLPTR; - const char* newRPath = CM_NULLPTR; + const char* file = nullptr; + const char* oldRPath = nullptr; + const char* newRPath = nullptr; enum Doing { DoingNone, @@ -2133,7 +2133,7 @@ bool cmFileCommand::HandleRPathRemoveCommand( std::vector<std::string> const& args) { // Evaluate arguments. - const char* file = CM_NULLPTR; + const char* file = nullptr; enum Doing { DoingNone, @@ -2197,8 +2197,8 @@ bool cmFileCommand::HandleRPathCheckCommand( std::vector<std::string> const& args) { // Evaluate arguments. - const char* file = CM_NULLPTR; - const char* rpath = CM_NULLPTR; + const char* file = nullptr; + const char* rpath = nullptr; enum Doing { DoingNone, @@ -2256,16 +2256,16 @@ bool cmFileCommand::HandleReadElfCommand(std::vector<std::string> const& args) cmCommandArgumentGroup group; cmCAString readArg(&argHelper, "READ_ELF"); - cmCAString fileNameArg(&argHelper, CM_NULLPTR); + cmCAString fileNameArg(&argHelper, nullptr); cmCAString rpathArg(&argHelper, "RPATH", &group); cmCAString runpathArg(&argHelper, "RUNPATH", &group); cmCAString errorArg(&argHelper, "CAPTURE_ERROR", &group); - readArg.Follows(CM_NULLPTR); + readArg.Follows(nullptr); fileNameArg.Follows(&readArg); group.Follows(&fileNameArg); - argHelper.Parse(&args, CM_NULLPTR); + argHelper.Parse(&args, nullptr); if (!cmSystemTools::FileExists(fileNameArg.GetString(), true)) { std::ostringstream e; @@ -2596,7 +2596,7 @@ public: } } - void release() { this->Easy = CM_NULLPTR; } + void release() { this->Easy = nullptr; } private: ::CURL* Easy; @@ -2881,7 +2881,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args) check_curl_result(res, "DOWNLOAD cannot set user password: "); } - struct curl_slist* headers = CM_NULLPTR; + struct curl_slist* headers = nullptr; for (std::vector<std::string>::const_iterator h = curl_headers.begin(); h != curl_headers.end(); ++h) { headers = ::curl_slist_append(headers, h->c_str()); @@ -3139,7 +3139,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) check_curl_result(res, "UPLOAD cannot set user password: "); } - struct curl_slist* headers = CM_NULLPTR; + struct curl_slist* headers = nullptr; for (std::vector<std::string>::const_iterator h = curl_headers.begin(); h != curl_headers.end(); ++h) { headers = ::curl_slist_append(headers, h->c_str()); @@ -3163,7 +3163,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) ::curl_global_cleanup(); fclose(fin); - fin = CM_NULLPTR; + fin = nullptr; if (!logVar.empty()) { std::string log; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 10c6fe4..c7d4a46 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -335,7 +335,7 @@ bool cmFindBase::CheckForVariableInCache() cmState* state = this->Makefile->GetState(); const char* cacheEntry = state->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = cacheEntry != CM_NULLPTR; + bool cached = cacheEntry != nullptr; if (found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 4ef0f3e..9ebe824 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -242,13 +242,13 @@ void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore) { // null-terminated list of paths. static const char* paths[] = { "CMAKE_SYSTEM_IGNORE_PATH", - "CMAKE_IGNORE_PATH", CM_NULLPTR }; + "CMAKE_IGNORE_PATH", nullptr }; // Construct the list of path roots with no trailing slashes. for (const char** pathName = paths; *pathName; ++pathName) { // Get the list of paths to ignore from the variable. const char* ignorePath = this->Makefile->GetDefinition(*pathName); - if ((ignorePath == CM_NULLPTR) || (strlen(ignorePath) == 0)) { + if ((ignorePath == nullptr) || (strlen(ignorePath) == 0)) { continue; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 7797700..d0cc6ce 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1319,7 +1319,7 @@ public: cmSystemTools::RemoveFile(this->File); } } - void Release() { this->File = CM_NULLPTR; } + void Release() { this->File = nullptr; } }; void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir, @@ -1642,7 +1642,7 @@ class cmFileList public: cmFileList() : First() - , Last(CM_NULLPTR) + , Last(nullptr) { } virtual ~cmFileList() {} diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 4e23f36..00f9bcb 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -61,7 +61,7 @@ cmFortranParser_s::cmFortranParser_s(std::vector<std::string> const& includes, // Create a dummy buffer that is never read but is the fallback // buffer when the last file is popped off the stack. YY_BUFFER_STATE buffer = - cmFortran_yy_create_buffer(CM_NULLPTR, 4, this->Scanner); + cmFortran_yy_create_buffer(nullptr, 4, this->Scanner); cmFortran_yy_switch_to_buffer(buffer, this->Scanner); } @@ -79,7 +79,7 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname) std::string dir = cmSystemTools::GetParentDirectory(fname); cmFortranFile f(file, current, dir); YY_BUFFER_STATE buffer = - cmFortran_yy_create_buffer(CM_NULLPTR, 16384, parser->Scanner); + cmFortran_yy_create_buffer(nullptr, 16384, parser->Scanner); cmFortran_yy_switch_to_buffer(buffer, parser->Scanner); parser->FileStack.push(f); return true; diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 34516f5..2a1a25e 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -71,12 +71,12 @@ class cmCompiledGeneratorExpression CM_DISABLE_COPY(cmCompiledGeneratorExpression) public: - const char* Evaluate( - cmLocalGenerator* lg, const std::string& config, bool quiet = false, - cmGeneratorTarget const* headTarget = CM_NULLPTR, - cmGeneratorTarget const* currentTarget = CM_NULLPTR, - cmGeneratorExpressionDAGChecker* dagChecker = CM_NULLPTR, - std::string const& language = std::string()) const; + const char* Evaluate(cmLocalGenerator* lg, const std::string& config, + bool quiet = false, + cmGeneratorTarget const* headTarget = nullptr, + cmGeneratorTarget const* currentTarget = nullptr, + cmGeneratorExpressionDAGChecker* dagChecker = nullptr, + std::string const& language = std::string()) const; const char* Evaluate(cmLocalGenerator* lg, const std::string& config, bool quiet, cmGeneratorTarget const* headTarget, cmGeneratorExpressionDAGChecker* dagChecker, diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 557a192..fa6a112 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -61,7 +61,7 @@ struct cmGeneratorExpressionDAGChecker void ReportError(cmGeneratorExpressionContext* context, const std::string& expr); - bool EvaluatingLinkLibraries(const char* tgt = CM_NULLPTR); + bool EvaluatingLinkLibraries(const char* tgt = nullptr); #define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const; diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 5003e8d..11d1d1d 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -38,7 +38,7 @@ void cmGeneratorExpressionEvaluationFile::Generate( std::string rawCondition = this->Condition->GetInput(); if (!rawCondition.empty()) { std::string condResult = this->Condition->Evaluate( - lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); + lg, config, false, nullptr, nullptr, nullptr, lang); if (condResult == "0") { return; } @@ -54,9 +54,9 @@ void cmGeneratorExpressionEvaluationFile::Generate( } std::string outputFileName = this->OutputFileExpr->Evaluate( - lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); + lg, config, false, nullptr, nullptr, nullptr, lang); const std::string outputContent = inputExpression->Evaluate( - lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang); + lg, config, false, nullptr, nullptr, nullptr, lang); if (cmSystemTools::FileIsFullPath(outputFileName)) { outputFileName = cmSystemTools::CollapseFullPath(outputFileName); @@ -103,7 +103,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile( for (std::vector<std::string>::const_iterator le = enabledLanguages.begin(); le != enabledLanguages.end(); ++le) { std::string name = this->OutputFileExpr->Evaluate( - lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, *le); + lg, config, false, nullptr, nullptr, nullptr, *le); cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(name); sf->SetProperty("GENERATED", "1"); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 4d2e5c7..4a43c0e 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -730,8 +730,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode CM_OVERRIDE { if (parameters.empty()) { - return configurationNode.Evaluate(parameters, context, content, - CM_NULLPTR); + return configurationNode.Evaluate(parameters, context, content, nullptr); } static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$"); if (!configValidator.find(*parameters.begin())) { @@ -750,8 +749,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } if (context->CurrentTarget && context->CurrentTarget->IsImported()) { - const char* loc = CM_NULLPTR; - const char* imp = CM_NULLPTR; + const char* loc = nullptr; + const char* imp = nullptr; std::string suffix; if (context->CurrentTarget->Target->GetMappedConfig( context->Config, &loc, &imp, suffix)) { @@ -864,7 +863,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode #define TRANSITIVE_PROPERTY_NAME(PROPERTY) , "INTERFACE_" #PROPERTY static const char* targetPropertyTransitiveWhitelist[] = { - CM_NULLPTR CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME) + nullptr CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME) }; #undef TRANSITIVE_PROPERTY_NAME @@ -1260,8 +1259,8 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode std::vector<std::string> objects; if (gt->IsImported()) { - const char* loc = CM_NULLPTR; - const char* imp = CM_NULLPTR; + const char* loc = nullptr; + const char* imp = nullptr; std::string suffix; if (gt->Target->GetMappedConfig(context->Config, &loc, &imp, suffix)) { cmSystemTools::ExpandListArgument(loc, objects); @@ -1389,7 +1388,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode } compileFeaturesNode; static const char* targetPolicyWhitelist[] = { - CM_NULLPTR + nullptr #define TARGET_POLICY_STRING(POLICY) , #POLICY CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING) @@ -1873,7 +1872,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode( } NodeMap::const_iterator i = nodeMap.find(identifier); if (i == nodeMap.end()) { - return CM_NULLPTR; + return nullptr; } return i->second; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 05f94dd..a0a3f4f 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -204,14 +204,14 @@ const char* cmGeneratorTarget::GetProperty(const std::string& prop) const if (!cmTargetPropertyComputer::PassesWhitelist( this->GetType(), prop, this->Makefile->GetMessenger(), this->GetBacktrace())) { - return CM_NULLPTR; + return nullptr; } if (const char* result = cmTargetPropertyComputer::GetProperty( this, prop, this->Makefile->GetMessenger(), this->GetBacktrace())) { return result; } if (cmSystemTools::GetFatalErrorOccured()) { - return CM_NULLPTR; + return nullptr; } return this->Target->GetProperty(prop); } @@ -379,7 +379,7 @@ std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends( if (i != this->SourceDepends.end()) { return &i->second.Depends; } - return CM_NULLPTR; + return nullptr; } static void handleSystemIncludesDep( @@ -517,7 +517,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang, } // Note: check consistency with messages from CheckIPOSupported - const char* message = CM_NULLPTR; + const char* message = nullptr; if (!this->Makefile->IsOn("_CMAKE_" + lang + "_IPO_SUPPORTED_BY_CMAKE")) { message = "CMake doesn't support IPO for current compiler"; } else if (!this->Makefile->IsOn("_CMAKE_" + lang + @@ -559,7 +559,7 @@ const char* cmGeneratorTarget::GetCustomObjectExtension() const extension = ".ptx"; return extension.c_str(); } - return CM_NULLPTR; + return nullptr; } void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf) @@ -755,7 +755,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory( if (iter == this->SystemIncludesCache.end()) { cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr); bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED"); @@ -948,7 +948,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files, } cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES", - CM_NULLPTR, CM_NULLPTR); + nullptr, nullptr); std::unordered_set<std::string> uniqueSrcs; bool contextDependentDirectSources = @@ -1720,7 +1720,7 @@ const char* cmGeneratorTarget::GetExportMacro() const } return this->ExportMacro.c_str(); } - return CM_NULLPTR; + return nullptr; } class cmTargetCollectLinkLanguages @@ -1980,7 +1980,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo( { // There is no compile information for imported targets. if (this->IsImported()) { - return CM_NULLPTR; + return nullptr; } if (this->GetType() > cmStateEnums::OBJECT_LIBRARY) { @@ -1989,7 +1989,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo( msg += " which has type "; msg += cmState::GetTargetTypeName(this->GetType()); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); - return CM_NULLPTR; + return nullptr; } // Lookup/compute/cache the compile information for this configuration. @@ -2015,7 +2015,7 @@ cmGeneratorTarget::GetModuleDefinitionInfo(std::string const& config) const if (this->GetType() != cmStateEnums::SHARED_LIBRARY && this->GetType() != cmStateEnums::MODULE_LIBRARY && !this->IsExecutableWithExports()) { - return CM_NULLPTR; + return nullptr; } // Lookup/compute/cache the compile information for this configuration. @@ -2066,7 +2066,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result, cmGeneratorExpression ge; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "AUTOUIC_OPTIONS", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "AUTOUIC_OPTIONS", nullptr, nullptr); cmSystemTools::ExpandListArgument( ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this, &dagChecker), @@ -2151,7 +2151,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target) this->Makefile = target->Target->GetMakefile(); this->LocalGenerator = target->GetLocalGenerator(); this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); - this->CurrentEntry = CM_NULLPTR; + this->CurrentEntry = nullptr; // Queue all the source files already specified for the target. if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { @@ -2226,7 +2226,7 @@ void cmTargetTraceDependencies::Trace() this->CheckCustomCommand(*cc); } } - this->CurrentEntry = CM_NULLPTR; + this->CurrentEntry = nullptr; this->GeneratorTarget->AddTracedSources(this->NewSources); } @@ -2425,7 +2425,7 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory( void cmGeneratorTarget::GetAppleArchs(const std::string& config, std::vector<std::string>& archVec) const { - const char* archs = CM_NULLPTR; + const char* archs = nullptr; if (!config.empty()) { std::string defVarName = "OSX_ARCHITECTURES_"; defVarName += cmSystemTools::UpperCase(config); @@ -2595,7 +2595,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories( std::unordered_set<std::string> uniqueIncludes; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "INCLUDE_DIRECTORIES", nullptr, nullptr); std::vector<std::string> debugProperties; const char* debugProp = @@ -2712,7 +2712,7 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result, std::unordered_set<std::string> uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "COMPILE_OPTIONS", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "COMPILE_OPTIONS", nullptr, nullptr); std::vector<std::string> debugProperties; const char* debugProp = @@ -2765,7 +2765,7 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result, std::unordered_set<std::string> uniqueFeatures; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "COMPILE_FEATURES", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "COMPILE_FEATURES", nullptr, nullptr); std::vector<std::string> debugProperties; const char* debugProp = @@ -2816,7 +2816,7 @@ void cmGeneratorTarget::GetCompileDefinitions( std::unordered_set<std::string> uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "COMPILE_DEFINITIONS", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "COMPILE_DEFINITIONS", nullptr, nullptr); std::vector<std::string> debugProperties; const char* debugProp = @@ -3052,8 +3052,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName, this->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules, // and then only when the platform supports an soname flag. - version = CM_NULLPTR; - soversion = CM_NULLPTR; + version = nullptr; + soversion = nullptr; } if (version && !soversion) { // The soversion must be set if the library version is set. Use @@ -3129,7 +3129,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name, const char* version = this->GetProperty("VERSION"); if (this->GetType() != cmStateEnums::EXECUTABLE || this->Makefile->IsOn("XCODE")) { - version = CM_NULLPTR; + version = nullptr; } #endif @@ -3235,7 +3235,7 @@ void cmGeneratorTarget::GetFullNameInternal( const char* targetSuffix = (isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX") : this->GetProperty("SUFFIX")); - const char* configPostfix = CM_NULLPTR; + const char* configPostfix = nullptr; if (!config.empty()) { std::string configProp = cmSystemTools::UpperCase(config); configProp += "_POSTFIX"; @@ -3243,7 +3243,7 @@ void cmGeneratorTarget::GetFullNameInternal( // Mac application bundles and frameworks have no postfix. if (configPostfix && (this->IsAppBundleOnApple() || this->IsFrameworkOnApple())) { - configPostfix = CM_NULLPTR; + configPostfix = nullptr; } } const char* prefixVar = this->Target->GetPrefixVariableInternal(artifact); @@ -3277,14 +3277,14 @@ void cmGeneratorTarget::GetFullNameInternal( fw_prefix = this->GetFrameworkDirectory(config, ContentLevel); fw_prefix += "/"; targetPrefix = fw_prefix.c_str(); - targetSuffix = CM_NULLPTR; + targetSuffix = nullptr; } if (this->IsCFBundleOnApple()) { fw_prefix = this->GetCFBundleDirectory(config, FullLevel); fw_prefix += "/"; targetPrefix = fw_prefix.c_str(); - targetSuffix = CM_NULLPTR; + targetSuffix = nullptr; } // Begin the final name with the prefix. @@ -3588,7 +3588,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt, case BoolType: assert(false && "String compatibility check function called for boolean"); - return CM_NULLPTR; + return nullptr; case StringType: return tgt->GetLinkInterfaceDependentStringProperty(prop, config); case NumberMinType: @@ -3597,7 +3597,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt, return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config); } assert(false && "Unreachable!"); - return CM_NULLPTR; + return nullptr; } template <typename PropertyType> @@ -3635,7 +3635,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, } if (emitted.insert(*pi).second) { getLinkInterfaceDependentProperty<PropertyType>(depender, *pi, config, t, - CM_NULLPTR); + nullptr); if (cmSystemTools::GetErrorOccuredFlag()) { return; } @@ -3713,25 +3713,25 @@ void cmGeneratorTarget::CheckPropertyCompatibility( } checkPropertyConsistency<bool>(this, li->Target, strBool, emittedBools, - config, BoolType, CM_NULLPTR); + config, BoolType, nullptr); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency<const char*>(this, li->Target, strString, emittedStrings, config, StringType, - CM_NULLPTR); + nullptr); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency<const char*>(this, li->Target, strNumMin, emittedMinNumbers, config, - NumberMinType, CM_NULLPTR); + NumberMinType, nullptr); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency<const char*>(this, li->Target, strNumMax, emittedMaxNumbers, config, - NumberMaxType, CM_NULLPTR); + NumberMaxType, nullptr); if (cmSystemTools::GetErrorOccuredFlag()) { return; } @@ -3865,7 +3865,7 @@ std::pair<bool, const char*> consistentStringProperty(const char* lhs, const char* rhs) { const bool b = strcmp(lhs, rhs) == 0; - return std::make_pair(b, b ? lhs : CM_NULLPTR); + return std::make_pair(b, b ? lhs : nullptr); } std::pair<bool, const char*> consistentNumberProperty(const char* lhs, @@ -3874,7 +3874,7 @@ std::pair<bool, const char*> consistentNumberProperty(const char* lhs, { char* pEnd; - const char* const null_ptr = CM_NULLPTR; + const char* const null_ptr = nullptr; long lnum = strtol(lhs, &pEnd, 0); if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) { @@ -3907,7 +3907,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs, return std::make_pair(true, lhs); } - const char* const null_ptr = CM_NULLPTR; + const char* const null_ptr = nullptr; switch (t) { case BoolType: @@ -4070,28 +4070,28 @@ bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE", - BoolType, CM_NULLPTR); + BoolType, nullptr); } const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility<const char*>( - this, p, config, "empty", StringType, CM_NULLPTR); + this, p, config, "empty", StringType, nullptr); } const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility<const char*>( - this, p, config, "empty", NumberMinType, CM_NULLPTR); + this, p, config, "empty", NumberMinType, nullptr); } const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty( const std::string& p, const std::string& config) const { return checkInterfacePropertyCompatibility<const char*>( - this, p, config, "empty", NumberMaxType, CM_NULLPTR); + this, p, config, "empty", NumberMaxType, nullptr); } cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( @@ -4106,7 +4106,7 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( new cmComputeLinkInformation(this, config); if (!info || !info->Compute()) { delete info; - info = CM_NULLPTR; + info = nullptr; } // Store the information for this configuration. @@ -4298,8 +4298,8 @@ void cmGeneratorTarget::ExpandLinkItems( std::vector<cmLinkItem>& items, bool& hadHeadSensitiveCondition) const { cmGeneratorExpression ge; - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, CM_NULLPTR, - CM_NULLPTR); + cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, nullptr, + nullptr); // The $<LINK_ONLY> expression may be in a link interface to specify private // link dependencies that are otherwise excluded from usage requirements. if (usage_requirements_only) { @@ -4327,7 +4327,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface( // export symbols. if (this->GetType() == cmStateEnums::EXECUTABLE && !this->IsExecutableWithExports()) { - return CM_NULLPTR; + return nullptr; } // Lookup any existing link interface for this configuration. @@ -4351,7 +4351,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface( } } - return iface.Exists ? &iface : CM_NULLPTR; + return iface.Exists ? &iface : nullptr; } void cmGeneratorTarget::ComputeLinkInterface( @@ -4443,7 +4443,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries( // export symbols. if (this->GetType() == cmStateEnums::EXECUTABLE && !this->IsExecutableWithExports()) { - return CM_NULLPTR; + return nullptr; } // Lookup any existing link interface for this configuration. @@ -4466,7 +4466,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries( usage_requirements_only); } - return iface.Exists ? &iface : CM_NULLPTR; + return iface.Exists ? &iface : nullptr; } std::string cmGeneratorTarget::GetDirectory( @@ -4501,7 +4501,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( { // There is no output information for imported targets. if (this->IsImported()) { - return CM_NULLPTR; + return nullptr; } // Only libraries and executables have well-defined output files. @@ -4511,7 +4511,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( msg += " which has type "; msg += cmState::GetTargetTypeName(this->GetType()); this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); - return CM_NULLPTR; + return nullptr; } // Lookup/compute/cache the output information for this configuration. @@ -4544,7 +4544,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( cmake::FATAL_ERROR, "Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.", this->GetBacktrace()); - return CM_NULLPTR; + return nullptr; } return &i->second; } @@ -4559,7 +4559,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, // Look for a target property defining the target output directory // based on the target type. std::string targetTypeName = this->GetOutputTargetType(artifact); - const char* propertyName = CM_NULLPTR; + const char* propertyName = nullptr; std::string propertyNameStr = targetTypeName; if (!propertyNameStr.empty()) { propertyNameStr += "_OUTPUT_DIRECTORY"; @@ -4568,7 +4568,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(conf); - const char* configProp = CM_NULLPTR; + const char* configProp = nullptr; std::string configPropStr = targetTypeName; if (!configPropStr.empty()) { configPropStr += "_OUTPUT_DIRECTORY_"; @@ -4636,7 +4636,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, { // Look for a target property defining the target output directory // based on the target type. - const char* propertyName = CM_NULLPTR; + const char* propertyName = nullptr; std::string propertyNameStr = kind; if (!propertyNameStr.empty()) { propertyNameStr += "_OUTPUT_DIRECTORY"; @@ -4646,7 +4646,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(conf); - const char* configProp = CM_NULLPTR; + const char* configProp = nullptr; std::string configPropStr = kind; if (!configPropStr.empty()) { configPropStr += "_OUTPUT_DIRECTORY_"; @@ -4704,7 +4704,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // An explicit list of interface libraries may be set for shared // libraries and executables that export symbols. - const char* explicitLibraries = CM_NULLPTR; + const char* explicitLibraries = nullptr; std::string linkIfaceProp; if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD && this->GetPolicyStatusCMP0022() != cmPolicies::WARN) { @@ -4831,7 +4831,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface( { cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config); if (!info) { - return CM_NULLPTR; + return nullptr; } std::string CONFIG = cmSystemTools::UpperCase(config); @@ -4867,7 +4867,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( { // There is no imported information for non-imported targets. if (!this->IsImported()) { - return CM_NULLPTR; + return nullptr; } // Lookup/compute/cache the import information for this @@ -4893,7 +4893,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( // If the location is empty then the target is not available for // this configuration. if (i->second.Location.empty() && i->second.ImportLibrary.empty()) { - return CM_NULLPTR; + return nullptr; } // Return the import information. @@ -4910,8 +4910,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Initialize members. info.NoSOName = false; - const char* loc = CM_NULLPTR; - const char* imp = CM_NULLPTR; + const char* loc = nullptr; + const char* imp = nullptr; std::string suffix; if (!this->Target->GetMappedConfig(desired_config, &loc, &imp, suffix)) { return; @@ -5056,7 +5056,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation( { // There is no link implementation for imported targets. if (this->IsImported()) { - return CM_NULLPTR; + return nullptr; } std::string CONFIG = cmSystemTools::UpperCase(config); @@ -5288,7 +5288,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal( { // There is no link implementation for imported targets. if (this->IsImported()) { - return CM_NULLPTR; + return nullptr; } // Populate the link implementation libraries for this configuration. @@ -5329,7 +5329,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( le != end; ++le, ++btIt) { std::vector<std::string> llibs; cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), "LINK_LIBRARIES", CM_NULLPTR, CM_NULLPTR); + this->GetName(), "LINK_LIBRARIES", nullptr, nullptr); cmGeneratorExpression ge(*btIt); CM_AUTO_PTR<cmCompiledGeneratorExpression> const cge = ge.Parse(*le); std::string const evaluated = @@ -5422,7 +5422,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink( // within the project. if (tgt && tgt->GetType() == cmStateEnums::EXECUTABLE && !tgt->IsExecutableWithExports()) { - tgt = CM_NULLPTR; + tgt = nullptr; } if (tgt && tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { @@ -5436,7 +5436,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink( "with the ENABLE_EXPORTS property set."; cmake* cm = this->LocalGenerator->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace()); - tgt = CM_NULLPTR; + tgt = nullptr; } return tgt; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index b5f7f6e..9d31143 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -524,7 +524,7 @@ public: { SourceFileFlags() : Type(SourceFileTypeNormal) - , MacFolder(CM_NULLPTR) + , MacFolder(nullptr) { } SourceFileType Type; @@ -570,7 +570,7 @@ public: /** Convert the given GNU import library name (.dll.a) to a name with a new extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */ bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out, - const char* newExt = CM_NULLPTR) const; + const char* newExt = nullptr) const; bool IsExecutableWithExports() const; diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 5ba3326..fc82fee 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -37,7 +37,7 @@ bool cmGetCMakePropertyCommand::InitialPass( this->Makefile->GetGlobalGenerator()->GetInstallComponents(); output = cmJoin(*components, ";"); } else { - const char* prop = CM_NULLPTR; + const char* prop = nullptr; if (!args[1].empty()) { prop = this->Makefile->GetState()->GetGlobalProperty(args[1]); } diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 1005b15..a8cf6ab 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -70,7 +70,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass( return true; } - const char* prop = CM_NULLPTR; + const char* prop = nullptr; if (!i->empty()) { if (*i == "DEFINITIONS") { switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0059)) { diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index ddecdf6..4494c3e 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -258,9 +258,9 @@ bool cmGetPropertyCommand::HandleTargetMode() if (this->Makefile->IsAlias(this->Name)) { return this->StoreResult(target->GetName().c_str()); } - return this->StoreResult(CM_NULLPTR); + return this->StoreResult(nullptr); } - const char* prop_cstr = CM_NULLPTR; + const char* prop_cstr = nullptr; cmListFileBacktrace bt = this->Makefile->GetBacktrace(); cmMessenger* messenger = this->Makefile->GetMessenger(); if (cmTargetPropertyComputer::PassesWhitelist( @@ -333,7 +333,7 @@ bool cmGetPropertyCommand::HandleCacheMode() return false; } - const char* value = CM_NULLPTR; + const char* value = nullptr; if (this->Makefile->GetState()->GetCacheEntryValue(this->Name)) { value = this->Makefile->GetState()->GetCacheEntryProperty( this->Name, this->PropertyName); @@ -357,7 +357,7 @@ bool cmGetPropertyCommand::HandleInstallMode() std::string value; bool isSet = file->GetProperty(this->PropertyName, value); - return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR); + return this->StoreResult(isSet ? value.c_str() : nullptr); } std::ostringstream e; e << "given INSTALL name that could not be found or created: " << this->Name; diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx index 1a5f08e..75879a5 100644 --- a/Source/cmGetSourceFilePropertyCommand.cxx +++ b/Source/cmGetSourceFilePropertyCommand.cxx @@ -28,7 +28,7 @@ bool cmGetSourceFilePropertyCommand::InitialPass( this->Makefile->AddDefinition(var, sf->GetLanguage().c_str()); return true; } - const char* prop = CM_NULLPTR; + const char* prop = nullptr; if (!args[2].empty()) { prop = sf->GetPropertyForUser(args[2]); } diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 0910a53..ec485aa 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -34,7 +34,7 @@ bool cmGetTargetPropertyCommand::InitialPass( prop_exists = true; } } else if (!args[2].empty()) { - const char* prop_cstr = CM_NULLPTR; + const char* prop_cstr = nullptr; cmListFileBacktrace bt = this->Makefile->GetBacktrace(); cmMessenger* messenger = this->Makefile->GetMessenger(); if (cmTargetPropertyComputer::PassesWhitelist(tgt->GetType(), args[2], diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index 6424515..0b0d6eb 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -20,7 +20,7 @@ bool cmGetTestPropertyCommand::InitialPass( std::string const& var = args[2]; cmTest* test = this->Makefile->GetTest(testName); if (test) { - const char* prop = CM_NULLPTR; + const char* prop = nullptr; if (!args[1].empty()) { prop = test->GetProperty(args[1]); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 85ba5ee..ab35593 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -89,9 +89,9 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm) // how long to let try compiles run this->TryCompileTimeout = 0; - this->ExtraGenerator = CM_NULLPTR; - this->CurrentConfigureMakefile = CM_NULLPTR; - this->TryCompileOuterMakefile = CM_NULLPTR; + this->ExtraGenerator = nullptr; + this->CurrentConfigureMakefile = nullptr; + this->TryCompileOuterMakefile = nullptr; this->ConfigureDoneCMP0026AndCMP0024 = false; this->FirstTimeProgress = 0.0f; @@ -252,7 +252,7 @@ bool cmGlobalGenerator::GenerateImportFile(const std::string& file) } delete it->second; - it->second = CM_NULLPTR; + it->second = nullptr; this->BuildExportSets.erase(it); return result; } @@ -1144,7 +1144,7 @@ void cmGlobalGenerator::Configure() std::ostringstream msg; if (cmSystemTools::GetErrorOccuredFlag()) { msg << "Configuring incomplete, errors occurred!"; - const char* logs[] = { "CMakeOutput.log", "CMakeError.log", CM_NULLPTR }; + const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr }; for (const char** log = logs; *log; ++log) { std::string f = this->CMakeInstance->GetHomeOutputDirectory(); f += this->CMakeInstance->GetCMakeFilesDirectory(); @@ -1191,7 +1191,7 @@ cmExportBuildFileGenerator* cmGlobalGenerator::GetExportedTargetsFile( { std::map<std::string, cmExportBuildFileGenerator*>::const_iterator it = this->BuildExportSets.find(filename); - return it == this->BuildExportSets.end() ? CM_NULLPTR : it->second; + return it == this->BuildExportSets.end() ? nullptr : it->second; } void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target) @@ -1351,7 +1351,7 @@ void cmGlobalGenerator::Generate() "Generating", (static_cast<float>(i) + 1.0f) / static_cast<float>(this->LocalGenerators.size())); } - this->SetCurrentMakefile(CM_NULLPTR); + this->SetCurrentMakefile(nullptr); if (!this->GenerateCPackPropertiesFile()) { this->GetCMakeInstance()->IssueMessage( @@ -1374,7 +1374,7 @@ void cmGlobalGenerator::Generate() this->WriteSummary(); - if (this->ExtraGenerator != CM_NULLPTR) { + if (this->ExtraGenerator != nullptr) { this->ExtraGenerator->Generate(); } @@ -1815,7 +1815,7 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/, output += "\n"; if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr, outputPtr, - &retVal, CM_NULLPTR, outputflag, + &retVal, nullptr, outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); @@ -1834,7 +1834,7 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/, output += "\n"; if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr, outputPtr, - &retVal, CM_NULLPTR, outputflag, + &retVal, nullptr, outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( @@ -2057,7 +2057,7 @@ cmMakefile* cmGlobalGenerator::FindMakefile(const std::string& start_dir) const if (i != this->MakefileSearchIndex.end()) { return i->second; } - return CM_NULLPTR; + return nullptr; } ///! Find a local generator by its startdirectory @@ -2072,7 +2072,7 @@ cmLocalGenerator* cmGlobalGenerator::FindLocalGenerator( return *it; } } - return CM_NULLPTR; + return nullptr; } void cmGlobalGenerator::AddAlias(const std::string& name, @@ -2117,7 +2117,7 @@ cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const if (i != this->TargetSearchIndex.end()) { return i->second; } - return CM_NULLPTR; + return nullptr; } cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl( @@ -2128,7 +2128,7 @@ cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl( if (i != this->GeneratorTargetSearchIndex.end()) { return i->second; } - return CM_NULLPTR; + return nullptr; } cmTarget* cmGlobalGenerator::FindTarget(const std::string& name, @@ -2413,7 +2413,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install( // install_strip const char* install_strip = this->GetInstallStripTargetName(); - if ((install_strip != CM_NULLPTR) && (mf->IsSet("CMAKE_STRIP"))) { + if ((install_strip != nullptr) && (mf->IsSet("CMAKE_STRIP"))) { gti.Name = install_strip; gti.Message = "Installing the project stripped..."; gti.UsesTerminal = true; @@ -2470,8 +2470,8 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(GlobalTargetInfo const& gti, std::vector<std::string> no_byproducts; std::vector<std::string> no_depends; // Store the custom command in the target. - cmCustomCommand cc(CM_NULLPTR, no_outputs, no_byproducts, no_depends, - gti.CommandLines, CM_NULLPTR, gti.WorkingDir.c_str()); + cmCustomCommand cc(nullptr, no_outputs, no_byproducts, no_depends, + gti.CommandLines, nullptr, gti.WorkingDir.c_str()); cc.SetUsesTerminal(gti.UsesTerminal); target.AddPostBuildCommand(cc); if (!gti.Message.empty()) { @@ -2556,7 +2556,7 @@ void cmGlobalGenerator::SetExternalMakefileProjectGenerator( cmExternalMakefileProjectGenerator* extraGenerator) { this->ExtraGenerator = extraGenerator; - if (this->ExtraGenerator != CM_NULLPTR) { + if (this->ExtraGenerator != nullptr) { this->ExtraGenerator->SetGlobalGenerator(this); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index aad6725..7239878 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -295,15 +295,15 @@ public: virtual const char* GetAllTargetName() const { return "ALL_BUILD"; } virtual const char* GetInstallTargetName() const { return "INSTALL"; } - virtual const char* GetInstallLocalTargetName() const { return CM_NULLPTR; } - virtual const char* GetInstallStripTargetName() const { return CM_NULLPTR; } - virtual const char* GetPreinstallTargetName() const { return CM_NULLPTR; } + virtual const char* GetInstallLocalTargetName() const { return nullptr; } + virtual const char* GetInstallStripTargetName() const { return nullptr; } + virtual const char* GetPreinstallTargetName() const { return nullptr; } virtual const char* GetTestTargetName() const { return "RUN_TESTS"; } virtual const char* GetPackageTargetName() const { return "PACKAGE"; } - virtual const char* GetPackageSourceTargetName() const { return CM_NULLPTR; } - virtual const char* GetEditCacheTargetName() const { return CM_NULLPTR; } - virtual const char* GetRebuildCacheTargetName() const { return CM_NULLPTR; } - virtual const char* GetCleanTargetName() const { return CM_NULLPTR; } + virtual const char* GetPackageSourceTargetName() const { return nullptr; } + virtual const char* GetEditCacheTargetName() const { return nullptr; } + virtual const char* GetRebuildCacheTargetName() const { return nullptr; } + virtual const char* GetCleanTargetName() const { return nullptr; } // Lookup edit_cache target command preferred by this generator. virtual std::string GetEditCacheCommand() const { return ""; } @@ -557,7 +557,7 @@ private: void IndexMakefile(cmMakefile* mf); - virtual const char* GetBuildIgnoreErrorsFlag() const { return CM_NULLPTR; } + virtual const char* GetBuildIgnoreErrorsFlag() const { return nullptr; } // Cache directory content and target files to be built. struct DirectoryContent diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index d5a6db0..0f192b2 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -48,7 +48,7 @@ public: cmake* cm) const CM_OVERRIDE { if (name != T::GetActualName()) { - return CM_NULLPTR; + return nullptr; } return new T(cm); } diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 85a1417..39ac73a 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -115,13 +115,13 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( // make sure the file is part of this source tree if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - CM_NULLPTR)) { + nullptr)) { files.insert(tmp); tmp = cmSystemTools::GetFilenameName(tmp); // add all files which dont match the default // */CMakeLists.txt;*cmake; to the file pattern if ((tmp != "CMakeLists.txt") && - (strstr(tmp.c_str(), ".cmake") == CM_NULLPTR)) { + (strstr(tmp.c_str(), ".cmake") == nullptr)) { cmakeFilePattern += tmp + ";"; } } @@ -147,7 +147,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - CM_NULLPTR) && + nullptr) && (cmSystemTools::GetFilenameExtension(tmp) != ".moc")) { files.insert(tmp); @@ -171,7 +171,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); if ((tmp[0] != '/') && (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - CM_NULLPTR)) { + nullptr)) { files.insert(tmp); } } @@ -301,12 +301,12 @@ void cmGlobalKdevelopGenerator::MergeProjectFiles( it != lines.end(); it++) { const char* line = (*it).c_str(); // skip these tags as they are always replaced - if ((strstr(line, "<projectdirectory>") != CM_NULLPTR) || - (strstr(line, "<projectmanagement>") != CM_NULLPTR) || - (strstr(line, "<absoluteprojectpath>") != CM_NULLPTR) || - (strstr(line, "<filelistdirectory>") != CM_NULLPTR) || - (strstr(line, "<buildtool>") != CM_NULLPTR) || - (strstr(line, "<builddir>") != CM_NULLPTR)) { + if ((strstr(line, "<projectdirectory>") != nullptr) || + (strstr(line, "<projectmanagement>") != nullptr) || + (strstr(line, "<absoluteprojectpath>") != nullptr) || + (strstr(line, "<filelistdirectory>") != nullptr) || + (strstr(line, "<buildtool>") != nullptr) || + (strstr(line, "<builddir>") != nullptr)) { continue; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2eef9e4..7bc4239 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -474,9 +474,9 @@ void cmGlobalNinjaGenerator::WriteDefault(std::ostream& os, cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) : cmGlobalCommonGenerator(cm) - , BuildFileStream(CM_NULLPTR) - , RulesFileStream(CM_NULLPTR) - , CompileCommandsStream(CM_NULLPTR) + , BuildFileStream(nullptr) + , RulesFileStream(nullptr) + , CompileCommandsStream(nullptr) , Rules() , AllDependencies() , UsingGCCOnWindows(false) @@ -582,8 +582,8 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf) command.push_back("--version"); std::string version; std::string error; - if (!cmSystemTools::RunSingleCommand(command, &version, &error, CM_NULLPTR, - CM_NULLPTR, + if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr, + nullptr, cmSystemTools::OUTPUT_NONE)) { mf->IssueMessage(cmake::FATAL_ERROR, "Running\n '" + cmJoin(command, "' '") + "'\n" @@ -805,7 +805,7 @@ void cmGlobalNinjaGenerator::CloseBuildFileStream() { if (this->BuildFileStream) { delete this->BuildFileStream; - this->BuildFileStream = CM_NULLPTR; + this->BuildFileStream = nullptr; } else { cmSystemTools::Error("Build file stream was not open."); } @@ -847,7 +847,7 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream() { if (this->RulesFileStream) { delete this->RulesFileStream; - this->RulesFileStream = CM_NULLPTR; + this->RulesFileStream = nullptr; } else { cmSystemTools::Error("Rules file stream was not open."); } @@ -928,7 +928,7 @@ void cmGlobalNinjaGenerator::CloseCompileCommandsStream() if (this->CompileCommandsStream) { *this->CompileCommandsStream << "\n]"; delete this->CompileCommandsStream; - this->CompileCommandsStream = CM_NULLPTR; + this->CompileCommandsStream = nullptr; } } @@ -1092,7 +1092,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, // Mark the target's outputs as ambiguous to ensure that no other target uses // the output as an alias. for (cmNinjaDeps::iterator i = outputs.begin(); i != outputs.end(); ++i) { - TargetAliases[*i] = CM_NULLPTR; + TargetAliases[*i] = nullptr; } // Insert the alias into the map. If the alias was already present in the @@ -1100,7 +1100,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, std::pair<TargetAliasMap::iterator, bool> newAlias = TargetAliases.insert(std::make_pair(buildAlias, target)); if (newAlias.second && newAlias.first->second != target) { - newAlias.first->second = CM_NULLPTR; + newAlias.first->second = nullptr; } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index b0008f7..49528b9 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -114,7 +114,7 @@ public: const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables, const std::string& rspfile = std::string(), - int cmdLineLimit = 0, bool* usedResponseFile = CM_NULLPTR); + int cmdLineLimit = 0, bool* usedResponseFile = nullptr); /** * Helper to write a build statement with the special 'phony' rule. diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index e42bf20..05c9ce0 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -38,7 +38,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) #else this->UseLinkScript = true; #endif - this->CommandDatabase = CM_NULLPTR; + this->CommandDatabase = nullptr; this->IncludeDirective = "include"; this->DefineWindowsNULL = false; @@ -161,10 +161,10 @@ void cmGlobalUnixMakefileGenerator3::Generate() this->WriteMainMakefile2(); this->WriteMainCMakefile(); - if (this->CommandDatabase != CM_NULLPTR) { + if (this->CommandDatabase != nullptr) { *this->CommandDatabase << std::endl << "]"; delete this->CommandDatabase; - this->CommandDatabase = CM_NULLPTR; + this->CommandDatabase = nullptr; } } @@ -172,7 +172,7 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( const std::string& sourceFile, const std::string& workingDirectory, const std::string& compileCommand) { - if (this->CommandDatabase == CM_NULLPTR) { + if (this->CommandDatabase == nullptr) { std::string commandDatabaseName = std::string(this->GetCMakeInstance()->GetHomeOutputDirectory()) + "/compile_commands.json"; diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 4fff11a..1c0953a 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -495,7 +495,7 @@ const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const { std::string const& toolset = this->GetPlatformToolsetString(); if (toolset.empty()) { - return CM_NULLPTR; + return nullptr; } return toolset.c_str(); } @@ -519,7 +519,7 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const if (!this->GeneratorToolsetHostArchitecture.empty()) { return this->GeneratorToolsetHostArchitecture.c_str(); } - return CM_NULLPTR; + return nullptr; } const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const @@ -527,7 +527,7 @@ const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const if (!this->GeneratorToolsetCuda.empty()) { return this->GeneratorToolsetCuda.c_str(); } - return CM_NULLPTR; + return nullptr; } std::string const& @@ -971,7 +971,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultClFlagTable; + return (table != nullptr) ? table : this->DefaultClFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable() @@ -980,7 +980,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable() cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultCSharpFlagTable; + return (table != nullptr) ? table : this->DefaultCSharpFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const @@ -988,7 +988,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultRcFlagTable; + return (table != nullptr) ? table : this->DefaultRcFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const @@ -996,7 +996,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultLibFlagTable; + return (table != nullptr) ? table : this->DefaultLibFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const @@ -1004,7 +1004,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultLinkFlagTable; + return (table != nullptr) ? table : this->DefaultLinkFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaFlagTable() const @@ -1023,7 +1023,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable( this->GetPlatformName(), this->GetPlatformToolsetString()); - return (table != CM_NULLPTR) ? table : this->DefaultMasmFlagTable; + return (table != nullptr) ? table : this->DefaultMasmFlagTable; } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetNasmFlagTable() const diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index aeceb8d..624f9e5 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -202,7 +202,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( i != configs.end(); ++i) { const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" + cmSystemTools::UpperCase(*i)); - if (dstConfig == CM_NULLPTR) { + if (dstConfig == nullptr) { dstConfig = i->c_str(); } fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << dstConfig diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index ed1ef1b..728ad2d 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -356,7 +356,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( i != configs.end(); ++i) { const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" + cmSystemTools::UpperCase(*i)); - if (dstConfig == CM_NULLPTR) { + if (dstConfig == nullptr) { dstConfig = i->c_str(); } fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a2be883..9dbb173 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -193,7 +193,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator( if (version_number < 30) { cm->IssueMessage(cmake::FATAL_ERROR, "Xcode " + version_string + " not supported."); - return CM_NULLPTR; + return nullptr; } CM_AUTO_PTR<cmGlobalXCodeGenerator> gg( @@ -3598,7 +3598,7 @@ bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation( std::string* reason) const { if (this->ObjectDirArch.find('$') != std::string::npos) { - if (reason != CM_NULLPTR) { + if (reason != nullptr) { *reason = " under Xcode with multiple architectures"; } return false; diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 015f887..daf8bb0 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -150,7 +150,7 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName) for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == CM_NULLPTR) { + if (ptrIt->second == nullptr) { continue; } @@ -194,7 +194,7 @@ void cmGraphVizWriter::WritePerTargetFiles(const char* fileName) for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == CM_NULLPTR) { + if (ptrIt->second == nullptr) { continue; } @@ -240,7 +240,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName) for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt = this->TargetPtrs.begin(); ptrIt != this->TargetPtrs.end(); ++ptrIt) { - if (ptrIt->second == CM_NULLPTR) { + if (ptrIt->second == nullptr) { continue; } @@ -279,7 +279,7 @@ void cmGraphVizWriter::WriteConnections( this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - if (targetPtrIt->second == CM_NULLPTR) // it's an external library + if (targetPtrIt->second == nullptr) // it's an external library { return; } @@ -330,7 +330,7 @@ void cmGraphVizWriter::WriteDependerConnections( this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - if (targetPtrIt->second == CM_NULLPTR) // it's an external library + if (targetPtrIt->second == nullptr) // it's an external library { return; } @@ -341,7 +341,7 @@ void cmGraphVizWriter::WriteDependerConnections( for (std::map<std::string, const cmGeneratorTarget*>::const_iterator dependerIt = this->TargetPtrs.begin(); dependerIt != this->TargetPtrs.end(); ++dependerIt) { - if (dependerIt->second == CM_NULLPTR) { + if (dependerIt->second == nullptr) { continue; } @@ -471,7 +471,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); - this->TargetPtrs[libName] = CM_NULLPTR; + this->TargetPtrs[libName] = nullptr; // str << " \"" << ostr << "\" [ label=\"" << libName // << "\" shape=\"ellipse\"];" << std::endl; } diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index 78dceb7..057a7bb 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -22,7 +22,7 @@ static bool cm_IsHexChar(char c) static unsigned int ChompStrlen(const char* line) { - if (line == CM_NULLPTR) { + if (line == nullptr) { return 0; } unsigned int length = static_cast<unsigned int>(strlen(line)); @@ -139,7 +139,7 @@ cmHexFileConverter::FileType cmHexFileConverter::DetermineFileType( { char buf[1024]; FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb"); - if (inFile == CM_NULLPTR) { + if (inFile == nullptr) { return Binary; } @@ -188,11 +188,11 @@ bool cmHexFileConverter::TryConvert(const char* inFileName, // try to open the file FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb"); FILE* outFile = cmsys::SystemTools::Fopen(outFileName, "wb"); - if ((inFile == CM_NULLPTR) || (outFile == CM_NULLPTR)) { - if (inFile != CM_NULLPTR) { + if ((inFile == nullptr) || (outFile == nullptr)) { + if (inFile != nullptr) { fclose(inFile); } - if (outFile != CM_NULLPTR) { + if (outFile != nullptr) { fclose(outFile); } return false; @@ -201,7 +201,7 @@ bool cmHexFileConverter::TryConvert(const char* inFileName, // convert them line by line bool success = false; char buf[1024]; - while (fgets(buf, 1024, inFile) != CM_NULLPTR) { + while (fgets(buf, 1024, inFile) != nullptr) { if (type == MotorolaSrec) { success = ConvertMotorolaSrecLine(buf, outFile); } else if (type == IntelHex) { diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 12e0c9a..cd4d850 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -78,7 +78,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args, cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator(); if (gg->IsExportedTargetsFile(fname_abs)) { - const char* modal = CM_NULLPTR; + const char* modal = nullptr; std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 294fb17..7402105 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -204,7 +204,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmCommandArgumentsHelper argHelper; cmCommandArgumentGroup group; - cmCAStringVector genericArgVector(&argHelper, CM_NULLPTR); + cmCAStringVector genericArgVector(&argHelper, nullptr); cmCAStringVector archiveArgVector(&argHelper, "ARCHIVE", &group); cmCAStringVector libraryArgVector(&argHelper, "LIBRARY", &group); cmCAStringVector runtimeArgVector(&argHelper, "RUNTIME", &group); @@ -216,10 +216,10 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) &group); cmCAStringVector publicHeaderArgVector(&argHelper, "PUBLIC_HEADER", &group); cmCAStringVector resourceArgVector(&argHelper, "RESOURCE", &group); - genericArgVector.Follows(CM_NULLPTR); + genericArgVector.Follows(nullptr); group.Follows(&genericArgVector); - argHelper.Parse(&args, CM_NULLPTR); + argHelper.Parse(&args, nullptr); // now parse the generic args (i.e. the ones not specialized on LIBRARY/ // ARCHIVE, RUNTIME etc. (see above) @@ -229,7 +229,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmCAStringVector targetList(&genericArgs.Parser, "TARGETS"); cmCAString exports(&genericArgs.Parser, "EXPORT", &genericArgs.ArgumentGroup); - targetList.Follows(CM_NULLPTR); + targetList.Follows(nullptr); genericArgs.ArgumentGroup.Follows(&targetList); genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs); bool success = genericArgs.Finalize(); @@ -402,15 +402,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) ti != targets.end(); ++ti) { // Handle each target type. cmTarget& target = *(*ti); - cmInstallTargetGenerator* archiveGenerator = CM_NULLPTR; - cmInstallTargetGenerator* libraryGenerator = CM_NULLPTR; - cmInstallTargetGenerator* runtimeGenerator = CM_NULLPTR; - cmInstallTargetGenerator* objectGenerator = CM_NULLPTR; - cmInstallTargetGenerator* frameworkGenerator = CM_NULLPTR; - cmInstallTargetGenerator* bundleGenerator = CM_NULLPTR; - cmInstallFilesGenerator* privateHeaderGenerator = CM_NULLPTR; - cmInstallFilesGenerator* publicHeaderGenerator = CM_NULLPTR; - cmInstallFilesGenerator* resourceGenerator = CM_NULLPTR; + cmInstallTargetGenerator* archiveGenerator = nullptr; + cmInstallTargetGenerator* libraryGenerator = nullptr; + cmInstallTargetGenerator* runtimeGenerator = nullptr; + cmInstallTargetGenerator* objectGenerator = nullptr; + cmInstallTargetGenerator* frameworkGenerator = nullptr; + cmInstallTargetGenerator* bundleGenerator = nullptr; + cmInstallFilesGenerator* privateHeaderGenerator = nullptr; + cmInstallFilesGenerator* publicHeaderGenerator = nullptr; + cmInstallFilesGenerator* resourceGenerator = nullptr; // Track whether this is a namelink-only rule. bool namelinkOnly = false; @@ -437,8 +437,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) runtimeGenerator = CreateInstallTargetGenerator(target, runtimeArgs, false); } - if ((archiveGenerator == CM_NULLPTR) && - (runtimeGenerator == CM_NULLPTR)) { + if ((archiveGenerator == nullptr) && (runtimeGenerator == nullptr)) { this->SetError("Library TARGETS given no DESTINATION!"); return false; } @@ -688,16 +687,16 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) } // Keep track of whether we're installing anything in each category - installsArchive = installsArchive || archiveGenerator != CM_NULLPTR; - installsLibrary = installsLibrary || libraryGenerator != CM_NULLPTR; - installsRuntime = installsRuntime || runtimeGenerator != CM_NULLPTR; - installsObject = installsObject || objectGenerator != CM_NULLPTR; - installsFramework = installsFramework || frameworkGenerator != CM_NULLPTR; - installsBundle = installsBundle || bundleGenerator != CM_NULLPTR; + installsArchive = installsArchive || archiveGenerator != nullptr; + installsLibrary = installsLibrary || libraryGenerator != nullptr; + installsRuntime = installsRuntime || runtimeGenerator != nullptr; + installsObject = installsObject || objectGenerator != nullptr; + installsFramework = installsFramework || frameworkGenerator != nullptr; + installsBundle = installsBundle || bundleGenerator != nullptr; installsPrivateHeader = - installsPrivateHeader || privateHeaderGenerator != CM_NULLPTR; + installsPrivateHeader || privateHeaderGenerator != nullptr; installsPublicHeader = - installsPublicHeader || publicHeaderGenerator != CM_NULLPTR; + installsPublicHeader || publicHeaderGenerator != nullptr; installsResource = installsResource || resourceGenerator; this->Makefile->AddInstallGenerator(archiveGenerator); @@ -779,7 +778,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args) bool programs = (args[0] == "PROGRAMS"); cmInstallCommandArguments ica(this->DefaultComponentName); cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES"); - files.Follows(CM_NULLPTR); + files.Follows(nullptr); ica.ArgumentGroup.Follows(&files); std::vector<std::string> unknownArgs; ica.Parse(&args, &unknownArgs); @@ -819,7 +818,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args) for (std::vector<std::string>::const_iterator fileIt = filesVector.begin(); fileIt != filesVector.end(); ++fileIt) { if (gg->IsExportedTargetsFile(*fileIt)) { - const char* modal = CM_NULLPTR; + const char* modal = nullptr; std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; @@ -895,7 +894,7 @@ bool cmInstallCommand::HandleDirectoryMode( bool exclude_from_all = false; bool message_never = false; std::vector<std::string> dirs; - const char* destination = CM_NULLPTR; + const char* destination = nullptr; std::string permissions_file; std::string permissions_dir; std::vector<std::string> configurations; @@ -1181,7 +1180,7 @@ bool cmInstallCommand::HandleExportAndroidMKMode( cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES", &ica.ArgumentGroup); cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup); - exp.Follows(CM_NULLPTR); + exp.Follows(nullptr); ica.ArgumentGroup.Follows(&exp); std::vector<std::string> unknownArgs; @@ -1273,7 +1272,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args) cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES", &ica.ArgumentGroup); cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup); - exp.Follows(CM_NULLPTR); + exp.Follows(nullptr); ica.ArgumentGroup.Follows(&exp); std::vector<std::string> unknownArgs; diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index b73414d..94c2e83 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -10,7 +10,7 @@ const char* cmInstallCommandArguments::PermissionsTable[] = { "OWNER_READ", "OWNER_WRITE", "OWNER_EXECUTE", "GROUP_READ", "GROUP_WRITE", "GROUP_EXECUTE", "WORLD_READ", "WORLD_WRITE", - "WORLD_EXECUTE", "SETUID", "SETGID", CM_NULLPTR + "WORLD_EXECUTE", "SETUID", "SETGID", nullptr }; const std::string cmInstallCommandArguments::EmptyString; @@ -28,7 +28,7 @@ cmInstallCommandArguments::cmInstallCommandArguments( , Optional(&Parser, "OPTIONAL", &ArgumentGroup) , NamelinkOnly(&Parser, "NAMELINK_ONLY", &ArgumentGroup) , NamelinkSkip(&Parser, "NAMELINK_SKIP", &ArgumentGroup) - , GenericArguments(CM_NULLPTR) + , GenericArguments(nullptr) , DefaultComponentName(defaultComponent) { } @@ -38,7 +38,7 @@ const std::string& cmInstallCommandArguments::GetDestination() const if (!this->DestinationString.empty()) { return this->DestinationString; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetDestination(); } return this->EmptyString; @@ -49,7 +49,7 @@ const std::string& cmInstallCommandArguments::GetComponent() const if (!this->Component.GetString().empty()) { return this->Component.GetString(); } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetComponent(); } if (!this->DefaultComponentName.empty()) { @@ -64,7 +64,7 @@ const std::string& cmInstallCommandArguments::GetRename() const if (!this->Rename.GetString().empty()) { return this->Rename.GetString(); } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetRename(); } return this->EmptyString; @@ -75,7 +75,7 @@ const std::string& cmInstallCommandArguments::GetPermissions() const if (!this->PermissionsString.empty()) { return this->PermissionsString; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetPermissions(); } return this->EmptyString; @@ -86,7 +86,7 @@ bool cmInstallCommandArguments::GetOptional() const if (this->Optional.IsEnabled()) { return true; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetOptional(); } return false; @@ -97,7 +97,7 @@ bool cmInstallCommandArguments::GetExcludeFromAll() const if (this->ExcludeFromAll.IsEnabled()) { return true; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetExcludeFromAll(); } return false; @@ -108,7 +108,7 @@ bool cmInstallCommandArguments::GetNamelinkOnly() const if (this->NamelinkOnly.IsEnabled()) { return true; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetNamelinkOnly(); } return false; @@ -119,7 +119,7 @@ bool cmInstallCommandArguments::GetNamelinkSkip() const if (this->NamelinkSkip.IsEnabled()) { return true; } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetNamelinkSkip(); } return false; @@ -131,7 +131,7 @@ const std::vector<std::string>& cmInstallCommandArguments::GetConfigurations() if (!this->Configurations.GetVector().empty()) { return this->Configurations.GetVector(); } - if (this->GenericArguments != CM_NULLPTR) { + if (this->GenericArguments != nullptr) { return this->GenericArguments->GetConfigurations(); } return this->Configurations.GetVector(); diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 54ad85c..1ca9893 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -17,7 +17,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( bool optional) : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) - , LocalGenerator(CM_NULLPTR) + , LocalGenerator(nullptr) , Directories(dirs) , FilePermissions(file_permissions) , DirPermissions(dir_permissions) @@ -86,7 +86,7 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule( std::vector<std::string> const& dirs) { // Write code to install the directories. - const char* no_rename = CM_NULLPTR; + const char* no_rename = nullptr; this->AddInstallRule(os, this->GetDestination(config), cmInstallType_DIRECTORY, dirs, this->Optional, this->FilePermissions.c_str(), diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx index 8eeaa9c..dd85b88 100644 --- a/Source/cmInstallExportAndroidMKGenerator.cxx +++ b/Source/cmInstallExportAndroidMKGenerator.cxx @@ -95,8 +95,8 @@ void cmInstallExportAndroidMKGenerator::GenerateScriptConfigs( std::string config_test = this->CreateConfigTest(i->first); os << indent << "if(" << config_test << ")\n"; this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), CM_NULLPTR, - CM_NULLPTR, CM_NULLPTR, indent.Next()); + false, this->FilePermissions.c_str(), nullptr, + nullptr, nullptr, indent.Next()); os << indent << "endif()\n"; files.clear(); } @@ -135,6 +135,6 @@ void cmInstallExportAndroidMKGenerator::GenerateScriptActions( std::vector<std::string> files; files.push_back(this->MainImportFile); this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), CM_NULLPTR, - CM_NULLPTR, CM_NULLPTR, indent); + false, this->FilePermissions.c_str(), nullptr, nullptr, + nullptr, indent); } diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index b176e85..ec1b210 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -29,7 +29,7 @@ cmInstallExportGenerator::cmInstallExportGenerator( , FileName(filename) , Namespace(name_space) , ExportOld(exportOld) - , LocalGenerator(CM_NULLPTR) + , LocalGenerator(nullptr) { if (android) { #ifdef CMAKE_BUILD_WITH_CMAKE @@ -181,8 +181,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, std::string config_test = this->CreateConfigTest(i->first); os << indent << "if(" << config_test << ")\n"; this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), CM_NULLPTR, - CM_NULLPTR, CM_NULLPTR, indent.Next()); + false, this->FilePermissions.c_str(), nullptr, + nullptr, nullptr, indent.Next()); os << indent << "endif()\n"; files.clear(); } @@ -221,6 +221,6 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os, std::vector<std::string> files; files.push_back(this->MainImportFile); this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), CM_NULLPTR, - CM_NULLPTR, CM_NULLPTR, indent); + false, this->FilePermissions.c_str(), nullptr, nullptr, + nullptr, indent); } diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 6323a91..4fcff4f 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -16,7 +16,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( const char* rename, bool optional) : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) - , LocalGenerator(CM_NULLPTR) + , LocalGenerator(nullptr) , Files(files) , FilePermissions(file_permissions) , Rename(rename) @@ -58,12 +58,12 @@ void cmInstallFilesGenerator::AddFilesInstallRule( std::vector<std::string> const& files) { // Write code to install the files. - const char* no_dir_permissions = CM_NULLPTR; + const char* no_dir_permissions = nullptr; this->AddInstallRule( os, this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, this->Optional, this->FilePermissions.c_str(), no_dir_permissions, - this->Rename.c_str(), CM_NULLPTR, indent); + this->Rename.c_str(), nullptr, indent); } void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index 8f8701f..a2130d1 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -41,9 +41,9 @@ public: void AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector<std::string> const& files, bool optional = false, - const char* permissions_file = CM_NULLPTR, - const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR, - const char* literal_args = CM_NULLPTR, Indent indent = Indent()); + const char* permissions_file = nullptr, + const char* permissions_dir = nullptr, const char* rename = nullptr, + const char* literal_args = nullptr, Indent indent = Indent()); /** Get the install destination as it should appear in the installation script. */ diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index b39a622..f7e6e44 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -11,7 +11,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, bool code, const char* component, bool exclude_from_all) - : cmInstallGenerator(CM_NULLPTR, std::vector<std::string>(), component, + : cmInstallGenerator(nullptr, std::vector<std::string>(), component, MessageDefault, exclude_from_all) , Script(script) , Code(code) diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 84d6f7a..2b15aeb 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -28,7 +28,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator( : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) , TargetName(targetName) - , Target(CM_NULLPTR) + , Target(nullptr) , FilePermissions(file_permissions) , ImportLibrary(implib) , Optional(optional) @@ -312,8 +312,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( &cmInstallTargetGenerator::PreReplacementTweaks); // Write code to install the target file. - const char* no_dir_permissions = CM_NULLPTR; - const char* no_rename = CM_NULLPTR; + const char* no_dir_permissions = nullptr; + const char* no_rename = nullptr; bool optional = this->Optional || this->ImportLibrary; this->AddInstallRule(os, this->GetDestination(config), type, filesFrom, optional, this->FilePermissions.c_str(), @@ -351,8 +351,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfigObjectLibrary( std::string const obj_dir = this->Target->GetObjectDirectory(config); std::string const literal_args = " FILES_FROM_DIR \"" + obj_dir + "\""; - const char* no_dir_permissions = CM_NULLPTR; - const char* no_rename = CM_NULLPTR; + const char* no_dir_permissions = nullptr; + const char* no_rename = nullptr; this->AddInstallRule(os, dest, cmInstallType_FILES, objects, this->Optional, this->FilePermissions.c_str(), no_dir_permissions, no_rename, literal_args.c_str(), indent); diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index d51fd8d..4430b3a 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -11,7 +11,7 @@ #include <utility> cmInstalledFile::cmInstalledFile() - : NameExpression(CM_NULLPTR) + : NameExpression(nullptr) { } diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index f0fded2..85bd449 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -24,7 +24,7 @@ class cmLinkItem : public std::string public: cmLinkItem() : std_string() - , Target(CM_NULLPTR) + , Target(nullptr) { } cmLinkItem(const std_string& n, cmGeneratorTarget const* t) @@ -105,7 +105,7 @@ struct cmOptionalLinkInterface : public cmLinkInterface , AllDone(false) , Exists(false) , HadHeadSensitiveCondition(false) - , ExplicitLibraries(CM_NULLPTR) + , ExplicitLibraries(nullptr) { } bool LibrariesDone; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 55592cb..2a8bb5a 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -49,7 +49,7 @@ public: public: iterator() - : Tree(CM_NULLPTR) + : Tree(nullptr) , Position(0) { } diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 0c73cd7..69c4e0d 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -82,7 +82,7 @@ bool cmListFileParser::ParseFile() } if (bom == cmListFileLexer_BOM_Broken) { - cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR); + cmListFileLexer_SetFileName(this->Lexer, nullptr, nullptr); this->IssueFileOpenError("Error while reading Byte-Order-Mark. " "File not seekable?"); return false; @@ -90,7 +90,7 @@ bool cmListFileParser::ParseFile() // Verify the Byte-Order-Mark, if any. if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) { - cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR); + cmListFileLexer_SetFileName(this->Lexer, nullptr, nullptr); this->IssueFileOpenError( "File starts with a Byte-Order-Mark that is not UTF-8."); return false; @@ -330,13 +330,13 @@ cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom, cmListFileBacktrace::cmListFileBacktrace() : Bottom() - , Cur(CM_NULLPTR) + , Cur(nullptr) { } cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& snapshot) : Bottom(snapshot.GetCallStackBottom()) - , Cur(CM_NULLPTR) + , Cur(nullptr) { } diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 92a32a1..f533c97 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -63,7 +63,7 @@ public: void FinalPass() CM_OVERRIDE; bool HasFinalPass() const CM_OVERRIDE { - return this->info.FinalPass != CM_NULLPTR; + return this->info.FinalPass != nullptr; } static const char* LastName; @@ -86,11 +86,11 @@ public: #endif signal(SIGILL, TrapsForSignalsCFunction); } else { - signal(SIGSEGV, CM_NULLPTR); + signal(SIGSEGV, nullptr); #ifdef SIGBUS - signal(SIGBUS, CM_NULLPTR); + signal(SIGBUS, nullptr); #endif - signal(SIGILL, CM_NULLPTR); + signal(SIGILL, nullptr); } } @@ -102,7 +102,7 @@ extern "C" void TrapsForSignalsCFunction(int sig) cmLoadedCommand::TrapsForSignals(sig); } -const char* cmLoadedCommand::LastName = CM_NULLPTR; +const char* cmLoadedCommand::LastName = nullptr; bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) @@ -118,7 +118,7 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args, // create argc and argv and then invoke the command int argc = static_cast<int>(args.size()); - char** argv = CM_NULLPTR; + char** argv = nullptr; if (argc) { argv = (char**)malloc(argc * sizeof(char*)); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2c8157e..6e0e28c 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -401,7 +401,7 @@ void cmLocalGenerator::GenerateInstallRules() // Choose a default install configuration. std::string default_config = config; const char* default_order[] = { "RELEASE", "MINSIZEREL", "RELWITHDEBINFO", - "DEBUG", CM_NULLPTR }; + "DEBUG", nullptr }; for (const char** c = default_order; *c && default_config.empty(); ++c) { for (std::vector<std::string>::iterator i = configurationTypes.begin(); i != configurationTypes.end(); ++i) { @@ -588,7 +588,7 @@ cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( if (ti != this->GeneratorTargetSearchIndex.end()) { return ti->second; } - return CM_NULLPTR; + return nullptr; } void cmLocalGenerator::ComputeTargetManifest() @@ -708,7 +708,7 @@ std::string cmLocalGenerator::GetIncludeFlags( // normal flag is repeated for each directory. std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_"; sysFlagVar += lang; - const char* sysIncludeFlag = CM_NULLPTR; + const char* sysIncludeFlag = nullptr; if (repeatFlag) { sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar); } @@ -1346,7 +1346,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, target->GetAppleArchs(config, archs); const char* sysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); if (sysroot && sysroot[0] == '/' && !sysroot[1]) { - sysroot = CM_NULLPTR; + sysroot = nullptr; } std::string sysrootFlagVar = std::string("CMAKE_") + lang + "_SYSROOT_FLAG"; @@ -1743,7 +1743,7 @@ void cmLocalGenerator::AddVisibilityPresetFlags( } std::string warnCMP0063; - std::string* pWarnCMP0063 = CM_NULLPTR; + std::string* pWarnCMP0063 = nullptr; if (target->GetType() != cmStateEnums::SHARED_LIBRARY && target->GetType() != cmStateEnums::MODULE_LIBRARY && !target->IsExecutableWithExports()) { @@ -1854,7 +1854,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags, std::string const& lang, int targetType) { - const char* picFlags = CM_NULLPTR; + const char* picFlags = nullptr; if (targetType == cmStateEnums::EXECUTABLE) { std::string flagsVar = "CMAKE_"; @@ -1937,7 +1937,7 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags, const std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_IPO"; const char* rawFlagsList = this->Makefile->GetDefinition(name); - if (rawFlagsList == CM_NULLPTR) { + if (rawFlagsList == nullptr) { return; } @@ -2067,7 +2067,7 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature, } snp = snp.GetBuildsystemDirectoryParent(); } - return CM_NULLPTR; + return nullptr; } std::string cmLocalGenerator::GetProjectName() const @@ -2131,7 +2131,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( // Include the user-specified pre-install script for this target. if (const char* preinstall = (*l)->GetProperty("PRE_INSTALL_SCRIPT")) { - cmInstallScriptGenerator g(preinstall, false, CM_NULLPTR, false); + cmInstallScriptGenerator g(preinstall, false, nullptr, false); g.Generate(os, config, configurationTypes); } @@ -2184,7 +2184,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( // Include the user-specified post-install script for this target. if (const char* postinstall = (*l)->GetProperty("POST_INSTALL_SCRIPT")) { - cmInstallScriptGenerator g(postinstall, false, CM_NULLPTR, false); + cmInstallScriptGenerator g(postinstall, false, nullptr, false); g.Generate(os, config, configurationTypes); } } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index aaf7d71..85eac0b 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -283,8 +283,8 @@ public: // Compute object file names. std::string GetObjectFileNameWithoutTarget( const cmSourceFile& source, std::string const& dir_max, - bool* hasSourceExtension = CM_NULLPTR, - char const* customOutputExtension = CM_NULLPTR); + bool* hasSourceExtension = nullptr, + char const* customOutputExtension = nullptr); /** Fill out the static linker flags for the given target. */ void GetStaticLibraryFlags(std::string& flags, std::string const& config, @@ -312,7 +312,7 @@ public: virtual void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, - cmGeneratorTarget const* gt = CM_NULLPTR); + cmGeneratorTarget const* gt = nullptr); bool IsWindowsShell() const; bool IsWatcomWMake() const; diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index a45e018..f69c530 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -76,7 +76,7 @@ public: void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, - cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE; + cmGeneratorTarget const* gt = nullptr) CM_OVERRIDE; protected: std::string ConvertToIncludeReference( diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 2d10021..cde2621 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -348,7 +348,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule( std::vector<std::string> depends; depends.push_back(output); std::vector<std::string> no_commands; - this->WriteMakeRule(ruleFileStream, CM_NULLPTR, outNoExt, depends, + this->WriteMakeRule(ruleFileStream, nullptr, outNoExt, depends, no_commands, true, true); inHelp = false; } @@ -718,7 +718,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop( // Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make. std::vector<std::string> depends; depends.push_back(".hpux_make_needs_suffix_list"); - this->WriteMakeRule(makefileStream, CM_NULLPTR, ".SUFFIXES", depends, + this->WriteMakeRule(makefileStream, nullptr, ".SUFFIXES", depends, no_commands, false); if (this->IsWatcomWMake()) { // Switch on WMake feature, if an error or interrupt occurs during @@ -1186,7 +1186,7 @@ void cmLocalUnixMakefileGenerator3::AppendEcho( line = ""; // Progress appears only on first line. - progress = CM_NULLPTR; + progress = nullptr; // Terminate on end-of-string. if (*c == '\0') { @@ -1460,7 +1460,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( std::string lang = *li; // Create the scanner for this language - cmDepends* scanner = CM_NULLPTR; + cmDepends* scanner = nullptr; if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM" || lang == "CUDA") { // TODO: Handle RC (resource files) dependencies correctly. diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index f64409c..f7b4666 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -108,8 +108,7 @@ public: std::string Arg; }; void AppendEcho(std::vector<std::string>& commands, std::string const& text, - EchoColor color = EchoNormal, - EchoProgress const* = CM_NULLPTR); + EchoColor color = EchoNormal, EchoProgress const* = nullptr); /** Get whether the makefile is to have color. */ bool GetColorMakefile() const { return this->ColorMakefile; } @@ -238,11 +237,11 @@ protected: cmGeneratorTarget* target, std::string const& relative, bool echo_comment = false, - std::ostream* content = CM_NULLPTR); + std::ostream* content = nullptr); void AppendCleanCommand(std::vector<std::string>& commands, const std::vector<std::string>& files, cmGeneratorTarget* target, - const char* filename = CM_NULLPTR); + const char* filename = nullptr); // Helper methods for dependeny updates. bool ScanDependencies( @@ -255,7 +254,7 @@ private: void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, - cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE; + cmGeneratorTarget const* gt = nullptr) CM_OVERRIDE; friend class cmMakefileTargetGenerator; friend class cmMakefileExecutableTargetGenerator; @@ -272,7 +271,7 @@ private: cmGeneratorTarget* Target; std::string Language; LocalObjectEntry() - : Target(CM_NULLPTR) + : Target(nullptr) , Language() { } diff --git a/Source/cmLocale.h b/Source/cmLocale.h index 9f90a3a..8185883 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -14,7 +14,7 @@ class cmLocaleRAII public: cmLocaleRAII() - : OldLocale(setlocale(LC_CTYPE, CM_NULLPTR)) + : OldLocale(setlocale(LC_CTYPE, nullptr)) { setlocale(LC_CTYPE, ""); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 29999e9..230c210 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -779,7 +779,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( // Make sure there is at least one output. if (outputs.empty()) { cmSystemTools::Error("Attempt to add a custom rule with no output!"); - return CM_NULLPTR; + return nullptr; } // Validate custom commands. TODO: More strict? @@ -790,12 +790,12 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( std::ostringstream e; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; this->IssueMessage(cmake::FATAL_ERROR, e.str()); - return CM_NULLPTR; + return nullptr; } } // Choose a source file on which to store the custom command. - cmSourceFile* file = CM_NULLPTR; + cmSourceFile* file = nullptr; if (!commandLines.empty() && !main_dependency.empty()) { // The main dependency was specified. Use it unless a different // custom command already used it. @@ -809,7 +809,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( } // The existing custom command is different. We need to // generate a rule file for this new command. - file = CM_NULLPTR; + file = nullptr; } else if (!file) { file = this->CreateSource(main_dependency); } @@ -933,7 +933,7 @@ void cmMakefile::AddCustomCommandOldStyle( std::vector<std::string> no_byproducts; this->AddCustomCommandToTarget(target, no_byproducts, depends, commandLines, cmTarget::POST_BUILD, comment, - CM_NULLPTR); + nullptr); return; } @@ -951,14 +951,14 @@ void cmMakefile::AddCustomCommandOldStyle( if (sourceFiles.find(source)) { // The source looks like a real file. Use it as the main dependency. sf = this->AddCustomCommandToOutput(output, depends, source, - commandLines, comment, CM_NULLPTR); + commandLines, comment, nullptr); } else { // The source may not be a real file. Do not use a main dependency. std::string no_main_dependency; std::vector<std::string> depends2 = depends; depends2.push_back(source); sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency, - commandLines, comment, CM_NULLPTR); + commandLines, comment, nullptr); } // If the rule was added to the source (and not a .rule file), @@ -1759,7 +1759,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) cmVariableWatch* vv = this->GetVariableWatch(); if (vv) { vv->VariableAccessed(name, cmVariableWatch::VARIABLE_REMOVED_ACCESS, - CM_NULLPTR, this); + nullptr, this); } #endif } @@ -1910,7 +1910,7 @@ cmSourceFile* cmMakefile::LinearGetSourceFileWithOutput( } // otherwise return NULL - return CM_NULLPTR; + return nullptr; } cmSourceFile* cmMakefile::GetSourceFileWithOutput( @@ -1926,14 +1926,14 @@ cmSourceFile* cmMakefile::GetSourceFileWithOutput( if (o != this->OutputToSource.end()) { return (*o).second; } - return CM_NULLPTR; + return nullptr; } #if defined(CMAKE_BUILD_WITH_CMAKE) cmSourceGroup* cmMakefile::GetSourceGroup( const std::vector<std::string>& name) const { - cmSourceGroup* sg = CM_NULLPTR; + cmSourceGroup* sg = nullptr; // first look for source group starting with the same as the one we want for (std::vector<cmSourceGroup>::const_iterator sgIt = @@ -1946,11 +1946,11 @@ cmSourceGroup* cmMakefile::GetSourceGroup( } } - if (sg != CM_NULLPTR) { + if (sg != nullptr) { // iterate through its children to find match source group for (unsigned int i = 1; i < name.size(); ++i) { sg = sg->LookupChild(name[i].c_str()); - if (sg == CM_NULLPTR) { + if (sg == nullptr) { break; } } @@ -1968,14 +1968,14 @@ void cmMakefile::AddSourceGroup(const std::string& name, const char* regex) void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, const char* regex) { - cmSourceGroup* sg = CM_NULLPTR; + cmSourceGroup* sg = nullptr; std::vector<std::string> currentName; int i = 0; const int lastElement = static_cast<int>(name.size() - 1); for (i = lastElement; i >= 0; --i) { currentName.assign(name.begin(), name.begin() + i + 1); sg = this->GetSourceGroup(currentName); - if (sg != CM_NULLPTR) { + if (sg != nullptr) { break; } } @@ -2003,8 +2003,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, } // build the whole source group path for (++i; i <= lastElement; ++i) { - sg->AddChild( - cmSourceGroup(name[i].c_str(), CM_NULLPTR, sg->GetFullName())); + sg->AddChild(cmSourceGroup(name[i].c_str(), nullptr, sg->GetFullName())); sg = sg->LookupChild(name[i].c_str()); } @@ -2254,7 +2253,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const } } #endif - return def != CM_NULLPTR; + return def != nullptr; } const char* cmMakefile::GetDefinition(const std::string& name) const @@ -2563,7 +2562,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.pop_back(); result.append(last, in - last); std::string const& lookup = result.substr(var.loc); - const char* value = CM_NULLPTR; + const char* value = nullptr; std::string varresult; std::string svalue; static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE"; @@ -2619,7 +2618,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( if (!atOnly) { t_lookup lookup; const char* next = in + 1; - const char* start = CM_NULLPTR; + const char* start = nullptr; char nextc = *next; if (nextc == '{') { // Looking for a variable. @@ -3103,7 +3102,7 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const return sf; } } - return CM_NULLPTR; + return nullptr; } cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName, @@ -3304,7 +3303,7 @@ cmVariableWatch* cmMakefile::GetVariableWatch() const this->GetCMakeInstance()->GetVariableWatch()) { return this->GetCMakeInstance()->GetVariableWatch(); } - return CM_NULLPTR; + return nullptr; } #endif @@ -3469,7 +3468,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } // Perform variable replacements. - this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, CM_NULLPTR, + this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, nullptr, -1, true, true); } @@ -3609,7 +3608,7 @@ cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const if (i != this->Targets.end()) { return &i->second; } - return CM_NULLPTR; + return nullptr; } cmTest* cmMakefile::CreateTest(const std::string& testName) @@ -3631,7 +3630,7 @@ cmTest* cmMakefile::GetTest(const std::string& testName) const if (mi != this->Tests.end()) { return mi->second; } - return CM_NULLPTR; + return nullptr; } void cmMakefile::AddCMakeDependFilesFromUser() @@ -4089,10 +4088,10 @@ bool cmMakefile::IgnoreErrorsCMP0061() const } #define FEATURE_STRING(F) , #F -static const char* const C_FEATURES[] = { CM_NULLPTR FOR_EACH_C_FEATURE( +static const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE( FEATURE_STRING) }; -static const char* const CXX_FEATURES[] = { CM_NULLPTR FOR_EACH_CXX_FEATURE( +static const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE( FEATURE_STRING) }; #undef FEATURE_STRING @@ -4200,7 +4199,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang, this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); } - return CM_NULLPTR; + return nullptr; } const char* featuresKnown = @@ -4223,7 +4222,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang, this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); } - return CM_NULLPTR; + return nullptr; } return featuresKnown; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 059a4e7..46abc7d 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -187,24 +187,26 @@ public: * Add a utility to the build. A utiltity target is a command that * is run every time the target is built. */ - cmTarget* AddUtilityCommand( - const std::string& utilityName, bool excludeFromAll, - const std::vector<std::string>& depends, const char* workingDirectory, - const char* command, const char* arg1 = CM_NULLPTR, - const char* arg2 = CM_NULLPTR, const char* arg3 = CM_NULLPTR, - const char* arg4 = CM_NULLPTR); + cmTarget* AddUtilityCommand(const std::string& utilityName, + bool excludeFromAll, + const std::vector<std::string>& depends, + const char* workingDirectory, + const char* command, const char* arg1 = nullptr, + const char* arg2 = nullptr, + const char* arg3 = nullptr, + const char* arg4 = nullptr); cmTarget* AddUtilityCommand( const std::string& utilityName, bool excludeFromAll, const char* workingDirectory, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, - const char* comment = CM_NULLPTR, bool uses_terminal = false, + const char* comment = nullptr, bool uses_terminal = false, bool command_expand_lists = false); cmTarget* AddUtilityCommand( const std::string& utilityName, bool excludeFromAll, const char* workingDirectory, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, - const char* comment = CM_NULLPTR, bool uses_terminal = false, + const char* comment = nullptr, bool uses_terminal = false, bool command_expand_lists = false); /** @@ -272,14 +274,14 @@ public: /** * Add a root source group for consideration when adding a new source. */ - void AddSourceGroup(const std::string& name, const char* regex = CM_NULLPTR); + void AddSourceGroup(const std::string& name, const char* regex = nullptr); /** * Add a source group for consideration when adding a new source. * name is tokenized. */ void AddSourceGroup(const std::vector<std::string>& name, - const char* regex = CM_NULLPTR); + const char* regex = nullptr); #endif @@ -521,7 +523,7 @@ public: const char* ExpandVariablesInString(std::string& source) const; const char* ExpandVariablesInString(std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly = false, - const char* filename = CM_NULLPTR, + const char* filename = nullptr, long line = -1, bool removeEmpty = false, bool replaceAt = false) const; @@ -594,11 +596,11 @@ public: */ bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs, std::vector<std::string>& outArgs, - const char* filename = CM_NULLPTR) const; + const char* filename = nullptr) const; bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs, std::vector<cmExpandedCommandArgument>& outArgs, - const char* filename = CM_NULLPTR) const; + const char* filename = nullptr) const; /** * Get the instance @@ -744,7 +746,7 @@ public: bool PolicyOptionalWarningEnabled(std::string const& var); bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature, - std::string* error = CM_NULLPTR) const; + std::string* error = nullptr) const; bool CompileFeatureKnown(cmTarget const* target, const std::string& feature, std::string& lang, std::string* error) const; @@ -915,11 +917,11 @@ private: cmSourceFile* source); bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature, - std::string* error = CM_NULLPTR) const; + std::string* error = nullptr) const; bool AddRequiredTargetCxxFeature(cmTarget* target, const std::string& feature, - std::string* error = CM_NULLPTR) const; + std::string* error = nullptr) const; void CheckNeededCLanguage(const std::string& feature, bool& needC90, bool& needC99, bool& needC11) const; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 359b9fd..b9b3c2f 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -284,7 +284,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( commands1.clear(); // Write the build rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, targetOutputReal, depends, commands, false); @@ -687,7 +687,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } // Write the build rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, targetFullPathReal, depends, commands, false); @@ -698,7 +698,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) depends.clear(); commands.clear(); depends.push_back(targetFullPathReal); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, targetFullPath, depends, commands, false); } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 3d1594b..2faef67 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -117,7 +117,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() this->AppendObjectDepends(depends); // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, this->GeneratorTarget->GetName(), depends, commands, true); @@ -454,7 +454,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules( std::vector<std::string> outputs(1, targetOutputReal); // Write the build rule. - this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends, + this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends, commands, false); // Write the main driver rule to build everything in this target. @@ -1008,7 +1008,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Write the build rule. - this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends, + this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends, commands, false); // Write the main driver rule to build everything in this target. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 7938683..b9bcdef 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -32,12 +32,12 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) - , OSXBundleGenerator(CM_NULLPTR) - , MacOSXContentGenerator(CM_NULLPTR) + , OSXBundleGenerator(nullptr) + , MacOSXContentGenerator(nullptr) { - this->BuildFileStream = CM_NULLPTR; - this->InfoFileStream = CM_NULLPTR; - this->FlagFileStream = CM_NULLPTR; + this->BuildFileStream = nullptr; + this->InfoFileStream = nullptr; + this->FlagFileStream = nullptr; this->CustomCommandDriver = OnBuild; this->LocalGenerator = static_cast<cmLocalUnixMakefileGenerator3*>(target->GetLocalGenerator()); @@ -60,7 +60,7 @@ cmMakefileTargetGenerator::~cmMakefileTargetGenerator() cmMakefileTargetGenerator* cmMakefileTargetGenerator::New( cmGeneratorTarget* tgt) { - cmMakefileTargetGenerator* result = CM_NULLPTR; + cmMakefileTargetGenerator* result = nullptr; switch (tgt->GetType()) { case cmStateEnums::EXECUTABLE: @@ -139,7 +139,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() cmSystemTools::ExpandListArgument( cge->Evaluate(this->LocalGenerator, config, false, this->GeneratorTarget, - CM_NULLPTR, CM_NULLPTR), + nullptr, nullptr), this->CleanFiles); } @@ -337,7 +337,7 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()( output, cmOutputConverter::SHELL); commands.push_back(copyCommand); this->Generator->LocalGenerator->WriteMakeRule( - *this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands, + *this->Generator->BuildFileStream, nullptr, output, depends, commands, false); this->Generator->ExtraFiles.insert(output); } @@ -711,7 +711,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( } // Write the rule. - this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends, + this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends, commands); bool do_preprocess_rules = lang_has_preprocessor && @@ -770,7 +770,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( commands.push_back(cmd); } - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, relativeObjI, force_depends, commands, false); } @@ -818,7 +818,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( commands.push_back(cmd); } - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, relativeObjS, force_depends, commands, false); } @@ -830,7 +830,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( objectRequires += ".requires"; std::vector<std::string> p_depends; // always provide an empty requires target - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, objectRequires, p_depends, no_commands, true); @@ -848,14 +848,14 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( p_depends.clear(); p_depends.push_back(objectRequires); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, objectProvides, p_depends, r_commands, true); // write the provides.build rule dependency on the obj file p_depends.clear(); p_depends.push_back(relativeObj); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, temp, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, temp, p_depends, no_commands, false); } @@ -881,7 +881,7 @@ void cmMakefileTargetGenerator::WriteTargetRequiresRules() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, depTarget, depends, no_commands, true); } @@ -903,7 +903,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() this->LocalGenerator->GetBinaryDirectory()); // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, cleanTarget, depends, commands, true); } @@ -960,7 +960,7 @@ bool cmMakefileTargetGenerator::WriteMakeRule( if (!o_symbolic) { output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out); } - this->LocalGenerator->WriteMakeRule(os, CM_NULLPTR, *o, output_depends, + this->LocalGenerator->WriteMakeRule(os, nullptr, *o, output_depends, output_commands, o_symbolic, in_help); if (!o_symbolic) { @@ -1107,7 +1107,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, depTarget, depends, commands, true); } @@ -1170,8 +1170,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile( // Write the rule. const std::vector<std::string>& outputs = ccg.GetOutputs(); - bool symbolic = this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, - outputs, depends, commands); + bool symbolic = this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, + depends, commands); // If the rule has changed make sure the output is rebuilt. if (!symbolic) { @@ -1342,7 +1342,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule( std::vector<std::string> depends; depends.push_back(main_output); - const char* comment = CM_NULLPTR; + const char* comment = nullptr; if (relink) { // Setup the comment for the preinstall driver. comment = "Rule to relink during preinstall."; diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index a7c5d27..46df0d8 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -95,7 +95,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() } // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, this->GeneratorTarget->GetName(), depends, commands, true); diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 14fd96f..45c59b9 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -34,7 +34,7 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args, cmState* state = this->Makefile->GetState(); if (!state->GetCacheEntryValue(variable)) { this->Makefile->GetCMakeInstance()->AddCacheEntry( - variable, CM_NULLPTR, CM_NULLPTR, cmStateEnums::UNINITIALIZED); + variable, nullptr, nullptr, cmStateEnums::UNINITIALIZED); overwrite = true; } if (!state->GetCacheEntryValue(variable)) { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1e0bf8d..f029a3f 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -142,7 +142,7 @@ const char* cmNinjaNormalTargetGenerator::GetVisibleTypeName() const case cmStateEnums::EXECUTABLE: return "executable"; default: - return CM_NULLPTR; + return nullptr; } } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4b16dc7..4a4e5b2 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -47,14 +47,14 @@ cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) return new cmNinjaUtilityTargetGenerator(target); default: - return CM_NULLPTR; + return nullptr; } } cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) - , MacOSXContentGenerator(CM_NULLPTR) - , OSXBundleGenerator(CM_NULLPTR) + , MacOSXContentGenerator(nullptr) + , OSXBundleGenerator(nullptr) , MacContentFolders() , LocalGenerator( static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())) diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index beddc6e..c3d049b 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -21,7 +21,7 @@ cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target, , Makefile(target->Target->GetMakefile()) , LocalGenerator(target->GetLocalGenerator()) , ConfigName(configName) - , MacContentFolders(CM_NULLPTR) + , MacContentFolders(nullptr) { if (this->MustSkip()) { return; diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 3a0637a..61c7a03 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -26,7 +26,7 @@ public: const char* purpose); ~cmOrderDirectories(); void AddRuntimeLibrary(std::string const& fullPath, - const char* soname = CM_NULLPTR); + const char* soname = nullptr); void AddLinkLibrary(std::string const& fullPath); void AddUserDirectories(std::vector<std::string> const& extra); void AddLanguageDirectories(std::vector<std::string> const& dirs); diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 93d2c14..2fd266a 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -31,7 +31,7 @@ public: */ cmDependInformation() : DependDone(false) - , SourceFile(CM_NULLPTR) + , SourceFile(nullptr) { } @@ -157,7 +157,7 @@ public: */ const cmDependInformation* FindDependencies(const char* file) { - cmDependInformation* info = this->GetDependInformation(file, CM_NULLPTR); + cmDependInformation* info = this->GetDependInformation(file, nullptr); this->GenerateDependInformation(info); return info; } @@ -202,7 +202,7 @@ protected: message += includeFile; message += " for file "; message += info->FullPath; - cmSystemTools::Error(message.c_str(), CM_NULLPTR); + cmSystemTools::Error(message.c_str(), nullptr); } continue; } @@ -328,7 +328,7 @@ protected: // See if the cmSourceFile for it has any files specified as // dependency hints. - if (info->SourceFile != CM_NULLPTR) { + if (info->SourceFile != nullptr) { // Get the cmSourceFile corresponding to this. const cmSourceFile& cFile = *(info->SourceFile); diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx index cc82438..dd9174c 100644 --- a/Source/cmPipeConnection.cxx +++ b/Source/cmPipeConnection.cxx @@ -30,7 +30,7 @@ void cmPipeConnection::Connect(uv_stream_t* server) auto client = reinterpret_cast<uv_stream_t*>(this->ClientPipe); if (uv_accept(server, client) != 0) { uv_close(reinterpret_cast<uv_handle_t*>(client), &on_close_delete); - this->ClientPipe = CM_NULLPTR; + this->ClientPipe = nullptr; return; } this->ReadStream = client; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index da3edd4..76b8ba1 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -62,9 +62,9 @@ static const char* idToString(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return CM_NULLPTR; + return nullptr; } - return CM_NULLPTR; + return nullptr; } static const char* idToVersion(cmPolicies::PolicyID id) @@ -76,9 +76,9 @@ static const char* idToVersion(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID_VERSION(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return CM_NULLPTR; + return nullptr; } - return CM_NULLPTR; + return nullptr; } static bool isPolicyNewerThan(cmPolicies::PolicyID id, unsigned int majorV, @@ -108,9 +108,9 @@ const char* idToShortDescription(cmPolicies::PolicyID id) CM_FOR_EACH_POLICY_ID_DOC(POLICY_CASE) #undef POLICY_CASE case cmPolicies::CMPCOUNT: - return CM_NULLPTR; + return nullptr; } - return CM_NULLPTR; + return nullptr; } static void DiagnoseAncientPolicies( diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx index de7b061..67b4a97 100644 --- a/Source/cmProcessTools.cxx +++ b/Source/cmProcessTools.cxx @@ -10,22 +10,22 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, OutputParser* err, Encoding encoding) { cmsysProcess_Execute(cp); - char* data = CM_NULLPTR; + char* data = nullptr; int length = 0; int p; cmProcessOutput processOutput(encoding); std::string strdata; while ((out || err) && - (p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { + (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { if (out && p == cmsysProcess_Pipe_STDOUT) { processOutput.DecodeText(data, length, strdata, 1); if (!out->Process(strdata.c_str(), int(strdata.size()))) { - out = CM_NULLPTR; + out = nullptr; } } else if (err && p == cmsysProcess_Pipe_STDERR) { processOutput.DecodeText(data, length, strdata, 2); if (!err->Process(strdata.c_str(), int(strdata.size()))) { - err = CM_NULLPTR; + err = nullptr; } } } @@ -41,12 +41,12 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, out->Process(strdata.c_str(), int(strdata.size())); } } - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); } cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR) - : Log(CM_NULLPTR) - , Prefix(CM_NULLPTR) + : Log(nullptr) + , Prefix(nullptr) , Separator(sep) , LineEnd('\0') , IgnoreCR(ignoreCR) diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index e7d9a10..4119115 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -70,7 +70,7 @@ public: class OutputLogger : public LineParser { public: - OutputLogger(std::ostream& log, const char* prefix = CM_NULLPTR) + OutputLogger(std::ostream& log, const char* prefix = nullptr) { this->SetLog(&log, prefix); } @@ -81,7 +81,7 @@ public: /** Run a process and send output to given parsers. */ static void RunProcess(struct cmsysProcess_s* cp, OutputParser* out, - OutputParser* err = CM_NULLPTR, + OutputParser* err = nullptr, Encoding encoding = cmProcessOutput::Auto); }; diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx index 222afb4..4e2f470 100644 --- a/Source/cmProperty.cxx +++ b/Source/cmProperty.cxx @@ -24,5 +24,5 @@ const char* cmProperty::GetValue() const if (this->ValueHasBeenSet) { return this->Value.c_str(); } - return CM_NULLPTR; + return nullptr; } diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 1e089d1..34ce283 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -59,7 +59,7 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const cmPropertyMap::const_iterator it = this->find(name); if (it == this->end()) { - return CM_NULLPTR; + return nullptr; } return it->second.GetValue(); } diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index de9e545..ae1fdfa 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -78,7 +78,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args, depends.push_back(hname); std::string no_main_dependency; - const char* no_working_dir = CM_NULLPTR; + const char* no_working_dir = nullptr; this->Makefile->AddCustomCommandToOutput( newName, depends, no_main_dependency, commandLines, "Qt Wrapped File", no_working_dir); diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index d3c6631..3d586d6 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -109,8 +109,8 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args, std::vector<std::string> depends; depends.push_back(uiName); std::string no_main_dependency; - const char* no_comment = CM_NULLPTR; - const char* no_working_dir = CM_NULLPTR; + const char* no_comment = nullptr; + const char* no_working_dir = nullptr; this->Makefile->AddCustomCommandToOutput( hName, depends, no_main_dependency, hCommandLines, no_comment, no_working_dir); diff --git a/Source/cmQtAutoGeneratorCommon.cxx b/Source/cmQtAutoGeneratorCommon.cxx index 3e1b58c..a8e6b96 100644 --- a/Source/cmQtAutoGeneratorCommon.cxx +++ b/Source/cmQtAutoGeneratorCommon.cxx @@ -38,7 +38,7 @@ static bool RccListInputsQt4(const std::string& fileName, osst << ifs.rdbuf(); qrcContents = osst.str(); } else { - if (errorMessage != CM_NULLPTR) { + if (errorMessage != nullptr) { std::ostringstream ost; ost << "AutoRcc: Error: Rcc file not readable:\n" << cmQtAutoGeneratorCommon::Quoted(fileName) << "\n"; @@ -98,7 +98,7 @@ static bool RccListInputsQt5(const std::string& rccCommand, int retVal = 0; bool result = cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal, - CM_NULLPTR, cmSystemTools::OUTPUT_NONE); + nullptr, cmSystemTools::OUTPUT_NONE); if (result && retVal == 0 && rccStdOut.find("--list") != std::string::npos) { hasDashDashList = true; @@ -117,10 +117,10 @@ static bool RccListInputsQt5(const std::string& rccCommand, command.push_back(fileName); result = cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal, - CM_NULLPTR, cmSystemTools::OUTPUT_NONE); + nullptr, cmSystemTools::OUTPUT_NONE); } if (!result || retVal) { - if (errorMessage != CM_NULLPTR) { + if (errorMessage != nullptr) { std::ostringstream ost; ost << "AutoRcc: Error: Rcc list process for " << fileName << " failed:\n" @@ -153,7 +153,7 @@ static bool RccListInputsQt5(const std::string& rccCommand, std::string::size_type pos = eline.find(searchString); if (pos == std::string::npos) { - if (errorMessage != CM_NULLPTR) { + if (errorMessage != nullptr) { std::ostringstream ost; ost << "AutoRcc: Error: Rcc lists unparsable output:\n" << cmQtAutoGeneratorCommon::Quoted(eline) << "\n"; @@ -205,7 +205,7 @@ bool cmQtAutoGeneratorCommon::RccListInputs(const std::string& qtMajorVersion, allGood = RccListInputsQt5(rccCommand, fileName, files, errorMessage); } } else { - if (errorMessage != CM_NULLPTR) { + if (errorMessage != nullptr) { std::ostringstream ost; ost << "AutoRcc: Error: Rcc file does not exist:\n" << cmQtAutoGeneratorCommon::Quoted(fileName) << "\n"; diff --git a/Source/cmQtAutoGeneratorCommon.h b/Source/cmQtAutoGeneratorCommon.h index a131baf..b5ace1c 100644 --- a/Source/cmQtAutoGeneratorCommon.h +++ b/Source/cmQtAutoGeneratorCommon.h @@ -33,7 +33,7 @@ public: const std::string& rccCommand, const std::string& fileName, std::vector<std::string>& files, - std::string* errorMessage = CM_NULLPTR); + std::string* errorMessage = nullptr); }; #endif diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index a8e2bca..d943b8b 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -33,7 +33,7 @@ inline static const char* SafeString(const char* value) { - return (value != CM_NULLPTR) ? value : ""; + return (value != nullptr) ? value : ""; } static std::string GetSafeProperty(cmGeneratorTarget const* target, @@ -86,7 +86,7 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target) } const char* targetQtVersion = target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""); - if (targetQtVersion != CM_NULLPTR) { + if (targetQtVersion != nullptr) { qtMajorVersion = targetQtVersion; } return qtMajorVersion; @@ -106,7 +106,7 @@ static std::string GetQtMinorVersion(cmGeneratorTarget const* target, const char* targetQtVersion = target->GetLinkInterfaceDependentStringProperty("QT_MINOR_VERSION", ""); - if (targetQtVersion != CM_NULLPTR) { + if (targetQtVersion != nullptr) { qtMinorVersion = targetQtVersion; } return qtMinorVersion; @@ -148,12 +148,12 @@ static void GetCompileDefinitionsAndDirectories( } static std::vector<std::string> GetConfigurations( - cmMakefile* makefile, std::string* config = CM_NULLPTR) + cmMakefile* makefile, std::string* config = nullptr) { std::vector<std::string> configs; { std::string cfg = makefile->GetConfigurations(configs); - if (config != CM_NULLPTR) { + if (config != nullptr) { *config = cfg; } } @@ -204,10 +204,10 @@ static void AddDefinitionEscaped(cmMakefile* makefile, const char* key, static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName, cmQtAutoGeneratorCommon::GeneratorType genType) { - cmSourceGroup* sourceGroup = CM_NULLPTR; + cmSourceGroup* sourceGroup = nullptr; // Acquire source group { - const char* groupName = CM_NULLPTR; + const char* groupName = nullptr; // Use generator specific group name switch (genType) { case cmQtAutoGeneratorCommon::MOC: @@ -222,27 +222,27 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName, break; } // Use default group name on demand - if ((groupName == CM_NULLPTR) || (*groupName == 0)) { + if ((groupName == nullptr) || (*groupName == 0)) { groupName = makefile->GetState()->GetGlobalProperty("AUTOGEN_SOURCE_GROUP"); } // Generate a source group on demand - if ((groupName != CM_NULLPTR) && (*groupName != 0)) { + if ((groupName != nullptr) && (*groupName != 0)) { { const char* delimiter = makefile->GetDefinition("SOURCE_GROUP_DELIMITER"); - if (delimiter == CM_NULLPTR) { + if (delimiter == nullptr) { delimiter = "\\"; } std::vector<std::string> folders = cmSystemTools::tokenize(groupName, delimiter); sourceGroup = makefile->GetSourceGroup(folders); - if (sourceGroup == CM_NULLPTR) { + if (sourceGroup == nullptr) { makefile->AddSourceGroup(folders); sourceGroup = makefile->GetSourceGroup(folders); } } - if (sourceGroup == CM_NULLPTR) { + if (sourceGroup == nullptr) { cmSystemTools::Error( "Autogen: Could not create or find source group: ", cmQtAutoGeneratorCommon::Quoted(groupName).c_str()); @@ -250,7 +250,7 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName, } } } - if (sourceGroup != CM_NULLPTR) { + if (sourceGroup != nullptr) { sourceGroup->AddGroupFile(fileName); } return true; @@ -449,14 +449,14 @@ static void SetupAutoTargetMoc(cmGeneratorTarget const* target, if (qtMajorVersion == "5") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::moc"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { mocExec = SafeString(tgt->ImportedGetLocation("")); } else { err = "AUTOMOC: Qt5::moc target not found"; } } else if (qtMajorVersion == "4") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::moc"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { mocExec = SafeString(tgt->ImportedGetLocation("")); } else { err = "AUTOMOC: Qt4::moc target not found"; @@ -565,14 +565,14 @@ static void SetupAutoTargetUic(cmGeneratorTarget const* target, if (qtMajorVersion == "5") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::uic"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { uicExec = SafeString(tgt->ImportedGetLocation("")); } else { // Project does not use Qt5Widgets, but has AUTOUIC ON anyway } } else if (qtMajorVersion == "4") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::uic"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { uicExec = SafeString(tgt->ImportedGetLocation("")); } else { err = "AUTOUIC: Qt4::uic target not found"; @@ -599,14 +599,14 @@ static std::string RccGetExecutable(cmGeneratorTarget const* target, cmLocalGenerator* localGen = target->GetLocalGenerator(); if (qtMajorVersion == "5") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::rcc"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { rccExec = SafeString(tgt->ImportedGetLocation("")); } else { err = "AUTORCC: Qt5::rcc target not found"; } } else if (qtMajorVersion == "4") { cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::rcc"); - if (tgt != CM_NULLPTR) { + if (tgt != nullptr) { rccExec = SafeString(tgt->ImportedGetLocation("")); } else { err = "AUTORCC: Qt4::rcc target not found"; @@ -839,7 +839,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( for (std::set<std::string>::const_iterator it = utils.begin(); it != utils.end(); ++it) { const std::string& targetName = *it; - if (makefile->FindTargetToUse(targetName) != CM_NULLPTR) { + if (makefile->FindTargetToUse(targetName) != nullptr) { autogenDependsSet.insert(targetName); } } @@ -851,7 +851,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( for (cmTarget::LinkLibraryVectorType::const_iterator it = libVec.begin(); it != libVec.end(); ++it) { const std::string& libName = it->first; - if (makefile->FindTargetToUse(libName) != CM_NULLPTR) { + if (makefile->FindTargetToUse(libName) != nullptr) { autogenDependsSet.insert(libName); } } @@ -973,7 +973,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( for (std::vector<std::string>::const_iterator it = autogenDepends.begin(); it != autogenDepends.end(); ++it) { - if (makefile->FindTargetToUse(*it) != CM_NULLPTR) { + if (makefile->FindTargetToUse(*it) != nullptr) { usePRE_BUILD = false; break; } @@ -1004,15 +1004,15 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( { const char* autogenFolder = makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER"); - if (autogenFolder == CM_NULLPTR) { + if (autogenFolder == nullptr) { autogenFolder = makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER"); } // Inherit FOLDER property from target (#13688) - if (autogenFolder == CM_NULLPTR) { + if (autogenFolder == nullptr) { autogenFolder = target->Target->GetProperty("FOLDER"); } - if ((autogenFolder != CM_NULLPTR) && (*autogenFolder != '\0')) { + if ((autogenFolder != nullptr) && (*autogenFolder != '\0')) { autogenTarget->SetProperty("FOLDER", autogenFolder); } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 65ea048..db9afa3 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -81,7 +81,7 @@ static void InfoGet(cmMakefile* makefile, const char* key, static void InfoGetConfig(cmMakefile* makefile, const char* key, const std::string& config, std::string& value) { - const char* valueConf = CM_NULLPTR; + const char* valueConf = nullptr; { std::string keyConf = key; if (!config.empty()) { @@ -90,7 +90,7 @@ static void InfoGetConfig(cmMakefile* makefile, const char* key, } valueConf = makefile->GetDefinition(keyConf); } - if (valueConf == CM_NULLPTR) { + if (valueConf == nullptr) { valueConf = makefile->GetSafeDefinition(key); } value = valueConf; @@ -817,7 +817,7 @@ bool cmQtAutoGenerators::MocRequired(const std::string& contentText, if (contentText.find(filter.first) != std::string::npos) { if (filter.second.find(contentText)) { // Return macro name on demand - if (macroName != CM_NULLPTR) { + if (macroName != nullptr) { *macroName = filter.first; } return true; @@ -939,7 +939,7 @@ void cmQtAutoGenerators::UicParseContent( } const char* contentChars = contentText.c_str(); - if (strstr(contentChars, "ui_") != CM_NULLPTR) { + if (strstr(contentChars, "ui_") != nullptr) { while (this->UicRegExpInclude.find(contentChars)) { uisIncluded[absFilename].push_back(this->UicRegExpInclude.match(1)); contentChars += this->UicRegExpInclude.end(); @@ -973,7 +973,7 @@ bool cmQtAutoGenerators::MocParseSourceContent( // and if the string search already fails, we don't have to try the // expensive regexp const char* contentChars = contentText.c_str(); - if (strstr(contentChars, "moc") != CM_NULLPTR) { + if (strstr(contentChars, "moc") != nullptr) { // Iterate over all included moc files while (this->MocRegExpInclude.find(contentChars)) { const std::string incString = this->MocRegExpInclude.match(1); @@ -1741,13 +1741,13 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, readFiles, &error)) { files = &readFiles; } else { - files = CM_NULLPTR; + files = nullptr; this->LogError(error); this->RccRunFailed = true; } } // Test if any input file is newer than the build file - if (files != CM_NULLPTR) { + if (files != nullptr) { for (std::vector<std::string>::const_iterator it = files->begin(); it != files->end(); ++it) { if (FileAbsentOrOlder(rccBuildFile, *it)) { @@ -2043,7 +2043,7 @@ bool cmQtAutoGenerators::RunCommand(const std::vector<std::string>& command, // Execute command int retVal = 0; bool res = cmSystemTools::RunSingleCommand( - command, &output, &output, &retVal, CM_NULLPTR, + command, &output, &output, &retVal, nullptr, verbose ? cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE); return (res && (retVal == 0)); } diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index ce5db4a..a8eb961 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -59,7 +59,7 @@ private: // -- Content analysis bool MocRequired(const std::string& contentText, - std::string* macroName = CM_NULLPTR); + std::string* macroName = nullptr); void MocFindDepends( const std::string& absFilename, const std::string& contentText, std::map<std::string, std::set<std::string> >& mocDepends); diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index 753a1ba..768e15a 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -10,7 +10,7 @@ cmScriptGenerator::cmScriptGenerator( : RuntimeConfigVariable(config_var) , Configurations(configurations) , ConfigurationName("") - , ConfigurationTypes(CM_NULLPTR) + , ConfigurationTypes(nullptr) , ActionsPerConfig(false) { } @@ -27,7 +27,7 @@ void cmScriptGenerator::Generate( this->ConfigurationTypes = &configurationTypes; this->GenerateScript(os); this->ConfigurationName = ""; - this->ConfigurationTypes = CM_NULLPTR; + this->ConfigurationTypes = nullptr; } static void cmScriptGeneratorEncodeConfig(const std::string& config, diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 0df6e0c..0f2ef6e 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -42,7 +42,7 @@ void cmSearchPath::AddPath(const std::string& path) void cmSearchPath::AddUserPath(const std::string& path) { - assert(this->FC != CM_NULLPTR); + assert(this->FC != nullptr); std::vector<std::string> outPaths; @@ -77,7 +77,7 @@ void cmSearchPath::AddUserPath(const std::string& path) void cmSearchPath::AddCMakePath(const std::string& variable) { - assert(this->FC != CM_NULLPTR); + assert(this->FC != nullptr); // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { @@ -104,7 +104,7 @@ void cmSearchPath::AddEnvPath(const std::string& variable) void cmSearchPath::AddCMakePrefixPath(const std::string& variable) { - assert(this->FC != CM_NULLPTR); + assert(this->FC != nullptr); // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { @@ -168,7 +168,7 @@ void cmSearchPath::AddSuffixes(const std::vector<std::string>& suffixes) void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, const char* base) { - assert(this->FC != CM_NULLPTR); + assert(this->FC != nullptr); // default for programs std::string subdir = "bin"; @@ -209,7 +209,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, void cmSearchPath::AddPathInternal(const std::string& path, const char* base) { - assert(this->FC != CM_NULLPTR); + assert(this->FC != nullptr); std::string collapsed = cmSystemTools::CollapseFullPath(path, base); diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 932022a..8f56669 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -23,7 +23,7 @@ public: // cmSearchPath must be initialized from a valid pointer. The only reason // for the default is to allow it to be easily used in stl containers. // Attempting to initialize with a NULL value will fail an assertion - cmSearchPath(cmFindCommon* findCmd = CM_NULLPTR); + cmSearchPath(cmFindCommon* findCmd = nullptr); ~cmSearchPath(); const std::vector<std::string>& GetPaths() const { return this->Paths; } @@ -42,8 +42,8 @@ public: protected: void AddPrefixPaths(const std::vector<std::string>& paths, - const char* base = CM_NULLPTR); - void AddPathInternal(const std::string& path, const char* base = CM_NULLPTR); + const char* base = nullptr); + void AddPathInternal(const std::string& path, const char* base = nullptr); cmFindCommon* FC; std::vector<std::string> Paths; diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index ccb9af6..04810c6 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -219,7 +219,7 @@ cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request) std::string errorMessage; if (!this->Protocol->Activate(this, request, &errorMessage)) { - this->Protocol = CM_NULLPTR; + this->Protocol = nullptr; return request.ReportError("Failed to activate protocol version: " + errorMessage); } @@ -484,7 +484,7 @@ void cmServerBase::StartShutDown() uv_stop(&Loop); - uv_walk(&Loop, on_walk_to_shutdown, CM_NULLPTR); + uv_walk(&Loop, on_walk_to_shutdown, nullptr); uv_run(&Loop, UV_RUN_DEFAULT); } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 2063c82..cb5e6ae 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -223,7 +223,7 @@ bool cmServerProtocol::Activate(cmServer* server, this->m_CMakeInstance = std::make_unique<cmake>(cmake::RoleProject); const bool result = this->DoActivate(request, errorMessage); if (!result) { - this->m_CMakeInstance = CM_NULLPTR; + this->m_CMakeInstance = nullptr; } return result; } diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 820e7f6..b32cda3 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -61,7 +61,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args, // SET (VAR PARENT_SCOPE) // Removes the definition of VAR // in the parent scope. if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") { - this->Makefile->RaiseScope(variable, CM_NULLPTR); + this->Makefile->RaiseScope(variable, nullptr); return true; } @@ -75,8 +75,8 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args, bool force = false; // optional bool parentScope = false; cmStateEnums::CacheEntryType type = - cmStateEnums::STRING; // required if cache - const char* docstring = CM_NULLPTR; // required if cache + cmStateEnums::STRING; // required if cache + const char* docstring = nullptr; // required if cache unsigned int ignoreLastArgs = 0; // look for PARENT_SCOPE argument diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index b57f62a..338fcea 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -141,7 +141,7 @@ bool cmSetPropertyCommand::HandleGlobalMode() std::string const& name = this->PropertyName; const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = CM_NULLPTR; + value = nullptr; } if (this->AppendMode) { cm->AppendProperty(name, value ? value : "", this->AppendAsString); @@ -191,7 +191,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode() std::string const& name = this->PropertyName; const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = CM_NULLPTR; + value = nullptr; } if (this->AppendMode) { mf->AppendProperty(name, value ? value : "", this->AppendAsString); @@ -232,7 +232,7 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target) std::string const& name = this->PropertyName; const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = CM_NULLPTR; + value = nullptr; } if (this->AppendMode) { target->AppendProperty(name, value, this->AppendAsString); @@ -271,7 +271,7 @@ bool cmSetPropertyCommand::HandleSource(cmSourceFile* sf) std::string const& name = this->PropertyName; const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = CM_NULLPTR; + value = nullptr; } if (this->AppendMode) { @@ -319,7 +319,7 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test) std::string const& name = this->PropertyName; const char* value = this->PropertyValue.c_str(); if (this->Remove) { - value = CM_NULLPTR; + value = nullptr; } if (this->AppendMode) { test->AppendProperty(name, value, this->AppendAsString); diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 7eace26..d2e83a6 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -52,8 +52,8 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args, // try to find the hostname for this computer if (!cmSystemTools::IsOff(hostname_cmd.c_str())) { std::string host; - cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, CM_NULLPTR, - CM_NULLPTR, CM_NULLPTR, + cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, nullptr, + nullptr, nullptr, cmSystemTools::OUTPUT_NONE); // got the hostname diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index baf95c5..912f773 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -15,13 +15,13 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { - this->CustomCommand = CM_NULLPTR; + this->CustomCommand = nullptr; this->FindFullPathFailed = false; } cmSourceFile::~cmSourceFile() { - this->SetCustomCommand(CM_NULLPTR); + this->SetCustomCommand(nullptr); } std::string const& cmSourceFile::GetExtension() const @@ -129,7 +129,7 @@ bool cmSourceFile::FindFullPath(std::string* error) // The file is not generated. It must exist on disk. cmMakefile const* mf = this->Location.GetMakefile(); - const char* tryDirs[3] = { CM_NULLPTR, CM_NULLPTR, CM_NULLPTR }; + const char* tryDirs[3] = { nullptr, nullptr, nullptr }; if (this->Location.DirectoryIsAmbiguous()) { tryDirs[0] = mf->GetCurrentSourceDirectory(); tryDirs[1] = mf->GetCurrentBinaryDirectory(); @@ -281,7 +281,7 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const // Check for computed properties. if (prop == "LOCATION") { if (this->FullPath.empty()) { - return CM_NULLPTR; + return nullptr; } return this->FullPath.c_str(); } diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 91f783d..c92afdc 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -57,7 +57,7 @@ public: * horrible interface, but is necessary for backwards * compatibility). */ - std::string const& GetFullPath(std::string* error = CM_NULLPTR); + std::string const& GetFullPath(std::string* error = nullptr); std::string const& GetFullPath() const; /** diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 86711d7..7d81ff2 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -15,7 +15,7 @@ #include <vector> cmSourceFileLocation::cmSourceFileLocation() - : Makefile(CM_NULLPTR) + : Makefile(nullptr) , AmbiguousDirectory(true) , AmbiguousExtension(true) { diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index 104e959..fba4c31 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -114,7 +114,7 @@ cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const } // if no child with this name was found return NULL - return CM_NULLPTR; + return nullptr; } cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) @@ -134,7 +134,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) return result; } } - return CM_NULLPTR; + return nullptr; } cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name) @@ -155,7 +155,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name) return this; } - return CM_NULLPTR; + return nullptr; } std::vector<cmSourceGroup> const& cmSourceGroup::GetGroupChildren() const diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 97affed..c4206e3 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -27,7 +27,7 @@ class cmSourceGroup { public: cmSourceGroup(const char* name, const char* regex, - const char* parentName = CM_NULLPTR); + const char* parentName = nullptr); cmSourceGroup(cmSourceGroup const& r); ~cmSourceGroup(); cmSourceGroup& operator=(cmSourceGroup const&); diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index a966300..77fde7b 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -71,7 +71,7 @@ cmSourceGroup* addSourceGroup(const std::vector<std::string>& tokenizedPath, makefile.AddSourceGroup(tokenizedPath); sg = makefile.GetSourceGroup(tokenizedPath); if (!sg) { - return CM_NULLPTR; + return nullptr; } } @@ -166,7 +166,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args, std::vector<std::string> folders = cmSystemTools::tokenize(args[0], delimiter); - cmSourceGroup* sg = CM_NULLPTR; + cmSourceGroup* sg = nullptr; sg = this->Makefile->GetSourceGroup(folders); if (!sg) { this->Makefile->AddSourceGroup(folders); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 92e47f7..c325b88 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -63,12 +63,12 @@ const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType) return "UNKNOWN_LIBRARY"; } assert(false && "Unexpected target type"); - return CM_NULLPTR; + return nullptr; } const char* cmCacheEntryTypes[] = { "BOOL", "PATH", "FILEPATH", "STRING", "INTERNAL", "STATIC", - "UNINITIALIZED", CM_NULLPTR }; + "UNINITIALIZED", nullptr }; const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type) { @@ -132,7 +132,7 @@ const char* cmState::GetCacheEntryValue(std::string const& key) const { cmCacheManager::CacheEntry* e = this->CacheManager->GetCacheEntry(key); if (!e) { - return CM_NULLPTR; + return nullptr; } return e->Value.c_str(); } @@ -188,7 +188,7 @@ const char* cmState::GetCacheEntryProperty(std::string const& key, cmCacheManager::CacheIterator it = this->CacheManager->GetCacheIterator(key.c_str()); if (!it.PropertyExists(propertyName)) { - return CM_NULLPTR; + return nullptr; } return it.GetProperty(propertyName); } @@ -224,7 +224,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, std::string const& propertyName) { this->CacheManager->GetCacheIterator(key.c_str()) - .SetProperty(propertyName, (void*)CM_NULLPTR); + .SetProperty(propertyName, (void*)nullptr); } cmStateSnapshot cmState::Reset() @@ -303,7 +303,7 @@ cmPropertyDefinition const* cmState::GetPropertyDefinition( this->PropertyDefinitions.find(scope)->second; return &defs.find(name)->second; } - return CM_NULLPTR; + return nullptr; } bool cmState::IsPropertyDefined(const std::string& name, @@ -436,7 +436,7 @@ cmCommand* cmState::GetCommand(std::string const& name) const if (pos != this->BuiltinCommands.end()) { return pos->second; } - return CM_NULLPTR; + return nullptr; } std::vector<std::string> cmState::GetCommandNames() const diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 77413c7..bdef3e5 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -220,7 +220,7 @@ void cmStateSnapshot::SetDefinition(std::string const& name, void cmStateSnapshot::RemoveDefinition(std::string const& name) { - this->Position->Vars->Set(name, CM_NULLPTR); + this->Position->Vars->Set(name, nullptr); } std::vector<std::string> cmStateSnapshot::UnusedKeys() const diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 6293803..94d6274 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -19,7 +19,7 @@ class cmStateDirectory; class cmStateSnapshot { public: - cmStateSnapshot(cmState* state = CM_NULLPTR); + cmStateSnapshot(cmState* state = nullptr); cmStateSnapshot(cmState* state, cmStateDetail::PositionType position); const char* GetDefinition(std::string const& name) const; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 9f214c3..b9c118f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -654,7 +654,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command, a != command.end(); ++a) { argv.push_back(a->c_str()); } - argv.push_back(CM_NULLPTR); + argv.push_back(nullptr); cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetCommand(cp, &*argv.begin()); @@ -666,12 +666,12 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command, if (outputflag == OUTPUT_PASSTHROUGH) { cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1); cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1); - captureStdOut = CM_NULLPTR; - captureStdErr = CM_NULLPTR; + captureStdOut = nullptr; + captureStdErr = nullptr; } else if (outputflag == OUTPUT_MERGE || (captureStdErr && captureStdErr == captureStdOut)) { cmsysProcess_SetOption(cp, cmsysProcess_Option_MergeOutput, 1); - captureStdErr = CM_NULLPTR; + captureStdErr = nullptr; } assert(!captureStdErr || captureStdErr != captureStdOut); @@ -687,7 +687,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command, std::string strdata; if (outputflag != OUTPUT_PASSTHROUGH && (captureStdOut || captureStdErr || outputflag != OUTPUT_NONE)) { - while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) > + while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) > 0) { // Translate NULL characters in the output into valid text. for (int i = 0; i < length; ++i) { @@ -727,7 +727,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command, } } - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); if (captureStdOut) { captureStdOut->assign(tempStdOut.begin(), tempStdOut.end()); @@ -1518,7 +1518,7 @@ void list_item_verbose(FILE* out, struct archive_entry* entry) /* Use uname if it's present, else uid. */ p = archive_entry_uname(entry); - if ((p == CM_NULLPTR) || (*p == '\0')) { + if ((p == nullptr) || (*p == '\0')) { sprintf(tmp, "%lu ", (unsigned long)archive_entry_uid(entry)); p = tmp; } @@ -1529,7 +1529,7 @@ void list_item_verbose(FILE* out, struct archive_entry* entry) fprintf(out, "%-*s ", (int)u_width, p); /* Use gname if it's present, else gid. */ p = archive_entry_gname(entry); - if (p != CM_NULLPTR && p[0] != '\0') { + if (p != nullptr && p[0] != '\0') { fprintf(out, "%s", p); w = strlen(p); } else { @@ -1971,7 +1971,7 @@ unsigned int cmSystemTools::RandomSeed() // Try using a real random source. cmsys::ifstream fin; - fin.rdbuf()->pubsetbuf(CM_NULLPTR, 0); // Unbuffered read. + fin.rdbuf()->pubsetbuf(nullptr, 0); // Unbuffered read. fin.open("/dev/urandom"); if (fin.good() && fin.read(seed.bytes, sizeof(seed)) && fin.gcount() == sizeof(seed)) { @@ -1980,7 +1980,7 @@ unsigned int cmSystemTools::RandomSeed() // Fall back to the time and pid. struct timeval t; - gettimeofday(&t, CM_NULLPTR); + gettimeofday(&t, nullptr); unsigned int pid = static_cast<unsigned int>(getpid()); unsigned int tv_sec = static_cast<unsigned int>(t.tv_sec); unsigned int tv_usec = static_cast<unsigned int>(t.tv_usec); @@ -2296,8 +2296,8 @@ bool cmSystemTools::ChangeRPath(std::string const& file, // Get the RPATH and RUNPATH entries from it. int se_count = 0; - cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR }; - const char* se_name[2] = { CM_NULLPTR, CM_NULLPTR }; + cmELF::StringEntry const* se[2] = { nullptr, nullptr }; + const char* se_name[2] = { nullptr, nullptr }; if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) { se[se_count] = se_rpath; se_name[se_count] = "RPATH"; @@ -2610,7 +2610,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg, // Get the RPATH and RUNPATH entries from it and sort them by index // in the dynamic section header. int se_count = 0; - cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR }; + cmELF::StringEntry const* se[2] = { nullptr, nullptr }; if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) { se[se_count++] = se_rpath; } diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index e163c91..a116aa1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -62,34 +62,34 @@ public: * set to false, will disable furthur messages (cancel). */ static void SetMessageCallback(MessageCallback f, - void* clientData = CM_NULLPTR); + void* clientData = nullptr); /** * Display an error message. */ - static void Error(const char* m, const char* m2 = CM_NULLPTR, - const char* m3 = CM_NULLPTR, const char* m4 = CM_NULLPTR); + static void Error(const char* m, const char* m2 = nullptr, + const char* m3 = nullptr, const char* m4 = nullptr); /** * Display a message. */ - static void Message(const char* m, const char* title = CM_NULLPTR); + static void Message(const char* m, const char* title = nullptr); typedef void (*OutputCallback)(const char*, size_t length, void*); ///! Send a string to stdout static void Stdout(const char* s); static void Stdout(const char* s, size_t length); - static void SetStdoutCallback(OutputCallback, void* clientData = CM_NULLPTR); + static void SetStdoutCallback(OutputCallback, void* clientData = nullptr); ///! Send a string to stderr static void Stderr(const char* s); static void Stderr(const char* s, size_t length); - static void SetStderrCallback(OutputCallback, void* clientData = CM_NULLPTR); + static void SetStderrCallback(OutputCallback, void* clientData = nullptr); typedef bool (*InterruptCallback)(void*); static void SetInterruptCallback(InterruptCallback f, - void* clientData = CM_NULLPTR); + void* clientData = nullptr); static bool GetInterruptFlag(); ///! Return true if there was an error at any point. @@ -220,10 +220,10 @@ public: OUTPUT_PASSTHROUGH }; static bool RunSingleCommand(const char* command, - std::string* captureStdOut = CM_NULLPTR, - std::string* captureStdErr = CM_NULLPTR, - int* retVal = CM_NULLPTR, - const char* dir = CM_NULLPTR, + std::string* captureStdOut = nullptr, + std::string* captureStdErr = nullptr, + int* retVal = nullptr, + const char* dir = nullptr, OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0); /** @@ -232,10 +232,10 @@ public: * be in comand[1]...command[command.size()] */ static bool RunSingleCommand(std::vector<std::string> const& command, - std::string* captureStdOut = CM_NULLPTR, - std::string* captureStdErr = CM_NULLPTR, - int* retVal = CM_NULLPTR, - const char* dir = CM_NULLPTR, + std::string* captureStdOut = nullptr, + std::string* captureStdErr = nullptr, + int* retVal = nullptr, + const char* dir = nullptr, OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0, Encoding encoding = cmProcessOutput::Auto); @@ -463,13 +463,12 @@ public: /** Try to set the RPATH in an ELF binary. */ static bool ChangeRPath(std::string const& file, std::string const& oldRPath, std::string const& newRPath, - std::string* emsg = CM_NULLPTR, - bool* changed = CM_NULLPTR); + std::string* emsg = nullptr, + bool* changed = nullptr); /** Try to remove the RPATH from an ELF binary. */ - static bool RemoveRPath(std::string const& file, - std::string* emsg = CM_NULLPTR, - bool* removed = CM_NULLPTR); + static bool RemoveRPath(std::string const& file, std::string* emsg = nullptr, + bool* removed = nullptr); /** Check whether the RPATH in an ELF binary contains the path given. */ diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a116ea3..d4a0bf5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -75,7 +75,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>( { cmStringRange entries = tgt->GetSourceEntries(); if (entries.empty()) { - return CM_NULLPTR; + return nullptr; } std::ostringstream ss; @@ -211,79 +211,79 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // Setup default property values. if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - this->SetPropertyDefault("ANDROID_API", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_API_MIN", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_ARCH", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_STL_TYPE", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_PROCESS_MAX", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_PROGUARD", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", CM_NULLPTR); - this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", CM_NULLPTR); - this->SetPropertyDefault("BUILD_RPATH", CM_NULLPTR); - this->SetPropertyDefault("INSTALL_NAME_DIR", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_API", nullptr); + this->SetPropertyDefault("ANDROID_API_MIN", nullptr); + this->SetPropertyDefault("ANDROID_ARCH", nullptr); + this->SetPropertyDefault("ANDROID_STL_TYPE", nullptr); + this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", nullptr); + this->SetPropertyDefault("ANDROID_PROCESS_MAX", nullptr); + this->SetPropertyDefault("ANDROID_PROGUARD", nullptr); + this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", nullptr); + this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", nullptr); + this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", nullptr); + this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", nullptr); + this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", nullptr); + this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", nullptr); + this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", nullptr); + this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", nullptr); + this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", nullptr); + this->SetPropertyDefault("BUILD_RPATH", nullptr); + this->SetPropertyDefault("INSTALL_NAME_DIR", nullptr); this->SetPropertyDefault("INSTALL_RPATH", ""); this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF"); - this->SetPropertyDefault("INTERPROCEDURAL_OPTIMIZATION", CM_NULLPTR); + this->SetPropertyDefault("INTERPROCEDURAL_OPTIMIZATION", nullptr); this->SetPropertyDefault("SKIP_BUILD_RPATH", "OFF"); this->SetPropertyDefault("BUILD_WITH_INSTALL_RPATH", "OFF"); - this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("Fortran_FORMAT", CM_NULLPTR); - this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", CM_NULLPTR); - this->SetPropertyDefault("GNUtoMS", CM_NULLPTR); - this->SetPropertyDefault("OSX_ARCHITECTURES", CM_NULLPTR); - this->SetPropertyDefault("IOS_INSTALL_COMBINED", CM_NULLPTR); - this->SetPropertyDefault("AUTOMOC", CM_NULLPTR); - this->SetPropertyDefault("AUTOUIC", CM_NULLPTR); - this->SetPropertyDefault("AUTORCC", CM_NULLPTR); - this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", CM_NULLPTR); - this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", CM_NULLPTR); - this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", CM_NULLPTR); - this->SetPropertyDefault("AUTOUIC_OPTIONS", CM_NULLPTR); - this->SetPropertyDefault("AUTOUIC_SEARCH_PATHS", CM_NULLPTR); - this->SetPropertyDefault("AUTORCC_OPTIONS", CM_NULLPTR); - this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", CM_NULLPTR); - this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", CM_NULLPTR); - this->SetPropertyDefault("WIN32_EXECUTABLE", CM_NULLPTR); - this->SetPropertyDefault("MACOSX_BUNDLE", CM_NULLPTR); - this->SetPropertyDefault("MACOSX_RPATH", CM_NULLPTR); - this->SetPropertyDefault("BUILD_WITH_INSTALL_NAME_DIR", CM_NULLPTR); - this->SetPropertyDefault("C_CLANG_TIDY", CM_NULLPTR); - this->SetPropertyDefault("C_COMPILER_LAUNCHER", CM_NULLPTR); - this->SetPropertyDefault("C_CPPLINT", CM_NULLPTR); - this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", CM_NULLPTR); - this->SetPropertyDefault("LINK_WHAT_YOU_USE", CM_NULLPTR); - this->SetPropertyDefault("C_STANDARD", CM_NULLPTR); - this->SetPropertyDefault("C_STANDARD_REQUIRED", CM_NULLPTR); - this->SetPropertyDefault("C_EXTENSIONS", CM_NULLPTR); - this->SetPropertyDefault("CXX_CLANG_TIDY", CM_NULLPTR); - this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", CM_NULLPTR); - this->SetPropertyDefault("CXX_CPPLINT", CM_NULLPTR); - this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", CM_NULLPTR); - this->SetPropertyDefault("CXX_STANDARD", CM_NULLPTR); - this->SetPropertyDefault("CXX_STANDARD_REQUIRED", CM_NULLPTR); - this->SetPropertyDefault("CXX_EXTENSIONS", CM_NULLPTR); - this->SetPropertyDefault("CUDA_STANDARD", CM_NULLPTR); - this->SetPropertyDefault("CUDA_STANDARD_REQUIRED", CM_NULLPTR); - this->SetPropertyDefault("CUDA_EXTENSIONS", CM_NULLPTR); - this->SetPropertyDefault("CUDA_COMPILER_LAUNCHER", CM_NULLPTR); - this->SetPropertyDefault("LINK_SEARCH_START_STATIC", CM_NULLPTR); - this->SetPropertyDefault("LINK_SEARCH_END_STATIC", CM_NULLPTR); + this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", nullptr); + this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", nullptr); + this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", nullptr); + this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", nullptr); + this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", nullptr); + this->SetPropertyDefault("Fortran_FORMAT", nullptr); + this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", nullptr); + this->SetPropertyDefault("GNUtoMS", nullptr); + this->SetPropertyDefault("OSX_ARCHITECTURES", nullptr); + this->SetPropertyDefault("IOS_INSTALL_COMBINED", nullptr); + this->SetPropertyDefault("AUTOMOC", nullptr); + this->SetPropertyDefault("AUTOUIC", nullptr); + this->SetPropertyDefault("AUTORCC", nullptr); + this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr); + this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", nullptr); + this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", nullptr); + this->SetPropertyDefault("AUTOUIC_OPTIONS", nullptr); + this->SetPropertyDefault("AUTOUIC_SEARCH_PATHS", nullptr); + this->SetPropertyDefault("AUTORCC_OPTIONS", nullptr); + this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", nullptr); + this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", nullptr); + this->SetPropertyDefault("WIN32_EXECUTABLE", nullptr); + this->SetPropertyDefault("MACOSX_BUNDLE", nullptr); + this->SetPropertyDefault("MACOSX_RPATH", nullptr); + this->SetPropertyDefault("BUILD_WITH_INSTALL_NAME_DIR", nullptr); + this->SetPropertyDefault("C_CLANG_TIDY", nullptr); + this->SetPropertyDefault("C_COMPILER_LAUNCHER", nullptr); + this->SetPropertyDefault("C_CPPLINT", nullptr); + this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", nullptr); + this->SetPropertyDefault("LINK_WHAT_YOU_USE", nullptr); + this->SetPropertyDefault("C_STANDARD", nullptr); + this->SetPropertyDefault("C_STANDARD_REQUIRED", nullptr); + this->SetPropertyDefault("C_EXTENSIONS", nullptr); + this->SetPropertyDefault("CXX_CLANG_TIDY", nullptr); + this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", nullptr); + this->SetPropertyDefault("CXX_CPPLINT", nullptr); + this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", nullptr); + this->SetPropertyDefault("CXX_STANDARD", nullptr); + this->SetPropertyDefault("CXX_STANDARD_REQUIRED", nullptr); + this->SetPropertyDefault("CXX_EXTENSIONS", nullptr); + this->SetPropertyDefault("CUDA_STANDARD", nullptr); + this->SetPropertyDefault("CUDA_STANDARD_REQUIRED", nullptr); + this->SetPropertyDefault("CUDA_EXTENSIONS", nullptr); + this->SetPropertyDefault("CUDA_COMPILER_LAUNCHER", nullptr); + this->SetPropertyDefault("LINK_SEARCH_START_STATIC", nullptr); + this->SetPropertyDefault("LINK_SEARCH_END_STATIC", nullptr); } if (this->GetType() != cmStateEnums::UTILITY) { - this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", CM_NULLPTR); + this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", nullptr); } // Collect the set of configuration types. @@ -297,7 +297,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, "ARCHIVE_OUTPUT_DIRECTORY_", "LIBRARY_OUTPUT_DIRECTORY_", "RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_", "COMPILE_PDB_OUTPUT_DIRECTORY_", "MAP_IMPORTED_CONFIG_", - "INTERPROCEDURAL_OPTIMIZATION_", CM_NULLPTR + "INTERPROCEDURAL_OPTIMIZATION_", nullptr }; for (std::vector<std::string>::iterator ci = configNames.begin(); ci != configNames.end(); ++ci) { @@ -311,7 +311,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } std::string property = *p; property += configUpper; - this->SetPropertyDefault(property, CM_NULLPTR); + this->SetPropertyDefault(property, nullptr); } // Initialize per-configuration name postfix property from the @@ -323,7 +323,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->TargetTypeValue != cmStateEnums::INTERFACE_LIBRARY) { std::string property = cmSystemTools::UpperCase(*ci); property += "_POSTFIX"; - this->SetPropertyDefault(property, CM_NULLPTR); + this->SetPropertyDefault(property, nullptr); } } } @@ -367,16 +367,16 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - this->SetPropertyDefault("C_VISIBILITY_PRESET", CM_NULLPTR); - this->SetPropertyDefault("CXX_VISIBILITY_PRESET", CM_NULLPTR); - this->SetPropertyDefault("CUDA_VISIBILITY_PRESET", CM_NULLPTR); - this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", CM_NULLPTR); + this->SetPropertyDefault("C_VISIBILITY_PRESET", nullptr); + this->SetPropertyDefault("CXX_VISIBILITY_PRESET", nullptr); + this->SetPropertyDefault("CUDA_VISIBILITY_PRESET", nullptr); + this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", nullptr); } if (this->TargetTypeValue == cmStateEnums::EXECUTABLE) { - this->SetPropertyDefault("ANDROID_GUI", CM_NULLPTR); - this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", CM_NULLPTR); - this->SetPropertyDefault("ENABLE_EXPORTS", CM_NULLPTR); + this->SetPropertyDefault("ANDROID_GUI", nullptr); + this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", nullptr); + this->SetPropertyDefault("ENABLE_EXPORTS", nullptr); } if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY || this->TargetTypeValue == cmStateEnums::MODULE_LIBRARY) { @@ -384,12 +384,12 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY || this->TargetTypeValue == cmStateEnums::EXECUTABLE) { - this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", CM_NULLPTR); + this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", nullptr); } if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", CM_NULLPTR); + this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", nullptr); } // Record current policies for later use. @@ -405,8 +405,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - this->SetPropertyDefault("JOB_POOL_COMPILE", CM_NULLPTR); - this->SetPropertyDefault("JOB_POOL_LINK", CM_NULLPTR); + this->SetPropertyDefault("JOB_POOL_COMPILE", nullptr); + this->SetPropertyDefault("JOB_POOL_LINK", nullptr); } } @@ -429,7 +429,7 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace( std::map<std::string, cmListFileBacktrace>::const_iterator i = this->UtilityBacktraces.find(u); if (i == this->UtilityBacktraces.end()) { - return CM_NULLPTR; + return nullptr; } return &i->second; @@ -547,7 +547,7 @@ cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) { std::string src = this->ProcessSourceItemCMP0049(s); if (!s.empty() && src.empty()) { - return CM_NULLPTR; + return nullptr; } return this->AddSource(src); } @@ -618,7 +618,7 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) this->Internal->SourceBacktraces.push_back(lfbt); } if (cmGeneratorExpression::Find(src) != std::string::npos) { - return CM_NULLPTR; + return nullptr; } return this->Makefile->GetOrCreateSource(src); } @@ -1212,7 +1212,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const if (specialProps.count(prop)) { if (prop == propLINK_LIBRARIES) { if (this->Internal->LinkImplementationPropertyEntries.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1225,7 +1225,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const } if (prop == propINCLUDE_DIRECTORIES) { if (this->Internal->IncludeDirectoriesEntries.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1234,7 +1234,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const } if (prop == propCOMPILE_FEATURES) { if (this->Internal->CompileFeaturesEntries.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1243,7 +1243,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const } if (prop == propCOMPILE_OPTIONS) { if (this->Internal->CompileOptionsEntries.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1252,7 +1252,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const } if (prop == propCOMPILE_DEFINITIONS) { if (this->Internal->CompileDefinitionsEntries.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1261,7 +1261,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const } if (prop == propMANUALLY_ADDED_DEPENDENCIES) { if (this->Utilities.empty()) { - return CM_NULLPTR; + return nullptr; } static std::string output; @@ -1399,8 +1399,8 @@ std::string cmTarget::ImportedGetFullPath( std::string result; - const char* loc = CM_NULLPTR; - const char* imp = CM_NULLPTR; + const char* loc = nullptr; + const char* imp = nullptr; std::string suffix; if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 53fd45e..c335c81 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -184,7 +184,7 @@ public: * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE * commands. It is not a full path nor does it have an extension. */ - void AddUtility(const std::string& u, cmMakefile* makefile = CM_NULLPTR); + void AddUtility(const std::string& u, cmMakefile* makefile = nullptr); ///! Get the utilities used by this target std::set<std::string> const& GetUtilities() const { return this->Utilities; } cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index e173036..bfae53c 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -95,7 +95,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( if (this->Target->GetType() == cmStateEnums::UTILITY) { std::ostringstream e; - const char* modal = CM_NULLPTR; + const char* modal = nullptr; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) { case cmPolicies::WARN: @@ -311,7 +311,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, if (!this->Target->PushTLLCommandTrace( sig, this->Makefile->GetExecutionContext())) { std::ostringstream e; - const char* modal = CM_NULLPTR; + const char* modal = nullptr; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) { case cmPolicies::WARN: diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index b19b024..3a3c165 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -16,7 +16,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy( cmListFileBacktrace const& context) { std::ostringstream e; - const char* modal = CM_NULLPTR; + const char* modal = nullptr; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (context.GetBottom().GetPolicy(cmPolicies::CMP0026)) { case cmPolicies::WARN: diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index 94688e3..97e4fba 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -26,12 +26,12 @@ public: return loc; } if (cmSystemTools::GetFatalErrorOccured()) { - return CM_NULLPTR; + return nullptr; } if (prop == "SOURCES") { return GetSources(tgt, messenger, context); } - return CM_NULLPTR; + return nullptr; } static bool WhiteListedInterfaceProperty(const std::string& prop); @@ -69,7 +69,7 @@ private: if (!tgt->IsImported() && !HandleLocationPropertyPolicy(tgt->GetName(), messenger, context)) { - return CM_NULLPTR; + return nullptr; } return ComputeLocationForBuild(tgt); } @@ -79,7 +79,7 @@ private: if (!tgt->IsImported() && !HandleLocationPropertyPolicy(tgt->GetName(), messenger, context)) { - return CM_NULLPTR; + return nullptr; } const char* configName = prop.c_str() + 9; return ComputeLocation(tgt, configName); @@ -93,13 +93,13 @@ private: if (!tgt->IsImported() && !HandleLocationPropertyPolicy(tgt->GetName(), messenger, context)) { - return CM_NULLPTR; + return nullptr; } return ComputeLocation(tgt, configName); } } } - return CM_NULLPTR; + return nullptr; } template <typename Target> diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index be4b378..85d4b97 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -23,7 +23,7 @@ cmTestGenerator::cmTestGenerator( { this->ActionsPerConfig = !test->GetOldStyle(); this->TestGenerated = false; - this->LG = CM_NULLPTR; + this->LG = nullptr; } cmTestGenerator::~cmTestGenerator() @@ -80,7 +80,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // Prepend with the emulator when cross compiling if required. const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); - if (emulator != CM_NULLPTR) { + if (emulator != nullptr) { std::vector<std::string> emulatorWithArgs; cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); std::string emulatorExe(emulatorWithArgs[0]); diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 4b97188..ad08444 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -12,7 +12,7 @@ std::string cmTimestamp::CurrentTime(const std::string& formatString, bool utcFlag) { - time_t currentTimeT = time(CM_NULLPTR); + time_t currentTimeT = time(nullptr); std::string source_date_epoch; cmSystemTools::GetEnv("SOURCE_DATE_EPOCH", source_date_epoch); if (!source_date_epoch.empty()) { @@ -56,14 +56,14 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT, struct tm timeStruct; memset(&timeStruct, 0, sizeof(timeStruct)); - struct tm* ptr = (struct tm*)CM_NULLPTR; + struct tm* ptr = (struct tm*)nullptr; if (utcFlag) { ptr = gmtime(&timeT); } else { ptr = localtime(&timeT); } - if (ptr == CM_NULLPTR) { + if (ptr == nullptr) { return std::string(); } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 07e20e6..cc93b03 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -125,9 +125,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv, std::string runOutputContents; if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) { - this->DoNotRunExecutable(runArgs, argv[3], captureRunOutput - ? &runOutputContents - : CM_NULLPTR); + this->DoNotRunExecutable( + runArgs, argv[3], captureRunOutput ? &runOutputContents : nullptr); } else { this->RunExecutable(runArgs, &runOutputContents); } @@ -189,7 +188,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } int timeout = 0; bool worked = cmSystemTools::RunSingleCommand( - finalCommand.c_str(), out, out, &retVal, CM_NULLPTR, + finalCommand.c_str(), out, out, &retVal, nullptr, cmSystemTools::OUTPUT_NONE, timeout); // set the run var char retChar[1000]; @@ -233,7 +232,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->RunResultVariable + "__TRYRUN_OUTPUT"; bool error = false; - if (this->Makefile->GetDefinition(this->RunResultVariable) == CM_NULLPTR) { + if (this->Makefile->GetDefinition(this->RunResultVariable) == nullptr) { // if the variables doesn't exist, create it with a helpful error text // and mark it as advanced std::string comment; @@ -255,8 +254,8 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, } // is the output from the executable used ? - if (out != CM_NULLPTR) { - if (this->Makefile->GetDefinition(internalRunOutputName) == CM_NULLPTR) { + if (out != nullptr) { + if (this->Makefile->GetDefinition(internalRunOutputName) == nullptr) { // if the variables doesn't exist, create it with a helpful error text // and mark it as advanced std::string comment; @@ -304,7 +303,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment += " to\n" " the exit code (in many cases 0 for success), otherwise " "enter \"FAILED_TO_RUN\".\n"; - if (out != CM_NULLPTR) { + if (out != nullptr) { comment += internalRunOutputName; comment += "\n contains the text the executable " @@ -335,7 +334,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, << this->Makefile->GetDefinition(this->RunResultVariable) << "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n"; - if (out != CM_NULLPTR) { + if (out != nullptr) { file << "set( " << internalRunOutputName << " \n \"" << this->Makefile->GetDefinition(internalRunOutputName) << "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n"; @@ -348,7 +347,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "please set the following cache variables " "appropriately:\n"; errorMessage += " " + this->RunResultVariable + " (advanced)\n"; - if (out != CM_NULLPTR) { + if (out != nullptr) { errorMessage += " " + internalRunOutputName + " (advanced)\n"; } errorMessage += detailsString; @@ -356,7 +355,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, return; } - if (out != CM_NULLPTR) { + if (out != nullptr) { (*out) = this->Makefile->GetDefinition(internalRunOutputName); } } diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index 31525ba..18bbdd7 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -46,7 +46,7 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args, } // unset(VAR PARENT_SCOPE) if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) { - this->Makefile->RaiseScope(variable, CM_NULLPTR); + this->Makefile->RaiseScope(variable, nullptr); return true; } // ERROR: second argument isn't CACHE or PARENT_SCOPE diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index eabd7ef..0ce437c 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -33,7 +33,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args, bool haveCacheValue = false; if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) { - haveCacheValue = (cacheValue != CM_NULLPTR); + haveCacheValue = (cacheValue != nullptr); if (!haveCacheValue) { std::string msg = "UTILITY_SOURCE is used in cross compiling mode for "; msg += cacheEntry; @@ -45,7 +45,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args, } else { cmState* state = this->Makefile->GetState(); haveCacheValue = - (cacheValue && (strstr(cacheValue, "(IntDir)") == CM_NULLPTR || + (cacheValue && (strstr(cacheValue, "(IntDir)") == nullptr || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && (state->GetCacheMajorVersion() != 0 && state->GetCacheMinorVersion() != 0)); diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index a575afe..05a0a56 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -31,10 +31,9 @@ public: * Add watch to the variable */ bool AddWatch(const std::string& variable, WatchMethod method, - void* client_data = CM_NULLPTR, - DeleteData delete_data = CM_NULLPTR); + void* client_data = nullptr, DeleteData delete_data = nullptr); void RemoveWatch(const std::string& variable, WatchMethod method, - void* client_data = CM_NULLPTR); + void* client_data = nullptr); /** * This method is called when variable is accessed @@ -67,9 +66,9 @@ protected: void* ClientData; DeleteData DeleteDataCall; Pair() - : Method(CM_NULLPTR) - , ClientData(CM_NULLPTR) - , DeleteDataCall(CM_NULLPTR) + : Method(nullptr) + , ClientData(nullptr) + , DeleteDataCall(nullptr) { } ~Pair() diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 35b7350..0e73806 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2063,7 +2063,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( hasFlags = true; cmGlobalVisualStudio10Generator* gg = static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); - cmIDEFlagTable const* flagtable = CM_NULLPTR; + cmIDEFlagTable const* flagtable = nullptr; const std::string& srclang = source->GetLanguage(); if (srclang == "C" || srclang == "CXX") { flagtable = gg->GetClFlagTable(); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 1f808c8..51944fa 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -89,7 +89,7 @@ void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table) void cmVisualStudioGeneratorOptions::ClearTables() { for (int i = 0; i < FlagTableCount; ++i) { - this->FlagTable[i] = CM_NULLPTR; + this->FlagTable[i] = nullptr; } } diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 18afbf3..04cf91e 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -11,10 +11,10 @@ cmXMLParser::cmXMLParser() { - this->Parser = CM_NULLPTR; + this->Parser = nullptr; this->ParseError = 0; - this->ReportCallback = CM_NULLPTR; - this->ReportCallbackData = CM_NULLPTR; + this->ReportCallback = nullptr; + this->ReportCallbackData = nullptr; } cmXMLParser::~cmXMLParser() @@ -55,7 +55,7 @@ int cmXMLParser::InitializeParser() } // Create the expat XML parser. - this->Parser = XML_ParserCreate(CM_NULLPTR); + this->Parser = XML_ParserCreate(nullptr); XML_SetElementHandler(static_cast<XML_Parser>(this->Parser), &cmXMLParserStartElement, &cmXMLParserEndElement); XML_SetCharacterDataHandler(static_cast<XML_Parser>(this->Parser), @@ -99,7 +99,7 @@ int cmXMLParser::CleanupParser() // Clean up the parser. XML_ParserFree(static_cast<XML_Parser>(this->Parser)); - this->Parser = CM_NULLPTR; + this->Parser = nullptr; return result; } @@ -156,7 +156,7 @@ const char* cmXMLParser::FindAttribute(const char** atts, } } } - return CM_NULLPTR; + return nullptr; } void cmXMLParserStartElement(void* parser, const char* name, const char** atts) diff --git a/Source/cm_auto_ptr.hxx b/Source/cm_auto_ptr.hxx index 773602a..1ac9220 100644 --- a/Source/cm_auto_ptr.hxx +++ b/Source/cm_auto_ptr.hxx @@ -112,7 +112,7 @@ public: * * auto_ptr<X> ptr(new X()); */ - explicit auto_ptr(X* p = CM_NULLPTR) throw() + explicit auto_ptr(X* p = nullptr) throw() : x_(p) { } @@ -154,7 +154,7 @@ public: X* release() throw() { X* x = this->x_; - this->x_ = CM_NULLPTR; + this->x_ = nullptr; return x; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 4269a10..425e221 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -163,9 +163,9 @@ cmake::cmake(Role role) } #endif - this->GlobalGenerator = CM_NULLPTR; - this->ProgressCallback = CM_NULLPTR; - this->ProgressCallbackClientData = CM_NULLPTR; + this->GlobalGenerator = nullptr; + this->ProgressCallback = nullptr; + this->ProgressCallbackClientData = nullptr; this->CurrentWorkingMode = NORMAL_MODE; #ifdef CMAKE_BUILD_WITH_CMAKE @@ -215,7 +215,7 @@ cmake::~cmake() delete this->Messenger; if (this->GlobalGenerator) { delete this->GlobalGenerator; - this->GlobalGenerator = CM_NULLPTR; + this->GlobalGenerator = nullptr; } cmDeleteAll(this->Generators); #ifdef CMAKE_BUILD_WITH_CMAKE @@ -555,7 +555,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args) gg->CreateGenerationObjects(); cmLocalGenerator* lg = gg->LocalGenerators[0]; std::string includeFlags = - lg->GetIncludeFlags(includeDirs, CM_NULLPTR, language); + lg->GetIncludeFlags(includeDirs, nullptr, language); std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS"); printf("%s %s\n", includeFlags.c_str(), definitions.c_str()); @@ -983,7 +983,7 @@ createExtraGenerator( } } return std::make_pair( - static_cast<cmExternalMakefileProjectGenerator*>(CM_NULLPTR), name); + static_cast<cmExternalMakefileProjectGenerator*>(nullptr), name); } cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) @@ -993,7 +993,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) cmExternalMakefileProjectGenerator* extraGenerator = extra.first; const std::string name = extra.second; - cmGlobalGenerator* generator = CM_NULLPTR; + cmGlobalGenerator* generator = nullptr; for (RegisteredGeneratorsVector::const_iterator i = this->Generators.begin(); i != this->Generators.end(); ++i) { generator = (*i)->CreateGlobalGenerator(name, this); @@ -2127,7 +2127,7 @@ cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const cmInstalledFile const& file = i->second; return &file; } - return CM_NULLPTR; + return nullptr; } int cmake::GetSystemInformation(std::vector<std::string>& args) diff --git a/Source/cmake.h b/Source/cmake.h index 4ddacf7..c5d5b63 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -268,8 +268,7 @@ public: * number provided may be negative in cases where a message is * to be displayed without any progress percentage. */ - void SetProgressCallback(ProgressCallbackType f, - void* clientData = CM_NULLPTR); + void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr); ///! this is called by generators to update the progress void UpdateProgress(const char* msg, float prog); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index dd88083..c0d20eb 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -33,23 +33,22 @@ #ifdef CMAKE_BUILD_WITH_CMAKE static const char* cmDocumentationName[][2] = { - { CM_NULLPTR, " cmake - Cross-Platform Makefile Generator." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " cmake - Cross-Platform Makefile Generator." }, + { nullptr, nullptr } }; static const char* cmDocumentationUsage[][2] = { - { CM_NULLPTR, " cmake [options] <path-to-source>\n" - " cmake [options] <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 } + { nullptr, " cmake [options] <path-to-source>\n" + " cmake [options] <path-to-existing-build>" }, + { 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." }, + { nullptr, nullptr } }; static const char* cmDocumentationUsageNote[][2] = { - { CM_NULLPTR, "Run 'cmake --help' for more information." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, "Run 'cmake --help' for more information." }, + { nullptr, nullptr } }; #define CMAKE_BUILD_OPTIONS \ @@ -85,7 +84,7 @@ static const char* cmDocumentationOptions[][2] = { { "--no-warn-unused-cli", "Don't warn about command line options." }, { "--check-system-vars", "Find problems with variable usage in system " "files." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, nullptr } }; #endif @@ -111,7 +110,7 @@ static cmMakefile* cmakemainGetMakefile(void* clientdata) return gg->GetCurrentMakefile(); } } - return CM_NULLPTR; + return nullptr; } static std::string cmakemainGetStack(void* clientdata) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c546c7e..6b9a4a4 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -349,8 +349,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) // Run the iwyu command line. Capture its stderr and hide its stdout. // Ignore its return code because the tool always returns non-zero. std::string stdErr; - if (!cmSystemTools::RunSingleCommand(iwyu_cmd, CM_NULLPTR, &stdErr, - &ret, CM_NULLPTR, + if (!cmSystemTools::RunSingleCommand(iwyu_cmd, nullptr, &stdErr, &ret, + nullptr, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << iwyu_cmd[0] << "': " << stdErr << "\n"; @@ -380,7 +380,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) std::string stdOut; std::string stdErr; if (!cmSystemTools::RunSingleCommand(tidy_cmd, &stdOut, &stdErr, &ret, - CM_NULLPTR, + nullptr, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << tidy_cmd[0] << "': " << stdErr << "\n"; @@ -410,7 +410,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) std::string stdOut; std::string stdErr; if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, &stdErr, &ret, - CM_NULLPTR, + nullptr, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << lwyu_cmd[0] << "': " << stdErr << "\n"; @@ -433,7 +433,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) // Run the cpplint command line. Capture its output. std::string stdOut; if (!cmSystemTools::RunSingleCommand(cpplint_cmd, &stdOut, &stdOut, - &ret, CM_NULLPTR, + &ret, nullptr, cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << cpplint_cmd[0] << "': " << stdOut << "\n"; @@ -453,7 +453,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) // Now run the real compiler command and return its result value. if (lwyu.empty() && !cmSystemTools::RunSingleCommand( - orig_cmd, CM_NULLPTR, CM_NULLPTR, &ret, CM_NULLPTR, + orig_cmd, nullptr, nullptr, &ret, nullptr, cmSystemTools::OUTPUT_PASSTHROUGH)) { std::cerr << "Error running '" << orig_cmd[0] << "'\n"; return 1; @@ -504,8 +504,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) // Execute command from remaining arguments. std::vector<std::string> cmd(ai, ae); int retval; - if (cmSystemTools::RunSingleCommand(cmd, CM_NULLPTR, CM_NULLPTR, &retval, - CM_NULLPTR, + if (cmSystemTools::RunSingleCommand(cmd, nullptr, nullptr, &retval, + nullptr, cmSystemTools::OUTPUT_PASSTHROUGH)) { return retval; } @@ -630,7 +630,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) time(&time_start); clock_start = clock(); int ret = 0; - cmSystemTools::RunSingleCommand(command, CM_NULLPTR, CM_NULLPTR, &ret); + cmSystemTools::RunSingleCommand(command, nullptr, nullptr, &ret); clock_finish = clock(); time(&time_finish); @@ -686,8 +686,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) int retval = 0; int timeout = 0; if (cmSystemTools::RunSingleCommand( - command.c_str(), CM_NULLPTR, CM_NULLPTR, &retval, - directory.c_str(), cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) { + command.c_str(), nullptr, nullptr, &retval, directory.c_str(), + cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) { return retval; } @@ -1315,7 +1315,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args) } // Setup this command line. - const char* cmd[2] = { command.c_str(), CM_NULLPTR }; + const char* cmd[2] = { command.c_str(), nullptr }; cmsysProcess_SetCommand(cp, cmd); // Report the command if verbose output is enabled. @@ -1325,7 +1325,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args) // Run the command and wait for it to exit. cmsysProcess_Execute(cp); - cmsysProcess_WaitForExit(cp, CM_NULLPTR); + cmsysProcess_WaitForExit(cp, nullptr); // Report failure if any. switch (cmsysProcess_GetState(cp)) { @@ -1442,7 +1442,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type) } static bool RunCommand(const char* comment, std::vector<std::string>& command, - bool verbose, int* retCodeOut = CM_NULLPTR) + bool verbose, int* retCodeOut = nullptr) { if (verbose) { std::cout << comment << ":\n"; @@ -1451,9 +1451,8 @@ static bool RunCommand(const char* comment, std::vector<std::string>& command, std::string output; int retCode = 0; // use rc command to create .res file - bool res = - cmSystemTools::RunSingleCommand(command, &output, &output, &retCode, - CM_NULLPTR, cmSystemTools::OUTPUT_NONE); + bool res = cmSystemTools::RunSingleCommand( + command, &output, &output, &retCode, nullptr, cmSystemTools::OUTPUT_NONE); // always print the output of the command, unless // it is the dumb rc command banner, but if the command // returned an error code then print the output anyway as diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 8f9e676..d04a2de 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -18,13 +18,13 @@ #include <vector> static const char* cmDocumentationName[][2] = { - { CM_NULLPTR, " ctest - Testing driver provided by CMake." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, " ctest - Testing driver provided by CMake." }, + { nullptr, nullptr } }; -static const char* cmDocumentationUsage[][2] = { { CM_NULLPTR, +static const char* cmDocumentationUsage[][2] = { { nullptr, " ctest [options]" }, - { CM_NULLPTR, CM_NULLPTR } }; + { nullptr, nullptr } }; static const char* cmDocumentationOptions[][2] = { { "-C <cfg>, --build-config <cfg>", "Choose configuration to test." }, @@ -120,7 +120,7 @@ static const char* cmDocumentationOptions[][2] = { { "--http1.0", "Submit using HTTP 1.0." }, { "--no-compress-output", "Do not compress test output when submitting." }, { "--print-labels", "Print all available test labels." }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, nullptr } }; // this is a test driver program for cmCTest. diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 46431bc..3a91c21 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -150,8 +150,7 @@ int main() it != end; ++it) { std::vector<std::string> command; cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command); - if (!cmSystemTools::RunSingleCommand(command, CM_NULLPTR, CM_NULLPTR, - CM_NULLPTR, + if (!cmSystemTools::RunSingleCommand(command, nullptr, nullptr, nullptr, it->at("directory").c_str())) { std::cout << "ERROR: Failed to run command \"" << command[0] << "\"" << std::endl; diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index fe776c5..e6ee1e3 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -21,7 +21,7 @@ static test_pair const pairs[] = { { "angles <>", "angles <>" }, { "ampersand &", "ampersand &" }, { "bad-byte \x80", "bad-byte [NON-UTF-8-BYTE-0x80]" }, - { CM_NULLPTR, CM_NULLPTR } + { nullptr, nullptr } }; int testXMLSafe(int /*unused*/, char* /*unused*/ []) @@ -1203,7 +1203,6 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insal cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP" cmake_report cmConfigure.h${_tmp} "#define CM_EQ_DELETE" cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH" -cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0" cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE" cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)" |