Commit 5962db43 authored by Daniel Pfeifer's avatar Daniel Pfeifer

Use C++11 nullptr

parent fe19fda2
...@@ -24,7 +24,4 @@ readability-*,\ ...@@ -24,7 +24,4 @@ readability-*,\
-readability-simplify-boolean-expr,\ -readability-simplify-boolean-expr,\
" "
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$' HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
CheckOptions:
- key: modernize-use-nullptr.NullMacros
value: 'CM_NULLPTR'
... ...
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
#include <vector> #include <vector>
cmCPackIFWCommon::cmCPackIFWCommon() cmCPackIFWCommon::cmCPackIFWCommon()
: Generator(CM_NULLPTR) : Generator(nullptr)
{ {
} }
const char* cmCPackIFWCommon::GetOption(const std::string& op) const const char* cmCPackIFWCommon::GetOption(const std::string& op) const
{ {
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op) return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
: CM_NULLPTR; : nullptr;
} }
bool cmCPackIFWCommon::IsOn(const std::string& op) const bool cmCPackIFWCommon::IsOn(const std::string& op) const
......
...@@ -73,7 +73,7 @@ int cmCPackIFWGenerator::PackageFiles() ...@@ -73,7 +73,7 @@ int cmCPackIFWGenerator::PackageFiles()
int retVal = 1; int retVal = 1;
cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl); cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl);
bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
&output, &retVal, CM_NULLPTR, &output, &retVal, nullptr,
this->GeneratorVerbose, 0); this->GeneratorVerbose, 0);
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str()); cmGeneratedFileStream ofs(ifwTmpFile.c_str());
...@@ -171,7 +171,7 @@ int cmCPackIFWGenerator::PackageFiles() ...@@ -171,7 +171,7 @@ int cmCPackIFWGenerator::PackageFiles()
int retVal = 1; int retVal = 1;
cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl); cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl);
bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
&output, &retVal, CM_NULLPTR, &output, &retVal, nullptr,
this->GeneratorVerbose, 0); this->GeneratorVerbose, 0);
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str()); cmGeneratedFileStream ofs(ifwTmpFile.c_str());
...@@ -534,7 +534,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage( ...@@ -534,7 +534,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
{ {
std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit = std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit =
this->GroupPackages.find(group); this->GroupPackages.find(group);
return pit != this->GroupPackages.end() ? pit->second : CM_NULLPTR; return pit != this->GroupPackages.end() ? pit->second : nullptr;
} }
cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
...@@ -542,7 +542,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( ...@@ -542,7 +542,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
{ {
std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit = std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit =
this->ComponentPackages.find(component); this->ComponentPackages.find(component);
return pit != this->ComponentPackages.end() ? pit->second : CM_NULLPTR; return pit != this->ComponentPackages.end() ? pit->second : nullptr;
} }
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
...@@ -564,7 +564,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( ...@@ -564,7 +564,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
} }
} else { } else {
this->Repositories.erase(repositoryName); this->Repositories.erase(repositoryName);
repository = CM_NULLPTR; repository = nullptr;
cmCPackIFWLogger(WARNING, "Invalid repository \"" cmCPackIFWLogger(WARNING, "Invalid repository \""
<< repositoryName << "\"" << repositoryName << "\""
<< " configuration. Repository will be skipped." << " configuration. Repository will be skipped."
......
...@@ -92,7 +92,7 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const ...@@ -92,7 +92,7 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const
//------------------------------------------------------ cmCPackIFWPackage --- //------------------------------------------------------ cmCPackIFWPackage ---
cmCPackIFWPackage::cmCPackIFWPackage() cmCPackIFWPackage::cmCPackIFWPackage()
: Installer(CM_NULLPTR) : Installer(nullptr)
{ {
} }
......
...@@ -72,7 +72,7 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts) ...@@ -72,7 +72,7 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
void cmWIXPatchParser::StartFragment(const char** attributes) void cmWIXPatchParser::StartFragment(const char** attributes)
{ {
cmWIXPatchElement* new_element = CM_NULLPTR; cmWIXPatchElement* new_element = nullptr;
/* find the id of for fragment */ /* find the id of for fragment */
for (size_t i = 0; attributes[i]; i += 2) { for (size_t i = 0; attributes[i]; i += 2) {
const std::string key = attributes[i]; const std::string key = attributes[i];
......
...@@ -79,7 +79,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( ...@@ -79,7 +79,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
++fileIt) { ++fileIt) {
std::string rp = filePrefix + *fileIt; std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl);
archive.Add(rp, 0, CM_NULLPTR, false); archive.Add(rp, 0, nullptr, false);
if (!archive) { if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
<< archive.GetError() << std::endl); << archive.GetError() << std::endl);
...@@ -146,7 +146,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) ...@@ -146,7 +146,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end(); for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) { ++compIt) {
// Does the component belong to a group? // Does the component belong to a group?
if (compIt->second.Group == CM_NULLPTR) { if (compIt->second.Group == nullptr) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <" cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name << compIt->second.Name
...@@ -255,7 +255,7 @@ int cmCPackArchiveGenerator::PackageFiles() ...@@ -255,7 +255,7 @@ int cmCPackArchiveGenerator::PackageFiles()
// Get the relative path to the file // Get the relative path to the file
std::string rp = std::string rp =
cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str());
archive.Add(rp, 0, CM_NULLPTR, false); archive.Add(rp, 0, nullptr, false);
if (!archive) { if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
<< *fileIt << "> to archive <" << packageFileNames[0] << *fileIt << "> to archive <" << packageFileNames[0]
......
...@@ -36,7 +36,7 @@ class cmCPackComponent ...@@ -36,7 +36,7 @@ class cmCPackComponent
{ {
public: public:
cmCPackComponent() cmCPackComponent()
: Group(CM_NULLPTR) : Group(nullptr)
, IsRequired(true) , IsRequired(true)
, IsHidden(false) , IsHidden(false)
, IsDisabledByDefault(false) , IsDisabledByDefault(false)
...@@ -114,7 +114,7 @@ class cmCPackComponentGroup ...@@ -114,7 +114,7 @@ class cmCPackComponentGroup
{ {
public: public:
cmCPackComponentGroup() cmCPackComponentGroup()
: ParentGroup(CM_NULLPTR) : ParentGroup(nullptr)
{ {
} }
......
...@@ -129,7 +129,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) ...@@ -129,7 +129,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end(); for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) { ++compIt) {
// Does the component belong to a group? // Does the component belong to a group?
if (compIt->second.Group == CM_NULLPTR) { if (compIt->second.Group == nullptr) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <" cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name << compIt->second.Name
...@@ -713,7 +713,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix( ...@@ -713,7 +713,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to. // the current COMPONENT belongs to.
std::string groupVar = std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
if (CM_NULLPTR != GetOption(groupVar)) { if (nullptr != GetOption(groupVar)) {
return std::string(GetOption(groupVar)); return std::string(GetOption(groupVar));
} }
return componentName; return componentName;
...@@ -928,18 +928,18 @@ static int ar_append(const char* archive, ...@@ -928,18 +928,18 @@ static int ar_append(const char* archive,
{ {
int eval = 0; int eval = 0;
FILE* aFile = cmSystemTools::Fopen(archive, "wb+"); FILE* aFile = cmSystemTools::Fopen(archive, "wb+");
if (aFile != CM_NULLPTR) { if (aFile != nullptr) {
fwrite(ARMAG, SARMAG, 1, aFile); fwrite(ARMAG, SARMAG, 1, aFile);
if (fseek(aFile, 0, SEEK_END) != -1) { if (fseek(aFile, 0, SEEK_END) != -1) {
CF cf; CF cf;
struct stat sb; struct stat sb;
/* Read from disk, write to an archive; pad on write. */ /* 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(); for (std::vector<std::string>::const_iterator fileIt = files.begin();
fileIt != files.end(); ++fileIt) { fileIt != files.end(); ++fileIt) {
const char* filename = fileIt->c_str(); const char* filename = fileIt->c_str();
FILE* file = cmSystemTools::Fopen(filename, "rb"); FILE* file = cmSystemTools::Fopen(filename, "rb");
if (file == CM_NULLPTR) { if (file == nullptr) {
eval = -1; eval = -1;
continue; continue;
} }
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
cmCPackGenerator::cmCPackGenerator() cmCPackGenerator::cmCPackGenerator()
{ {
this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE; this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE;
this->MakefileMap = CM_NULLPTR; this->MakefileMap = nullptr;
this->Logger = CM_NULLPTR; this->Logger = nullptr;
this->componentPackageMethod = ONE_PACKAGE_PER_GROUP; this->componentPackageMethod = ONE_PACKAGE_PER_GROUP;
} }
cmCPackGenerator::~cmCPackGenerator() cmCPackGenerator::~cmCPackGenerator()
{ {
this->MakefileMap = CM_NULLPTR; this->MakefileMap = nullptr;
} }
void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr) void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr)
...@@ -156,7 +156,7 @@ int cmCPackGenerator::PrepareNames() ...@@ -156,7 +156,7 @@ int cmCPackGenerator::PrepareNames()
} }
const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM"); const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) { if (algoSignature) {
if (cmCryptoHash::New(algoSignature).get() == CM_NULLPTR) { if (cmCryptoHash::New(algoSignature).get() == nullptr) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: "
<< algoSignature << std::endl); << algoSignature << std::endl);
return 0; return 0;
...@@ -256,7 +256,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( ...@@ -256,7 +256,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
int retVal = 1; int retVal = 1;
bool resB = bool resB =
cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal, cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal,
CM_NULLPTR, this->GeneratorVerbose, 0); nullptr, this->GeneratorVerbose, 0);
if (!resB || retVal) { if (!resB || retVal) {
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/InstallOutput.log"; tmpFile += "/InstallOutput.log";
...@@ -820,8 +820,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( ...@@ -820,8 +820,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
} }
} }
if (CM_NULLPTR != if (nullptr != mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
if (!absoluteDestFiles.empty()) { if (!absoluteDestFiles.empty()) {
absoluteDestFiles += ";"; absoluteDestFiles += ";";
} }
...@@ -835,7 +834,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( ...@@ -835,7 +834,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string absoluteDestFileComponent = std::string absoluteDestFileComponent =
std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" + std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" +
GetComponentInstallDirNameSuffix(installComponent); GetComponentInstallDirNameSuffix(installComponent);
if (CM_NULLPTR != this->GetOption(absoluteDestFileComponent)) { if (nullptr != this->GetOption(absoluteDestFileComponent)) {
std::string absoluteDestFilesListComponent = std::string absoluteDestFilesListComponent =
this->GetOption(absoluteDestFileComponent); this->GetOption(absoluteDestFileComponent);
absoluteDestFilesListComponent += ";"; absoluteDestFilesListComponent += ";";
...@@ -1016,7 +1015,7 @@ int cmCPackGenerator::DoPackage() ...@@ -1016,7 +1015,7 @@ int cmCPackGenerator::DoPackage()
<< packageFileName << " generated." << std::endl); << packageFileName << " generated." << std::endl);
/* Generate checksum file */ /* Generate checksum file */
if (crypto.get() != CM_NULLPTR) { if (crypto.get() != nullptr) {
std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX")); std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
hashFile += hashFile +=
"/" + filename.substr(0, filename.rfind(this->GetOutputExtension())); "/" + filename.substr(0, filename.rfind(this->GetOutputExtension()));
...@@ -1225,7 +1224,7 @@ int cmCPackGenerator::PrepareGroupingKind() ...@@ -1225,7 +1224,7 @@ int cmCPackGenerator::PrepareGroupingKind()
std::string groupingType; std::string groupingType;
// Second way to specify grouping // 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"); groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
} }
...@@ -1407,7 +1406,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( ...@@ -1407,7 +1406,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->Group = GetComponentGroup(projectName, groupName); component->Group = GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component); component->Group->Components.push_back(component);
} else { } else {
component->Group = CM_NULLPTR; component->Group = nullptr;
} }
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
...@@ -1475,7 +1474,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup( ...@@ -1475,7 +1474,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
group->ParentGroup = GetComponentGroup(projectName, parentGroupName); group->ParentGroup = GetComponentGroup(projectName, parentGroupName);
group->ParentGroup->Subgroups.push_back(group); group->ParentGroup->Subgroups.push_back(group);
} else { } else {
group->ParentGroup = CM_NULLPTR; group->ParentGroup = nullptr;
} }
} }
return group; return group;
......
...@@ -105,7 +105,7 @@ protected: ...@@ -105,7 +105,7 @@ protected:
cmInstalledFile const* GetInstalledFile(std::string const& name) const; cmInstalledFile const* GetInstalledFile(std::string const& name) const;
virtual const char* GetOutputExtension() { return ".cpack"; } 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 * Prepare requested grouping kind from CPACK_xxx vars
......
...@@ -153,7 +153,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator( ...@@ -153,7 +153,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
{ {
cmCPackGenerator* gen = this->NewGeneratorInternal(name); cmCPackGenerator* gen = this->NewGeneratorInternal(name);
if (!gen) { if (!gen) {
return CM_NULLPTR; return nullptr;
} }
this->Generators.push_back(gen); this->Generators.push_back(gen);
gen->SetLogger(this->Logger); gen->SetLogger(this->Logger);
...@@ -166,7 +166,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal( ...@@ -166,7 +166,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it = cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it =
this->GeneratorCreators.find(name); this->GeneratorCreators.find(name);
if (it == this->GeneratorCreators.end()) { if (it == this->GeneratorCreators.end()) {
return CM_NULLPTR; return nullptr;
} }
return (it->second)(); return (it->second)();
} }
......
...@@ -19,13 +19,13 @@ cmCPackLog::cmCPackLog() ...@@ -19,13 +19,13 @@ cmCPackLog::cmCPackLog()
this->DefaultOutput = &std::cout; this->DefaultOutput = &std::cout;
this->DefaultError = &std::cerr; this->DefaultError = &std::cerr;
this->LogOutput = CM_NULLPTR; this->LogOutput = nullptr;
this->LogOutputCleanup = false; this->LogOutputCleanup = false;
} }
cmCPackLog::~cmCPackLog() cmCPackLog::~cmCPackLog()
{ {
this->SetLogOutputStream(CM_NULLPTR); this->SetLogOutputStream(nullptr);
} }
void cmCPackLog::SetLogOutputStream(std::ostream* os) void cmCPackLog::SetLogOutputStream(std::ostream* os)
...@@ -39,13 +39,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os) ...@@ -39,13 +39,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os)
bool cmCPackLog::SetLogOutputFile(const char* fname) bool cmCPackLog::SetLogOutputFile(const char* fname)
{ {
cmGeneratedFileStream* cg = CM_NULLPTR; cmGeneratedFileStream* cg = nullptr;
if (fname) { if (fname) {
cg = new cmGeneratedFileStream(fname); cg = new cmGeneratedFileStream(fname);
} }
if (cg && !*cg) { if (cg && !*cg) {
delete cg; delete cg;
cg = CM_NULLPTR; cg = nullptr;
} }
this->SetLogOutputStream(cg); this->SetLogOutputStream(cg);
if (!cg) { if (!cg) {
......
...@@ -222,7 +222,7 @@ int cmCPackNSISGenerator::PackageFiles() ...@@ -222,7 +222,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::map<std::string, cmCPackComponentGroup>::iterator groupIt; std::map<std::string, cmCPackComponentGroup>::iterator groupIt;
for (groupIt = this->ComponentGroups.begin(); for (groupIt = this->ComponentGroups.begin();
groupIt != this->ComponentGroups.end(); ++groupIt) { groupIt != this->ComponentGroups.end(); ++groupIt) {
if (groupIt->second.ParentGroup == CM_NULLPTR) { if (groupIt->second.ParentGroup == nullptr) {
componentCode += componentCode +=
this->CreateComponentGroupDescription(&groupIt->second, macrosOut); this->CreateComponentGroupDescription(&groupIt->second, macrosOut);
} }
...@@ -313,7 +313,7 @@ int cmCPackNSISGenerator::PackageFiles() ...@@ -313,7 +313,7 @@ int cmCPackNSISGenerator::PackageFiles()
int retVal = 1; int retVal = 1;
bool res = bool res =
cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal,
CM_NULLPTR, this->GeneratorVerbose, 0); nullptr, this->GeneratorVerbose, 0);
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd << std::endl ofs << "# Run command: " << nsisCmd << std::endl
...@@ -337,7 +337,7 @@ int cmCPackNSISGenerator::InitializeInternal() ...@@ -337,7 +337,7 @@ int cmCPackNSISGenerator::InitializeInternal()
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. " "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
"This option will be reset to 0 (for this generator only)." "This option will be reset to 0 (for this generator only)."
<< std::endl); << std::endl);
this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", CM_NULLPTR); this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr);
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()"
...@@ -412,7 +412,7 @@ int cmCPackNSISGenerator::InitializeInternal() ...@@ -412,7 +412,7 @@ int cmCPackNSISGenerator::InitializeInternal()
int retVal = 1; int retVal = 1;
bool resS = bool resS =
cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, 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 versionRex("v([0-9]+.[0-9]+)");
cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs");
if (!resS || retVal || if (!resS || retVal ||
......
...@@ -148,7 +148,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) ...@@ -148,7 +148,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); for (compIt = this->Components.begin();
compIt != this->Components.end(); ++compIt) { compIt != this->Components.end(); ++compIt) {
// Does the component belong to a group? // Does the component belong to a group?
if (compIt->second.Group == CM_NULLPTR) { if (compIt->second.Group == nullptr) {
std::string component(compIt->first); std::string component(compIt->first);
std::transform(component.begin(), component.end(), std::transform(component.begin(), component.end(),
component.begin(), ::toupper); component.begin(), ::toupper);
...@@ -214,7 +214,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) ...@@ -214,7 +214,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end(); for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) { ++compIt) {
// Does the component belong to a group? // Does the component belong to a group