use CM_NULLPTR

This commit is contained in:
Daniel Pfeifer 2016-06-27 22:44:16 +02:00 committed by Brad King
parent b4b73f56a2
commit 1d6909a287
201 changed files with 1143 additions and 1075 deletions

View File

@ -101,8 +101,9 @@ int cmCPackIFWGenerator::PackageFiles()
int retVal = 1; int retVal = 1;
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate repository" cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate repository"
<< std::endl); << std::endl);
bool res = cmSystemTools::RunSingleCommand( bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
ifwCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); &output, &retVal, CM_NULLPTR,
this->GeneratorVerbose, 0);
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str()); cmGeneratedFileStream ofs(ifwTmpFile.c_str());
ofs << "# Run command: " << ifwCmd << std::endl ofs << "# Run command: " << ifwCmd << std::endl
@ -178,8 +179,9 @@ int cmCPackIFWGenerator::PackageFiles()
std::string output; std::string output;
int retVal = 1; int retVal = 1;
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate package" << std::endl); cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate package" << std::endl);
bool res = cmSystemTools::RunSingleCommand( bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
ifwCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); &output, &retVal, CM_NULLPTR,
this->GeneratorVerbose, 0);
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str()); cmGeneratedFileStream ofs(ifwTmpFile.c_str());
ofs << "# Run command: " << ifwCmd << std::endl ofs << "# Run command: " << ifwCmd << std::endl
@ -526,7 +528,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
{ {
std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit = std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit =
GroupPackages.find(group); GroupPackages.find(group);
return pit != GroupPackages.end() ? pit->second : 0; return pit != GroupPackages.end() ? pit->second : CM_NULLPTR;
} }
cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
@ -534,7 +536,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
{ {
std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit = std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit =
ComponentPackages.find(component); ComponentPackages.find(component);
return pit != ComponentPackages.end() ? pit->second : 0; return pit != ComponentPackages.end() ? pit->second : CM_NULLPTR;
} }
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
@ -556,7 +558,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
} }
} else { } else {
Repositories.erase(repositoryName); Repositories.erase(repositoryName);
repository = 0; repository = CM_NULLPTR;
cmCPackLogger(cmCPackLog::LOG_WARNING, "Invalid repository \"" cmCPackLogger(cmCPackLog::LOG_WARNING, "Invalid repository \""
<< repositoryName << "\"" << repositoryName << "\""
<< " configuration. Repository will be skipped." << " configuration. Repository will be skipped."

View File

@ -33,13 +33,13 @@
} while (0) } while (0)
cmCPackIFWInstaller::cmCPackIFWInstaller() cmCPackIFWInstaller::cmCPackIFWInstaller()
: Generator(0) : Generator(CM_NULLPTR)
{ {
} }
const char* cmCPackIFWInstaller::GetOption(const std::string& op) const const char* cmCPackIFWInstaller::GetOption(const std::string& op) const
{ {
return Generator ? Generator->GetOption(op) : 0; return Generator ? Generator->GetOption(op) : CM_NULLPTR;
} }
bool cmCPackIFWInstaller::IsOn(const std::string& op) const bool cmCPackIFWInstaller::IsOn(const std::string& op) const

View File

@ -96,15 +96,15 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const
//------------------------------------------------------ cmCPackIFWPackage --- //------------------------------------------------------ cmCPackIFWPackage ---
cmCPackIFWPackage::cmCPackIFWPackage() cmCPackIFWPackage::cmCPackIFWPackage()
: Generator(0) : Generator(CM_NULLPTR)
, Installer(0) , Installer(CM_NULLPTR)
{ {
} }
const char* cmCPackIFWPackage::GetOption(const std::string& op) const const char* cmCPackIFWPackage::GetOption(const std::string& op) const
{ {
const char* option = Generator ? Generator->GetOption(op) : 0; const char* option = Generator ? Generator->GetOption(op) : CM_NULLPTR;
return option && *option ? option : 0; return option && *option ? option : CM_NULLPTR;
} }
bool cmCPackIFWPackage::IsOn(const std::string& op) const bool cmCPackIFWPackage::IsOn(const std::string& op) const

View File

@ -35,7 +35,7 @@
cmCPackIFWRepository::cmCPackIFWRepository() cmCPackIFWRepository::cmCPackIFWRepository()
: Update(None) : Update(None)
, Generator(0) , Generator(CM_NULLPTR)
{ {
} }
@ -63,7 +63,7 @@ bool cmCPackIFWRepository::IsValid() const
const char* cmCPackIFWRepository::GetOption(const std::string& op) const const char* cmCPackIFWRepository::GetOption(const std::string& op) const
{ {
return Generator ? Generator->GetOption(op) : 0; return Generator ? Generator->GetOption(op) : CM_NULLPTR;
} }
bool cmCPackIFWRepository::IsOn(const std::string& op) const bool cmCPackIFWRepository::IsOn(const std::string& op) const

View File

@ -68,7 +68,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, 0, false); archive.Add(rp, 0, CM_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);
@ -139,7 +139,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 == NULL) { if (compIt->second.Group == CM_NULLPTR) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <" cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name << compIt->second.Name
@ -246,7 +246,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, 0, false); archive.Add(rp, 0, CM_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]

View File

@ -43,7 +43,7 @@ class cmCPackComponent
{ {
public: public:
cmCPackComponent() cmCPackComponent()
: Group(0) : Group(CM_NULLPTR)
, IsRequired(true) , IsRequired(true)
, IsHidden(false) , IsHidden(false)
, IsDisabledByDefault(false) , IsDisabledByDefault(false)
@ -117,7 +117,7 @@ class cmCPackComponentGroup
{ {
public: public:
cmCPackComponentGroup() cmCPackComponentGroup()
: ParentGroup(0) : ParentGroup(CM_NULLPTR)
{ {
} }

View File

@ -133,7 +133,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 == NULL) { if (compIt->second.Group == CM_NULLPTR) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <" cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name << compIt->second.Name
@ -692,7 +692,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 (NULL != GetOption(groupVar)) { if (CM_NULLPTR != GetOption(groupVar)) {
return std::string(GetOption(groupVar)); return std::string(GetOption(groupVar));
} else { } else {
return componentName; return componentName;
@ -917,18 +917,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 != NULL) { if (aFile != CM_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(NULL, 0, aFile, archive, WPAD); SETCF(CM_NULLPTR, CM_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 == NULL) { if (file == CM_NULLPTR) {
eval = -1; eval = -1;
continue; continue;
} }

View File

@ -34,14 +34,14 @@
cmCPackGenerator::cmCPackGenerator() cmCPackGenerator::cmCPackGenerator()
{ {
this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE; this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE;
this->MakefileMap = 0; this->MakefileMap = CM_NULLPTR;
this->Logger = 0; this->Logger = CM_NULLPTR;
this->componentPackageMethod = ONE_PACKAGE_PER_GROUP; this->componentPackageMethod = ONE_PACKAGE_PER_GROUP;
} }
cmCPackGenerator::~cmCPackGenerator() cmCPackGenerator::~cmCPackGenerator()
{ {
this->MakefileMap = 0; this->MakefileMap = CM_NULLPTR;
} }
void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr) void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr)
@ -251,8 +251,9 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << *it << std::endl); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << *it << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
bool resB = cmSystemTools::RunSingleCommand( bool resB =
it->c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal,
CM_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";
@ -814,7 +815,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
} }
} }
if (NULL != mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { if (CM_NULLPTR !=
mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
if (!absoluteDestFiles.empty()) { if (!absoluteDestFiles.empty()) {
absoluteDestFiles += ";"; absoluteDestFiles += ";";
} }
@ -828,7 +830,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 (NULL != this->GetOption(absoluteDestFileComponent)) { if (CM_NULLPTR != this->GetOption(absoluteDestFileComponent)) {
std::string absoluteDestFilesListComponent = std::string absoluteDestFilesListComponent =
this->GetOption(absoluteDestFileComponent); this->GetOption(absoluteDestFileComponent);
absoluteDestFilesListComponent += ";"; absoluteDestFilesListComponent += ";";
@ -1178,7 +1180,7 @@ int cmCPackGenerator::PrepareGroupingKind()
std::string groupingType; std::string groupingType;
// Second way to specify grouping // Second way to specify grouping
if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) { if (CM_NULLPTR != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING"); groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
} }
@ -1355,7 +1357,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 = 0; component->Group = CM_NULLPTR;
} }
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
@ -1423,7 +1425,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 = 0; group->ParentGroup = CM_NULLPTR;
} }
} }
return group; return group;

View File

@ -136,7 +136,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 0; } virtual const char* GetOutputPostfix() { return CM_NULLPTR; }
/** /**
* Prepare requested grouping kind from CPACK_xxx vars * Prepare requested grouping kind from CPACK_xxx vars

View File

@ -151,7 +151,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
{ {
cmCPackGenerator* gen = this->NewGeneratorInternal(name); cmCPackGenerator* gen = this->NewGeneratorInternal(name);
if (!gen) { if (!gen) {
return 0; return CM_NULLPTR;
} }
this->Generators.push_back(gen); this->Generators.push_back(gen);
gen->SetLogger(this->Logger); gen->SetLogger(this->Logger);
@ -164,7 +164,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 0; return CM_NULLPTR;
} }
return (it->second)(); return (it->second)();
} }

View File

@ -28,13 +28,13 @@ cmCPackLog::cmCPackLog()
this->DefaultOutput = &std::cout; this->DefaultOutput = &std::cout;
this->DefaultError = &std::cerr; this->DefaultError = &std::cerr;
this->LogOutput = 0; this->LogOutput = CM_NULLPTR;
this->LogOutputCleanup = false; this->LogOutputCleanup = false;
} }
cmCPackLog::~cmCPackLog() cmCPackLog::~cmCPackLog()
{ {
this->SetLogOutputStream(0); this->SetLogOutputStream(CM_NULLPTR);
} }
void cmCPackLog::SetLogOutputStream(std::ostream* os) void cmCPackLog::SetLogOutputStream(std::ostream* os)
@ -48,13 +48,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os)
bool cmCPackLog::SetLogOutputFile(const char* fname) bool cmCPackLog::SetLogOutputFile(const char* fname)
{ {
cmGeneratedFileStream* cg = 0; cmGeneratedFileStream* cg = CM_NULLPTR;
if (fname) { if (fname) {
cg = new cmGeneratedFileStream(fname); cg = new cmGeneratedFileStream(fname);
} }
if (cg && !*cg) { if (cg && !*cg) {
delete cg; delete cg;
cg = 0; cg = CM_NULLPTR;
} }
this->SetLogOutputStream(cg); this->SetLogOutputStream(cg);
if (!cg) { if (!cg) {

View File

@ -212,7 +212,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 == 0) { if (groupIt->second.ParentGroup == CM_NULLPTR) {
componentCode += componentCode +=
this->CreateComponentGroupDescription(&groupIt->second, macrosOut); this->CreateComponentGroupDescription(&groupIt->second, macrosOut);
} }
@ -301,8 +301,9 @@ int cmCPackNSISGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd << std::endl); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
bool res = cmSystemTools::RunSingleCommand( bool res =
nsisCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal,
CM_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
@ -326,7 +327,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", 0); this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", CM_NULLPTR);
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()"
@ -399,8 +400,9 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl); << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
bool resS = cmSystemTools::RunSingleCommand( bool resS =
nsisCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0); cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal,
CM_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 ||

View File

@ -121,7 +121,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?
if (compIt->second.Group == NULL) { if (compIt->second.Group == CM_NULLPTR) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <" cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name << compIt->second.Name
@ -245,7 +245,7 @@ std::string cmCPackRPMGenerator::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 (NULL != GetOption(groupVar)) { if (CM_NULLPTR != GetOption(groupVar)) {
return std::string(GetOption(groupVar)); return std::string(GetOption(groupVar));
} else { } else {
return componentName; return componentName;

View File

@ -27,13 +27,13 @@
#include <cmsys/SystemTools.hxx> #include <cmsys/SystemTools.hxx>
static const char* cmDocumentationName[][2] = { static const char* cmDocumentationName[][2] = {
{ 0, " cpack - Packaging driver provided by CMake." }, { CM_NULLPTR, " cpack - Packaging driver provided by CMake." },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationUsage[][2] = { static const char* cmDocumentationUsage[][2] = {
{ 0, " cpack -G <generator> [options]" }, { CM_NULLPTR, " cpack -G <generator> [options]" },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationOptions[][2] = { static const char* cmDocumentationOptions[][2] = {
@ -47,7 +47,7 @@ static const char* cmDocumentationOptions[][2] = {
{ "-R <package version>", "override/define CPACK_PACKAGE_VERSION" }, { "-R <package version>", "override/define CPACK_PACKAGE_VERSION" },
{ "-B <package directory>", "override/define CPACK_PACKAGE_DIRECTORY" }, { "-B <package directory>", "override/define CPACK_PACKAGE_DIRECTORY" },
{ "--vendor <vendor name>", "override/define CPACK_PACKAGE_VENDOR" }, { "--vendor <vendor name>", "override/define CPACK_PACKAGE_VENDOR" },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
int cpackUnknownArgument(const char*, void*) int cpackUnknownArgument(const char*, void*)
@ -200,7 +200,7 @@ int main(int argc, char const* const* argv)
cmCPackGeneratorFactory generators; cmCPackGeneratorFactory generators;
generators.SetLogger(&log); generators.SetLogger(&log);
cmCPackGenerator* cpackGenerator = 0; cmCPackGenerator* cpackGenerator = CM_NULLPTR;
cmDocumentation doc; cmDocumentation doc;
doc.addCPackStandardDocSections(); doc.addCPackStandardDocSections();

View File

@ -139,13 +139,13 @@ std::string cmCTestBZR::LoadInfo()
{ {
// Run "bzr info" to get the repository info from the work tree. // Run "bzr info" to get the repository info from the work tree.
const char* bzr = this->CommandLineTool.c_str(); const char* bzr = this->CommandLineTool.c_str();
const char* bzr_info[] = { bzr, "info", 0 }; const char* bzr_info[] = { bzr, "info", CM_NULLPTR };
InfoParser iout(this, "info-out> "); InfoParser iout(this, "info-out> ");
OutputLogger ierr(this->Log, "info-err> "); OutputLogger ierr(this->Log, "info-err> ");
this->RunChild(bzr_info, &iout, &ierr); this->RunChild(bzr_info, &iout, &ierr);
// Run "bzr revno" to get the repository revision number from the work tree. // Run "bzr revno" to get the repository revision number from the work tree.
const char* bzr_revno[] = { bzr, "revno", 0 }; const char* bzr_revno[] = { bzr, "revno", CM_NULLPTR };
std::string rev; std::string rev;
RevnoParser rout(this, "revno-out> ", rev); RevnoParser rout(this, "revno-out> ", rev);
OutputLogger rerr(this->Log, "revno-err> "); OutputLogger rerr(this->Log, "revno-err> ");
@ -190,7 +190,8 @@ public:
int res = cmXMLParser::InitializeParser(); int res = cmXMLParser::InitializeParser();
if (res) { if (res) {
XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser), XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser),
cmBZRXMLParserUnknownEncodingHandler, 0); cmBZRXMLParserUnknownEncodingHandler,
CM_NULLPTR);
} }
return res; return res;
} }
@ -380,7 +381,7 @@ bool cmCTestBZR::UpdateImpl()
bzr_update.push_back(this->URL.c_str()); bzr_update.push_back(this->URL.c_str());
bzr_update.push_back(0); bzr_update.push_back(CM_NULLPTR);
// For some reason bzr uses stderr to display the update status. // For some reason bzr uses stderr to display the update status.
OutputLogger out(this->Log, "pull-out> "); OutputLogger out(this->Log, "pull-out> ");
@ -408,7 +409,8 @@ void cmCTestBZR::LoadRevisions()
// Run "bzr log" to get all global revisions of interest. // Run "bzr log" to get all global revisions of interest.
const char* bzr = this->CommandLineTool.c_str(); const char* bzr = this->CommandLineTool.c_str();
const char* bzr_log[] = { const char* bzr_log[] = {
bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), 0 bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(),
CM_NULLPTR
}; };
{ {
LogParser out(this, "log-out> "); LogParser out(this, "log-out> ");
@ -465,7 +467,7 @@ void cmCTestBZR::LoadModifications()
{ {
// Run "bzr status" which reports local modifications. // Run "bzr status" which reports local modifications.
const char* bzr = this->CommandLineTool.c_str(); const char* bzr = this->CommandLineTool.c_str();
const char* bzr_status[] = { bzr, "status", "-SV", 0 }; const char* bzr_status[] = { bzr, "status", "-SV", CM_NULLPTR };
StatusParser out(this, "status-out> "); StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> "); OutputLogger err(this->Log, "status-err> ");
this->RunChild(bzr_status, &out, &err); this->RunChild(bzr_status, &out, &err);

View File

@ -72,7 +72,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
args.push_back(toolset); args.push_back(toolset);
} }
const char* config = 0; const char* config = CM_NULLPTR;
if (!this->CTest->GetConfigType().empty()) { if (!this->CTest->GetConfigType().empty()) {
config = this->CTest->GetConfigType().c_str(); config = this->CTest->GetConfigType().c_str();
} }
@ -158,10 +158,10 @@ public:
} }
~cmCTestBuildAndTestCaptureRAII() ~cmCTestBuildAndTestCaptureRAII()
{ {
this->CM.SetProgressCallback(0, 0); this->CM.SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
cmSystemTools::SetStderrCallback(0, 0); cmSystemTools::SetStderrCallback(CM_NULLPTR, CM_NULLPTR);
cmSystemTools::SetStdoutCallback(0, 0); cmSystemTools::SetStdoutCallback(CM_NULLPTR, CM_NULLPTR);
cmSystemTools::SetMessageCallback(0, 0); cmSystemTools::SetMessageCallback(CM_NULLPTR, CM_NULLPTR);
} }
}; };
@ -247,7 +247,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
} }
} }
std::string output; std::string output;
const char* config = 0; const char* config = CM_NULLPTR;
if (!this->CTest->GetConfigType().empty()) { if (!this->CTest->GetConfigType().empty()) {
config = this->CTest->GetConfigType().c_str(); config = this->CTest->GetConfigType().c_str();
} }
@ -321,7 +321,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) { for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) {
testCommand.push_back(this->TestCommandArgs[k].c_str()); testCommand.push_back(this->TestCommandArgs[k].c_str());
} }
testCommand.push_back(0); testCommand.push_back(CM_NULLPTR);
std::string outs; std::string outs;
int retval = 0; int retval = 0;
// run the test from the this->BuildRunDir if set // run the test from the this->BuildRunDir if set
@ -347,8 +347,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
} }
} }
int runTestRes = int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval,
this->CTest->RunTest(testCommand, &outs, &retval, 0, remainingTime, 0); CM_NULLPTR, remainingTime, CM_NULLPTR);
if (runTestRes != cmsysProcess_State_Exited || retval != 0) { if (runTestRes != cmsysProcess_State_Exited || retval != 0) {
out << "Test command failed: " << testCommand[0] << "\n"; out << "Test command failed: " << testCommand[0] << "\n";

View File

@ -19,14 +19,14 @@
cmCTestBuildCommand::cmCTestBuildCommand() cmCTestBuildCommand::cmCTestBuildCommand()
{ {
this->GlobalGenerator = 0; this->GlobalGenerator = CM_NULLPTR;
this->Arguments[ctb_NUMBER_ERRORS] = "NUMBER_ERRORS"; this->Arguments[ctb_NUMBER_ERRORS] = "NUMBER_ERRORS";
this->Arguments[ctb_NUMBER_WARNINGS] = "NUMBER_WARNINGS"; this->Arguments[ctb_NUMBER_WARNINGS] = "NUMBER_WARNINGS";
this->Arguments[ctb_TARGET] = "TARGET"; this->Arguments[ctb_TARGET] = "TARGET";
this->Arguments[ctb_CONFIGURATION] = "CONFIGURATION"; this->Arguments[ctb_CONFIGURATION] = "CONFIGURATION";
this->Arguments[ctb_FLAGS] = "FLAGS"; this->Arguments[ctb_FLAGS] = "FLAGS";
this->Arguments[ctb_PROJECT_NAME] = "PROJECT_NAME"; this->Arguments[ctb_PROJECT_NAME] = "PROJECT_NAME";
this->Arguments[ctb_LAST] = 0; this->Arguments[ctb_LAST] = CM_NULLPTR;
this->Last = ctb_LAST; this->Last = ctb_LAST;
} }
@ -34,7 +34,7 @@ cmCTestBuildCommand::~cmCTestBuildCommand()
{ {
if (this->GlobalGenerator) { if (this->GlobalGenerator) {
delete this->GlobalGenerator; delete this->GlobalGenerator;
this->GlobalGenerator = 0; this->GlobalGenerator = CM_NULLPTR;
} }
} }
@ -43,7 +43,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
cmCTestGenericHandler* handler = this->CTest->GetInitializedHandler("build"); cmCTestGenericHandler* handler = this->CTest->GetInitializedHandler("build");
if (!handler) { if (!handler) {
this->SetError("internal CTest error. Cannot instantiate build handler"); this->SetError("internal CTest error. Cannot instantiate build handler");
return 0; return CM_NULLPTR;
} }
this->Handler = (cmCTestBuildHandler*)handler; this->Handler = (cmCTestBuildHandler*)handler;
@ -91,7 +91,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
if (this->GlobalGenerator) { if (this->GlobalGenerator) {
if (this->GlobalGenerator->GetName() != cmakeGeneratorName) { if (this->GlobalGenerator->GetName() != cmakeGeneratorName) {
delete this->GlobalGenerator; delete this->GlobalGenerator;
this->GlobalGenerator = 0; this->GlobalGenerator = CM_NULLPTR;
} }
} }
if (!this->GlobalGenerator) { if (!this->GlobalGenerator) {
@ -104,11 +104,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
e += "\""; e += "\"";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured(); cmSystemTools::SetFatalErrorOccured();
return 0; return CM_NULLPTR;
} }
} }
if (strlen(cmakeBuildConfiguration) == 0) { if (strlen(cmakeBuildConfiguration) == 0) {
const char* config = 0; const char* config = CM_NULLPTR;
#ifdef CMAKE_INTDIR #ifdef CMAKE_INTDIR
config = CMAKE_INTDIR; config = CMAKE_INTDIR;
#endif #endif
@ -145,7 +145,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
"with a custom command line."; "with a custom command line.";
/* clang-format on */ /* clang-format on */
this->SetError(ostr.str()); this->SetError(ostr.str());
return 0; return CM_NULLPTR;
} }
} }

View File

@ -92,7 +92,7 @@ static const char* cmCTestErrorMatches[] = {
"^The project cannot be built\\.", "^The project cannot be built\\.",
"^\\[ERROR\\]", "^\\[ERROR\\]",
"^Command .* failed with exit code", "^Command .* failed with exit code",
0 CM_NULLPTR
}; };
static const char* cmCTestErrorExceptions[] = { static const char* cmCTestErrorExceptions[] = {
@ -107,7 +107,7 @@ static const char* cmCTestErrorExceptions[] = {
":[ \\t]+Where:", ":[ \\t]+Where:",
"([^ :]+):([0-9]+): Warning", "([^ :]+):([0-9]+): Warning",
"------ Build started: .* ------", "------ Build started: .* ------",
0 CM_NULLPTR
}; };
static const char* cmCTestWarningMatches[] = { static const char* cmCTestWarningMatches[] = {
@ -132,7 +132,7 @@ static const char* cmCTestWarningMatches[] = {
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*", "cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
"^CMake Warning.*:", "^CMake Warning.*:",
"^\\[WARNING\\]", "^\\[WARNING\\]",
0 CM_NULLPTR
}; };
static const char* cmCTestWarningExceptions[] = { static const char* cmCTestWarningExceptions[] = {
@ -152,7 +152,7 @@ static const char* cmCTestWarningExceptions[] = {
"ld32: WARNING 85: definition of dataKey in", "ld32: WARNING 85: definition of dataKey in",
"cc: warning 422: Unknown option \"\\+b", "cc: warning 422: Unknown option \"\\+b",
"_with_warning_C", "_with_warning_C",
0 CM_NULLPTR
}; };
struct cmCTestBuildCompileErrorWarningRex struct cmCTestBuildCompileErrorWarningRex
@ -170,7 +170,7 @@ static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = {
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([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 }, { "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 },
{ 0, 0, 0 } { CM_NULLPTR, 0, 0 }
}; };
cmCTestBuildHandler::cmCTestBuildHandler() cmCTestBuildHandler::cmCTestBuildHandler()
@ -521,7 +521,7 @@ public:
{ {
} }
FragmentCompare() FragmentCompare()
: FTC(0) : FTC(CM_NULLPTR)
{ {
} }
bool operator()(std::string const& l, std::string const& r) bool operator()(std::string const& l, std::string const& r)
@ -799,7 +799,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
a != args.end(); ++a) { a != args.end(); ++a) {
argv.push_back(a->c_str()); argv.push_back(a->c_str());
} }
argv.push_back(0); argv.push_back(CM_NULLPTR);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:", cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:",
this->Quiet); this->Quiet);
@ -851,7 +851,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
// For every chunk of data // For every chunk of data
int res; int res;
while ((res = cmsysProcess_WaitForData(cp, &data, &length, 0))) { while ((res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR))) {
// Replace '\0' with '\n', since '\0' does not really make sense. This is // Replace '\0' with '\n', since '\0' does not really make sense. This is
// for Visual Studio output // for Visual Studio output
for (int cc = 0; cc < length; ++cc) { for (int cc = 0; cc < length; ++cc) {
@ -870,8 +870,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
} }
} }
this->ProcessBuffer(0, 0, tick, tick_len, ofs, &this->BuildProcessingQueue); this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs,
this->ProcessBuffer(0, 0, tick, tick_len, ofs, &this->BuildProcessingQueue);
this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue); &this->BuildProcessingErrorQueue);
cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: " cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< ((this->BuildOutputLogSize + 512) / 1024) << "K" << ((this->BuildOutputLogSize + 512) / 1024) << "K"
@ -879,7 +880,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
this->Quiet); this->Quiet);
// Properly handle output of the build command // Properly handle output of the build command
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
int result = cmsysProcess_GetState(cp); int result = cmsysProcess_GetState(cp);
if (result == cmsysProcess_State_Exited) { if (result == cmsysProcess_State_Exited) {

View File

@ -103,7 +103,7 @@ bool cmCTestCVS::UpdateImpl()
ai != args.end(); ++ai) { ai != args.end(); ++ai) {
cvs_update.push_back(ai->c_str()); cvs_update.push_back(ai->c_str());
} }
cvs_update.push_back(0); cvs_update.push_back(CM_NULLPTR);
UpdateParser out(this, "up-out> "); UpdateParser out(this, "up-out> ");
UpdateParser err(this, "up-err> "); UpdateParser err(this, "up-err> ");
@ -229,7 +229,8 @@ void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
// Run "cvs log" to get revisions of this file on this branch. // Run "cvs log" to get revisions of this file on this branch.
const char* cvs = this->CommandLineTool.c_str(); const char* cvs = this->CommandLineTool.c_str();
const char* cvs_log[] = { cvs, "log", "-N", branchFlag, file.c_str(), 0 }; const char* cvs_log[] = { cvs, "log", "-N",
branchFlag, file.c_str(), CM_NULLPTR };
LogParser out(this, "log-out> ", revisions); LogParser out(this, "log-out> ", revisions);
OutputLogger err(this->Log, "log-err> "); OutputLogger err(this->Log, "log-err> ");

View File

@ -29,8 +29,8 @@ class cmCTestCommand : public cmCommand
public: public:
cmCTestCommand() cmCTestCommand()
{ {
this->CTest = 0; this->CTest = CM_NULLPTR;
this->CTestScriptHandler = 0; this->CTestScriptHandler = CM_NULLPTR;
} }
cmCTest* CTest; cmCTest* CTest;

View File

@ -18,7 +18,7 @@
cmCTestConfigureCommand::cmCTestConfigureCommand() cmCTestConfigureCommand::cmCTestConfigureCommand()
{ {
this->Arguments[ctc_OPTIONS] = "OPTIONS"; this->Arguments[ctc_OPTIONS] = "OPTIONS";
this->Arguments[ctc_LAST] = 0; this->Arguments[ctc_LAST] = CM_NULLPTR;
this->Last = ctc_LAST; this->Last = ctc_LAST;
} }
@ -35,7 +35,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Build directory not specified. Either use BUILD " "Build directory not specified. Either use BUILD "
"argument to CTEST_CONFIGURE command or set CTEST_BINARY_DIRECTORY " "argument to CTEST_CONFIGURE command or set CTEST_BINARY_DIRECTORY "
"variable"); "variable");
return 0; return CM_NULLPTR;
} }
const char* ctestConfigureCommand = const char* ctestConfigureCommand =
@ -55,7 +55,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Source directory not specified. Either use SOURCE " "Source directory not specified. Either use SOURCE "
"argument to CTEST_CONFIGURE command or set CTEST_SOURCE_DIRECTORY " "argument to CTEST_CONFIGURE command or set CTEST_SOURCE_DIRECTORY "
"variable"); "variable");
return 0; return CM_NULLPTR;
} }
const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; const std::string cmakelists_file = source_dir + "/CMakeLists.txt";
@ -63,7 +63,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
std::ostringstream e; std::ostringstream e;
e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]";
this->SetError(e.str()); this->SetError(e.str());
return 0; return CM_NULLPTR;
} }
bool multiConfig = false; bool multiConfig = false;
@ -90,8 +90,9 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += option; cmakeConfigureCommand += option;
cmakeConfigureCommand += "\""; cmakeConfigureCommand += "\"";
if ((0 != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) || if ((CM_NULLPTR != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) ||
(0 != strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) { (CM_NULLPTR !=
strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) {
cmakeBuildTypeInOptions = true; cmakeBuildTypeInOptions = true;
} }
} }
@ -134,7 +135,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Configure command is not specified. If this is a " "Configure command is not specified. If this is a "
"\"built with CMake\" project, set CTEST_CMAKE_GENERATOR. If not, " "\"built with CMake\" project, set CTEST_CMAKE_GENERATOR. If not, "
"set CTEST_CONFIGURE_COMMAND."); "set CTEST_CONFIGURE_COMMAND.");
return 0; return CM_NULLPTR;
} }
} }
@ -143,7 +144,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
if (!handler) { if (!handler) {
this->SetError( this->SetError(
"internal CTest error. Cannot instantiate configure handler"); "internal CTest error. Cannot instantiate configure handler");
return 0; return CM_NULLPTR;
} }
handler->SetQuiet(this->Quiet); handler->SetQuiet(this->Quiet);
return handler; return handler;

View File

@ -30,7 +30,7 @@ cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler()
this->CTest->GetInitializedHandler("coverage")); this->CTest->GetInitializedHandler("coverage"));
if (!handler) { if (!handler) {
this->SetError("internal CTest error. Cannot instantiate test handler"); this->SetError("internal CTest error. Cannot instantiate test handler");
return 0; return CM_NULLPTR;
} }
// If a LABELS option was given, select only files with the labels. // If a LABELS option was given, select only files with the labels.

View File

@ -76,7 +76,7 @@ public:
i != this->CommandLineStrings.end(); ++i) { i != this->CommandLineStrings.end(); ++i) {
args.push_back(i->c_str()); args.push_back(i->c_str());
} }
args.push_back(0); // null terminate args.push_back(CM_NULLPTR); // null terminate
cmsysProcess_SetCommand(this->Process, &*args.begin()); cmsysProcess_SetCommand(this->Process, &*args.begin());
if (!this->WorkingDirectory.empty()) { if (!this->WorkingDirectory.empty()) {
cmsysProcess_SetWorkingDirectory(this->Process, cmsysProcess_SetWorkingDirectory(this->Process,
@ -101,7 +101,7 @@ public:
{ {
cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname); cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname);
} }
int WaitForExit(double* timeout = 0) int WaitForExit(double* timeout = CM_NULLPTR)
{ {
this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout); this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
return this->PipeState; return this->PipeState;
@ -1781,7 +1781,7 @@ const char* bullseyeHelp[] = {
" condition evaluated true or false, respectively.", " condition evaluated true or false, respectively.",
" * A k indicates a constant decision or condition.", " * A k indicates a constant decision or condition.",
" * The slash / means this probe is excluded from summary results. ", " * The slash / means this probe is excluded from summary results. ",
0 CM_NULLPTR
}; };
} }
@ -1809,7 +1809,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"run covbr: " << std::endl, this->Quiet); "run covbr: " << std::endl, this->Quiet);
if (!this->RunBullseyeCommand(cont, "covbr", 0, outputFile)) { if (!this->RunBullseyeCommand(cont, "covbr", CM_NULLPTR, outputFile)) {
cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for."
<< "\n"); << "\n");
return -1; return -1;
@ -1882,7 +1882,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
covLogXML.StartElement("Report"); covLogXML.StartElement("Report");
// write the bullseye header // write the bullseye header
line = 0; line = 0;
for (int k = 0; bullseyeHelp[k] != 0; ++k) { for (int k = 0; bullseyeHelp[k] != CM_NULLPTR; ++k) {
covLogXML.StartElement("Line"); covLogXML.StartElement("Line");
covLogXML.Attribute("Number", line); covLogXML.Attribute("Number", line);
covLogXML.Attribute("Count", -1); covLogXML.Attribute("Count", -1);

View File

@ -147,7 +147,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback); ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback);
// Be sure to set Content-Type to satisfy fussy modsecurity rules // Be sure to set Content-Type to satisfy fussy modsecurity rules
struct curl_slist* headers = struct curl_slist* headers =
::curl_slist_append(NULL, "Content-Type: text/xml"); ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml");
::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers); ::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers);
std::vector<char> responseData; std::vector<char> responseData;
std::vector<char> debugData; std::vector<char> debugData;

View File

@ -64,7 +64,8 @@ std::string cmCTestGIT::GetWorkingRevision()
{ {
// Run plumbing "git rev-list" to get work tree revision. // Run plumbing "git rev-list" to get work tree revision.
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
const char* git_rev_list[] = { git, "rev-list", "-n", "1", "HEAD", "--", 0 }; const char* git_rev_list[] = { git, "rev-list", "-n", "1",
"HEAD", "--", CM_NULLPTR };
std::string rev; std::string rev;
OneLineParser out(this, "rl-out> ", rev); OneLineParser out(this, "rl-out> ", rev);
OutputLogger err(this->Log, "rl-err> "); OutputLogger err(this->Log, "rl-err> ");
@ -93,7 +94,7 @@ std::string cmCTestGIT::FindGitDir()
// Run "git rev-parse --git-dir" to locate the real .git directory. // Run "git rev-parse --git-dir" to locate the real .git directory.
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", 0 }; char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", CM_NULLPTR };
std::string git_dir_line; std::string git_dir_line;
OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line); OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
@ -135,7 +136,8 @@ std::string cmCTestGIT::FindTopDir()
// Run "git rev-parse --show-cdup" to locate the top of the tree. // Run "git rev-parse --show-cdup" to locate the top of the tree.
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", 0 }; char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup",
CM_NULLPTR };
std::string cdup; std::string cdup;
OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup); OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
@ -169,7 +171,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
} }
// Sentinel argument. // Sentinel argument.
git_fetch.push_back(0); git_fetch.push_back(CM_NULLPTR);
// Fetch upstream refs. // Fetch upstream refs.
OutputLogger fetch_out(this->Log, "fetch-out> "); OutputLogger fetch_out(this->Log, "fetch-out> ");
@ -204,7 +206,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
} }
// Reset the local branch to point at that tracked from upstream. // Reset the local branch to point at that tracked from upstream.
char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), 0 }; char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(),
CM_NULLPTR };
OutputLogger reset_out(this->Log, "reset-out> "); OutputLogger reset_out(this->Log, "reset-out> ");
OutputLogger reset_err(this->Log, "reset-err> "); OutputLogger reset_err(this->Log, "reset-err> ");
return this->RunChild(&git_reset[0], &reset_out, &reset_err); return this->RunChild(&git_reset[0], &reset_out, &reset_err);
@ -219,7 +222,7 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
i != git_custom_command.end(); ++i) { i != git_custom_command.end(); ++i) {
git_custom.push_back(i->c_str()); git_custom.push_back(i->c_str());
} }
git_custom.push_back(0); git_custom.push_back(CM_NULLPTR);
OutputLogger custom_out(this->Log, "custom-out> "); OutputLogger custom_out(this->Log, "custom-out> ");
OutputLogger custom_err(this->Log, "custom-err> "); OutputLogger custom_err(this->Log, "custom-err> ");
@ -248,7 +251,7 @@ bool cmCTestGIT::UpdateImpl()
// Git < 1.6.5 did not support submodule --recursive // Git < 1.6.5 did not support submodule --recursive
if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) { if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) {
recursive = 0; recursive = CM_NULLPTR;
// No need to require >= 1.6.5 if there are no submodules. // No need to require >= 1.6.5 if there are no submodules.
if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) {
this->Log << "Git < 1.6.5 cannot update submodules recursively\n"; this->Log << "Git < 1.6.5 cannot update submodules recursively\n";
@ -257,7 +260,7 @@ bool cmCTestGIT::UpdateImpl()
// Git < 1.8.1 did not support sync --recursive // Git < 1.8.1 did not support sync --recursive
if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) { if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) {
sync_recursive = 0; sync_recursive = CM_NULLPTR;
// No need to require >= 1.8.1 if there are no submodules. // No need to require >= 1.8.1 if there are no submodules.
if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) {
this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n"; this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n";
@ -272,7 +275,8 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules = std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules"); this->CTest->GetCTestConfiguration("GITInitSubmodules");
if (cmSystemTools::IsOn(init_submodules.c_str())) { if (cmSystemTools::IsOn(init_submodules.c_str())) {
char const* git_submodule_init[] = { git, "submodule", "init", 0 }; char const* git_submodule_init[] = { git, "submodule", "init",
CM_NULLPTR };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err, ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
top_dir.c_str()); top_dir.c_str());
@ -282,7 +286,7 @@ bool cmCTestGIT::UpdateImpl()
} }
char const* git_submodule_sync[] = { git, "submodule", "sync", char const* git_submodule_sync[] = { git, "submodule", "sync",
sync_recursive, 0 }; sync_recursive, CM_NULLPTR };
ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err, ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err,
top_dir.c_str()); top_dir.c_str());
@ -290,7 +294,8 @@ bool cmCTestGIT::UpdateImpl()
return false; return false;
} }
char const* git_submodule[] = { git, "submodule", "update", recursive, 0 }; char const* git_submodule[] = { git, "submodule", "update", recursive,
CM_NULLPTR };
return this->RunChild(git_submodule, &submodule_out, &submodule_err, return this->RunChild(git_submodule, &submodule_out, &submodule_err,
top_dir.c_str()); top_dir.c_str());
} }
@ -299,7 +304,7 @@ unsigned int cmCTestGIT::GetGitVersion()
{ {
if (!this->CurrentGitVersion) { if (!this->CurrentGitVersion) {
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
char const* git_version[] = { git, "--version", 0 }; char const* git_version[] = { git, "--version", CM_NULLPTR };
std::string version; std::string version;
OneLineParser version_out(this, "version-out> ", version); OneLineParser version_out(this, "version-out> ", version);
OutputLogger version_err(this->Log, "version-err> "); OutputLogger version_err(this->Log, "version-err> ");
@ -611,10 +616,10 @@ void cmCTestGIT::LoadRevisions()
std::string range = this->OldRevision + ".." + this->NewRevision; std::string range = this->OldRevision + ".." + this->NewRevision;
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
const char* git_rev_list[] = { git, "rev-list", "--reverse", const char* git_rev_list[] = { git, "rev-list", "--reverse",
range.c_str(), "--", 0 }; range.c_str(), "--", CM_NULLPTR };
const char* git_diff_tree[] = { const char* git_diff_tree[] = {
git, "diff-tree", "--stdin", "--always", "-z", git, "diff-tree", "--stdin", "--always", "-z",
"-r", "--pretty=raw", "--encoding=utf-8", 0 "-r", "--pretty=raw", "--encoding=utf-8", CM_NULLPTR
}; };
this->Log << this->ComputeCommandLine(git_rev_list) << " | " this->Log << this->ComputeCommandLine(git_rev_list) << " | "
<< this->ComputeCommandLine(git_diff_tree) << "\n"; << this->ComputeCommandLine(git_diff_tree) << "\n";
@ -639,13 +644,15 @@ void cmCTestGIT::LoadModifications()
const char* git = this->CommandLineTool.c_str(); const char* git = this->CommandLineTool.c_str();
// Use 'git update-index' to refresh the index w.r.t. the work tree. // Use 'git update-index' to refresh the index w.r.t. the work tree.
const char* git_update_index[] = { git, "update-index", "--refresh", 0 }; const char* git_update_index[] = { git, "update-index", "--refresh",
CM_NULLPTR };
OutputLogger ui_out(this->Log, "ui-out> "); OutputLogger ui_out(this->Log, "ui-out> ");
OutputLogger ui_err(this->Log, "ui-err> "); OutputLogger ui_err(this->Log, "ui-err> ");
this->RunChild(git_update_index, &ui_out, &ui_err); this->RunChild(git_update_index, &ui_out, &ui_err);
// Use 'git diff-index' to get modified files. // Use 'git diff-index' to get modified files.
const char* git_diff_index[] = { git, "diff-index", "-z", "HEAD", "--", 0 }; const char* git_diff_index[] = { git, "diff-index", "-z",
"HEAD", "--", CM_NULLPTR };
DiffParser out(this, "di-out> "); DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> "); OutputLogger err(this->Log, "di-err> ");
this->RunChild(git_diff_index, &out, &err); this->RunChild(git_diff_index, &out, &err);

View File

@ -19,7 +19,7 @@
cmCTestGenericHandler::cmCTestGenericHandler() cmCTestGenericHandler::cmCTestGenericHandler()
{ {
this->HandlerVerbose = cmSystemTools::OUTPUT_NONE; this->HandlerVerbose = cmSystemTools::OUTPUT_NONE;
this->CTest = 0; this->CTest = CM_NULLPTR;
this->SubmitIndex = 0; this->SubmitIndex = 0;
this->AppendXML = false; this->AppendXML = false;
this->Quiet = false; this->Quiet = false;
@ -77,7 +77,7 @@ const char* cmCTestGenericHandler::GetOption(const std::string& op)
cmCTestGenericHandler::t_StringToString::iterator remit = cmCTestGenericHandler::t_StringToString::iterator remit =
this->Options.find(op); this->Options.find(op);
if (remit == this->Options.end()) { if (remit == this->Options.end()) {
return 0; return CM_NULLPTR;
} }
return remit->second.c_str(); return remit->second.c_str();
} }

View File

@ -101,7 +101,7 @@ std::string cmCTestHG::GetWorkingRevision()
{ {
// Run plumbing "hg identify" to get work tree revision. // Run plumbing "hg identify" to get work tree revision.
const char* hg = this->CommandLineTool.c_str(); const char* hg = this->CommandLineTool.c_str();
const char* hg_identify[] = { hg, "identify", "-i", 0 }; const char* hg_identify[] = { hg, "identify", "-i", CM_NULLPTR };
std::string rev; std::string rev;
IdentifyParser out(this, "rev-out> ", rev); IdentifyParser out(this, "rev-out> ", rev);
OutputLogger err(this->Log, "rev-err> "); OutputLogger err(this->Log, "rev-err> ");
@ -129,7 +129,7 @@ bool cmCTestHG::UpdateImpl()
// Use "hg pull" followed by "hg update" to update the working tree. // Use "hg pull" followed by "hg update" to update the working tree.
{ {
const char* hg = this->CommandLineTool.c_str(); const char* hg = this->CommandLineTool.c_str();
const char* hg_pull[] = { hg, "pull", "-v", 0 }; const char* hg_pull[] = { hg, "pull", "-v", CM_NULLPTR };
OutputLogger out(this->Log, "pull-out> "); OutputLogger out(this->Log, "pull-out> ");
OutputLogger err(this->Log, "pull-err> "); OutputLogger err(this->Log, "pull-err> ");
this->RunChild(&hg_pull[0], &out, &err); this->RunChild(&hg_pull[0], &out, &err);
@ -154,7 +154,7 @@ bool cmCTestHG::UpdateImpl()
} }
// Sentinel argument. // Sentinel argument.
hg_update.push_back(0); hg_update.push_back(CM_NULLPTR);
OutputLogger out(this->Log, "update-out> "); OutputLogger out(this->Log, "update-out> ");
OutputLogger err(this->Log, "update-err> "); OutputLogger err(this->Log, "update-err> ");
@ -288,7 +288,8 @@ void cmCTestHG::LoadRevisions()
" <file_dels>{file_dels}</file_dels>\n" " <file_dels>{file_dels}</file_dels>\n"
"</logentry>\n"; "</logentry>\n";
const char* hg_log[] = { const char* hg_log[] = {
hg, "log", "--removed", "-r", range.c_str(), "--template", hgXMLTemplate, 0 hg, "log", "--removed", "-r", range.c_str(),
"--template", hgXMLTemplate, CM_NULLPTR
}; };
LogParser out(this, "log-out> "); LogParser out(this, "log-out> ");
@ -303,7 +304,7 @@ void cmCTestHG::LoadModifications()
{ {
// Use 'hg status' to get modified files. // Use 'hg status' to get modified files.
const char* hg = this->CommandLineTool.c_str(); const char* hg = this->CommandLineTool.c_str();
const char* hg_status[] = { hg, "status", 0 }; const char* hg_status[] = { hg, "status", CM_NULLPTR };
StatusParser out(this, "status-out> "); StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> "); OutputLogger err(this->Log, "status-err> ");
this->RunChild(hg_status, &out, &err); this->RunChild(hg_status, &out, &err);

View File

@ -20,7 +20,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand()
size_t cc; size_t cc;
this->Arguments.reserve(INIT_SIZE); this->Arguments.reserve(INIT_SIZE);
for (cc = 0; cc < INIT_SIZE; ++cc) { for (cc = 0; cc < INIT_SIZE; ++cc) {
this->Arguments.push_back(0); this->Arguments.push_back(CM_NULLPTR);
} }
this->Arguments[ct_RETURN_VALUE] = "RETURN_VALUE"; this->Arguments[ct_RETURN_VALUE] = "RETURN_VALUE";
this->Arguments[ct_SOURCE] = "SOURCE"; this->Arguments[ct_SOURCE] = "SOURCE";
@ -36,7 +36,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
{ {
// Allocate space for argument values. // Allocate space for argument values.
this->Values.clear(); this->Values.clear();
this->Values.resize(this->Last, 0); this->Values.resize(this->Last, CM_NULLPTR);
// Process input arguments. // Process input arguments.
this->ArgumentDoing = ArgumentDoingNone; this->ArgumentDoing = ArgumentDoingNone;

View File

@ -30,7 +30,7 @@
cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv)
{ {
this->Passthru = true; this->Passthru = true;
this->Process = 0; this->Process = CM_NULLPTR;
this->ExitCode = 1; this->ExitCode = 1;
this->CWD = cmSystemTools::GetCurrentWorkingDirectory(); this->CWD = cmSystemTools::GetCurrentWorkingDirectory();
@ -128,7 +128,7 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
return true; return true;
} else { } else {
this->RealArgC = 0; this->RealArgC = 0;
this->RealArgV = 0; this->RealArgV = CM_NULLPTR;
std::cerr << "No launch/command separator ('--') found!\n"; std::cerr << "No launch/command separator ('--') found!\n";
return false; return false;
} }
@ -227,9 +227,9 @@ void cmCTestLaunch::RunChild()
// Record child stdout and stderr if necessary. // Record child stdout and stderr if necessary.
if (!this->Passthru) { if (!this->Passthru) {
char* data = 0; char* data = CM_NULLPTR;
int length = 0; int length = 0;
while (int p = cmsysProcess_WaitForData(cp, &data, &length, 0)) { while (int p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
if (p == cmsysProcess_Pipe_STDOUT) { if (p == cmsysProcess_Pipe_STDOUT) {
fout.write(data, length); fout.write(data, length);
std::cout.write(data, length); std::cout.write(data, length);
@ -243,7 +243,7 @@ void cmCTestLaunch::RunChild()
} }
// Wait for the real command to finish. // Wait for the real command to finish.
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
this->ExitCode = cmsysProcess_GetExitValue(cp); this->ExitCode = cmsysProcess_GetExitValue(cp);
} }
@ -384,7 +384,7 @@ void cmCTestLaunch::WriteXMLAction(cmXMLWriter& xml)
} }
// OutputType // OutputType
const char* outputType = 0; const char* outputType = CM_NULLPTR;
if (!this->OptionTargetType.empty()) { if (!this->OptionTargetType.empty()) {
if (this->OptionTargetType == "EXECUTABLE") { if (this->OptionTargetType == "EXECUTABLE") {
outputType = "executable"; outputType = "executable";

View File

@ -42,7 +42,7 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = {
{ "Allocation Conflict", cmCTestMemCheckHandler::FMM }, { "Allocation Conflict", cmCTestMemCheckHandler::FMM },
{ "Bad Pointer Use", cmCTestMemCheckHandler::FMW }, { "Bad Pointer Use", cmCTestMemCheckHandler::FMW },
{ "Dangling Pointer", cmCTestMemCheckHandler::FMR }, { "Dangling Pointer", cmCTestMemCheckHandler::FMR },
{ 0, 0 } { CM_NULLPTR, 0 }
}; };
static void xmlReportError(int line, const char* msg, void* data) static void xmlReportError(int line, const char* msg, void* data)
@ -72,7 +72,7 @@ public:
std::ostringstream ostr; std::ostringstream ostr;
ostr << name << ":\n"; ostr << name << ":\n";
int i = 0; int i = 0;
for (; atts[i] != 0; i += 2) { for (; atts[i] != CM_NULLPTR; i += 2) {
ostr << " " << atts[i] << " - " << atts[i + 1] << "\n"; ostr << " " << atts[i] << " - " << atts[i + 1] << "\n";
} }
ostr << "\n"; ostr << "\n";
@ -83,12 +83,12 @@ public:
const char* GetAttribute(const char* name, const char** atts) const char* GetAttribute(const char* name, const char** atts)
{ {
int i = 0; int i = 0;
for (; atts[i] != 0; ++i) { for (; atts[i] != CM_NULLPTR; ++i) {
if (strcmp(name, atts[i]) == 0) { if (strcmp(name, atts[i]) == 0) {
return atts[i + 1]; return atts[i + 1];
} }
} }
return 0; return CM_NULLPTR;
} }
void ParseError(const char** atts) void ParseError(const char** atts)
{ {
@ -243,7 +243,7 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
static const char* cmCTestMemCheckResultStrings[] = { static const char* cmCTestMemCheckResultStrings[] = {
"ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM", "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM",
"FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK", "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK",
"NPR", "ODS", "PAR", "PLK", "UMC", "UMR", 0 "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", CM_NULLPTR
}; };
static const char* cmCTestMemCheckResultLongStrings[] = { static const char* cmCTestMemCheckResultLongStrings[] = {
"Threading Problem", "Threading Problem",
@ -268,10 +268,10 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
"PLK", "PLK",
"Uninitialized Memory Conditional", "Uninitialized Memory Conditional",
"Uninitialized Memory Read", "Uninitialized Memory Read",
0 CM_NULLPTR
}; };
this->GlobalResults.clear(); this->GlobalResults.clear();
for (int i = 0; cmCTestMemCheckResultStrings[i] != 0; ++i) { for (int i = 0; cmCTestMemCheckResultStrings[i] != CM_NULLPTR; ++i) {
this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]); this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]);
this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]); this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]);
this->GlobalResults.push_back(0); this->GlobalResults.push_back(0);

View File

@ -163,7 +163,7 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
p4_users.push_back("-m"); p4_users.push_back("-m");
p4_users.push_back("1"); p4_users.push_back("1");
p4_users.push_back(username.c_str()); p4_users.push_back(username.c_str());
p4_users.push_back(0); p4_users.push_back(CM_NULLPTR);
UserParser out(this, "users-out> "); UserParser out(this, "users-out> ");
OutputLogger err(this->Log, "users-err> "); OutputLogger err(this->Log, "users-err> ");
@ -358,7 +358,7 @@ std::string cmCTestP4::GetWorkingRevision()
std::string source = this->SourceDirectory + "/...#have"; std::string source = this->SourceDirectory + "/...#have";
p4_identify.push_back(source.c_str()); p4_identify.push_back(source.c_str());
p4_identify.push_back(0); p4_identify.push_back(CM_NULLPTR);
std::string rev; std::string rev;
IdentifyParser out(this, "p4_changes-out> ", rev); IdentifyParser out(this, "p4_changes-out> ", rev);
@ -418,7 +418,7 @@ void cmCTestP4::LoadRevisions()
p4_changes.push_back("changes"); p4_changes.push_back("changes");
p4_changes.push_back(range.c_str()); p4_changes.push_back(range.c_str());
p4_changes.push_back(0); p4_changes.push_back(CM_NULLPTR);
ChangesParser out(this, "p4_changes-out> "); ChangesParser out(this, "p4_changes-out> ");
OutputLogger err(this->Log, "p4_changes-err> "); OutputLogger err(this->Log, "p4_changes-err> ");
@ -438,7 +438,7 @@ void cmCTestP4::LoadRevisions()
p4_describe.push_back("describe"); p4_describe.push_back("describe");
p4_describe.push_back("-s"); p4_describe.push_back("-s");
p4_describe.push_back(i->c_str()); p4_describe.push_back(i->c_str());
p4_describe.push_back(0); p4_describe.push_back(CM_NULLPTR);
DescribeParser outDescribe(this, "p4_describe-out> "); DescribeParser outDescribe(this, "p4_describe-out> ");
OutputLogger errDescribe(this->Log, "p4_describe-err> "); OutputLogger errDescribe(this->Log, "p4_describe-err> ");
@ -457,7 +457,7 @@ void cmCTestP4::LoadModifications()
p4_diff.push_back("-dn"); p4_diff.push_back("-dn");
std::string source = this->SourceDirectory + "/..."; std::string source = this->SourceDirectory + "/...";
p4_diff.push_back(source.c_str()); p4_diff.push_back(source.c_str());
p4_diff.push_back(0); p4_diff.push_back(CM_NULLPTR);
DiffParser out(this, "p4_diff-out> "); DiffParser out(this, "p4_diff-out> ");
OutputLogger err(this->Log, "p4_diff-err> "); OutputLogger err(this->Log, "p4_diff-err> ");
@ -474,7 +474,7 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
i != p4_custom_command.end(); ++i) { i != p4_custom_command.end(); ++i) {
p4_custom.push_back(i->c_str()); p4_custom.push_back(i->c_str());
} }
p4_custom.push_back(0); p4_custom.push_back(CM_NULLPTR);
OutputLogger custom_out(this->Log, "p4_customsync-out> "); OutputLogger custom_out(this->Log, "p4_customsync-out> ");
OutputLogger custom_err(this->Log, "p4_customsync-err> "); OutputLogger custom_err(this->Log, "p4_customsync-err> ");
@ -525,7 +525,7 @@ bool cmCTestP4::UpdateImpl()
} }
p4_sync.push_back(source.c_str()); p4_sync.push_back(source.c_str());
p4_sync.push_back(0); p4_sync.push_back(CM_NULLPTR);
OutputLogger out(this->Log, "p4_sync-out> "); OutputLogger out(this->Log, "p4_sync-out> ");
OutputLogger err(this->Log, "p4_sync-err> "); OutputLogger err(this->Log, "p4_sync-err> ");

View File

@ -24,12 +24,12 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
{ {
this->CTest = handler->CTest; this->CTest = handler->CTest;
this->TestHandler = handler; this->TestHandler = handler;
this->TestProcess = 0; this->TestProcess = CM_NULLPTR;
this->TestResult.ExecutionTime = 0; this->TestResult.ExecutionTime = 0;
this->TestResult.ReturnValue = 0; this->TestResult.ReturnValue = 0;
this->TestResult.Status = cmCTestTestHandler::NOT_RUN; this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
this->TestResult.TestCount = 0; this->TestResult.TestCount = 0;
this->TestResult.Properties = 0; this->TestResult.Properties = CM_NULLPTR;
this->ProcessOutput = ""; this->ProcessOutput = "";
this->CompressedOutput = ""; this->CompressedOutput = "";
this->CompressionRatio = 2; this->CompressionRatio = 2;
@ -577,7 +577,7 @@ double cmCTestRunTest::ResolveTimeout()
return timeout; return timeout;
} }
struct tm* lctime; struct tm* lctime;
time_t current_time = time(0); time_t current_time = time(CM_NULLPTR);
lctime = gmtime(&current_time); lctime = gmtime(&current_time);
int gm_hour = lctime->tm_hour; int gm_hour = lctime->tm_hour;
time_t gm_time = mktime(lctime); time_t gm_time = mktime(lctime);

View File

@ -291,7 +291,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
args.push_back(i->c_str()); args.push_back(i->c_str());
} }
args.push_back(0); args.push_back(CM_NULLPTR);
if (strcmp(parameters[0], "update") == 0) { if (strcmp(parameters[0], "update") == 0) {
return RunUpdateCommand(&args[0], out, err); return RunUpdateCommand(&args[0], out, err);

View File

@ -82,9 +82,9 @@ cmCTestScriptHandler::cmCTestScriptHandler()
this->Backup = false; this->Backup = false;
this->EmptyBinDir = false; this->EmptyBinDir = false;
this->EmptyBinDirOnce = false; this->EmptyBinDirOnce = false;
this->Makefile = 0; this->Makefile = CM_NULLPTR;
this->CMake = 0; this->CMake = CM_NULLPTR;
this->GlobalGenerator = 0; this->GlobalGenerator = CM_NULLPTR;
this->ScriptStartTime = 0; this->ScriptStartTime = 0;
@ -121,10 +121,10 @@ void cmCTestScriptHandler::Initialize()
this->ScriptStartTime = 0; this->ScriptStartTime = 0;
delete this->Makefile; delete this->Makefile;
this->Makefile = 0; this->Makefile = CM_NULLPTR;
delete this->GlobalGenerator; delete this->GlobalGenerator;
this->GlobalGenerator = 0; this->GlobalGenerator = CM_NULLPTR;
delete this->CMake; delete this->CMake;
} }
@ -200,7 +200,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
for (size_t i = 1; i < initArgs.size(); ++i) { for (size_t i = 1; i < initArgs.size(); ++i) {
argv.push_back(initArgs[i].c_str()); argv.push_back(initArgs[i].c_str());
} }
argv.push_back(0); argv.push_back(CM_NULLPTR);
// Now create process object // Now create process object
cmsysProcess* cp = cmsysProcess_New(); cmsysProcess* cp = cmsysProcess_New();
@ -226,7 +226,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
} }
// Properly handle output of the build command // Properly handle output of the build command
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
int result = cmsysProcess_GetState(cp); int result = cmsysProcess_GetState(cp);
int retVal = 0; int retVal = 0;
bool failed = false; bool failed = false;
@ -863,7 +863,7 @@ bool cmCTestScriptHandler::WriteInitialCache(const char* directory,
return false; return false;
} }
if (text != 0) { if (text != CM_NULLPTR) {
fout.write(text, strlen(text)); fout.write(text, strlen(text));
} }

View File

@ -32,12 +32,12 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
size_t cnt = 0; size_t cnt = 0;
const char* smodel = args[cnt].c_str(); const char* smodel = args[cnt].c_str();
const char* src_dir = 0; const char* src_dir = CM_NULLPTR;
const char* bld_dir = 0; const char* bld_dir = CM_NULLPTR;
cnt++; cnt++;
this->CTest->SetSpecificTrack(0); this->CTest->SetSpecificTrack(CM_NULLPTR);
if (cnt < args.size() - 1) { if (cnt < args.size() - 1) {
if (args[cnt] == "TRACK") { if (args[cnt] == "TRACK") {
cnt++; cnt++;

View File

@ -88,7 +88,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
extraFiles.end()); extraFiles.end());
if (!this->CTest->SubmitExtraFiles(newExtraFiles)) { if (!this->CTest->SubmitExtraFiles(newExtraFiles)) {
this->SetError("problem submitting extra files."); this->SetError("problem submitting extra files.");
return 0; return CM_NULLPTR;
} }
} }
@ -96,7 +96,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->CTest->GetInitializedHandler("submit"); this->CTest->GetInitializedHandler("submit");
if (!handler) { if (!handler) {
this->SetError("internal CTest error. Cannot instantiate submit handler"); this->SetError("internal CTest error. Cannot instantiate submit handler");
return 0; return CM_NULLPTR;
} }
// If no FILES or PARTS given, *all* PARTS are submitted by default. // If no FILES or PARTS given, *all* PARTS are submitted by default.

View File

@ -150,7 +150,7 @@ void cmCTestSubmitHandler::Initialize()
this->HTTPProxyAuth = ""; this->HTTPProxyAuth = "";
this->FTPProxy = ""; this->FTPProxy = "";
this->FTPProxyType = 0; this->FTPProxyType = 0;
this->LogFile = 0; this->LogFile = CM_NULLPTR;
this->Files.clear(); this->Files.clear();
} }
@ -308,7 +308,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
FILE* ftpfile; FILE* ftpfile;
char error_buffer[1024]; char error_buffer[1024];
struct curl_slist* headers = struct curl_slist* headers =
::curl_slist_append(NULL, "Content-Type: text/xml"); ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml");
/* In windows, this will init the winsock stuff */ /* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL); ::curl_global_init(CURL_GLOBAL_ALL);
@ -507,10 +507,10 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
// If curl failed for any reason, or checksum fails, wait and retry // If curl failed for any reason, or checksum fails, wait and retry
// //
if (res != CURLE_OK || this->HasErrors) { if (res != CURLE_OK || this->HasErrors) {
std::string retryDelay = this->GetOption("RetryDelay") == NULL std::string retryDelay = this->GetOption("RetryDelay") == CM_NULLPTR
? "" ? ""
: this->GetOption("RetryDelay"); : this->GetOption("RetryDelay");
std::string retryCount = this->GetOption("RetryCount") == NULL std::string retryCount = this->GetOption("RetryCount") == CM_NULLPTR
? "" ? ""
: this->GetOption("RetryCount"); : this->GetOption("RetryCount");
@ -776,7 +776,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
argv.push_back(scp_command.c_str()); // Scp command argv.push_back(scp_command.c_str()); // Scp command
argv.push_back(scp_command.c_str()); // Dummy string for file 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(scp_command.c_str()); // Dummy string for remote url
argv.push_back(0); argv.push_back(CM_NULLPTR);
cmsysProcess* cp = cmsysProcess_New(); cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
@ -807,12 +807,12 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
char* data; char* data;
int length; int length;
while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
cmCTestLogWrite(data, length), this->Quiet); cmCTestLogWrite(data, length), this->Quiet);
} }
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
int result = cmsysProcess_GetState(cp); int result = cmsysProcess_GetState(cp);

View File

@ -26,7 +26,7 @@ public:
cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler); cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler);
cmCTestSubmitHandler(); cmCTestSubmitHandler();
~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = 0; } ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = CM_NULLPTR; }
/* /*
* The main entry point for this class * The main entry point for this class

View File

@ -27,7 +27,7 @@ cmCTestTestCommand::cmCTestTestCommand()
this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM"; this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM";
this->Arguments[ctt_STOP_TIME] = "STOP_TIME"; this->Arguments[ctt_STOP_TIME] = "STOP_TIME";
this->Arguments[ctt_TEST_LOAD] = "TEST_LOAD"; this->Arguments[ctt_TEST_LOAD] = "TEST_LOAD";
this->Arguments[ctt_LAST] = 0; this->Arguments[ctt_LAST] = CM_NULLPTR;
this->Last = ctt_LAST; this->Last = ctt_LAST;
} }

View File

@ -336,7 +336,7 @@ cmCTestTestHandler::cmCTestTestHandler()
this->MemCheck = false; this->MemCheck = false;
this->LogFile = 0; this->LogFile = CM_NULLPTR;
// regex to detect <DartMeasurement>...</DartMeasurement> // regex to detect <DartMeasurement>...</DartMeasurement>
this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)"); this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
@ -550,7 +550,7 @@ int cmCTestTestHandler::ProcessHandler()
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create "
<< (this->MemCheck ? "memory check" : "testing") << (this->MemCheck ? "memory check" : "testing")
<< " XML file" << std::endl); << " XML file" << std::endl);
this->LogFile = 0; this->LogFile = CM_NULLPTR;
return 1; return 1;
} }
cmXMLWriter xml(xmlfile); cmXMLWriter xml(xmlfile);
@ -558,15 +558,15 @@ int cmCTestTestHandler::ProcessHandler()
} }
if (!this->PostProcessHandler()) { if (!this->PostProcessHandler()) {
this->LogFile = 0; this->LogFile = CM_NULLPTR;
return -1; return -1;
} }
if (!failed.empty()) { if (!failed.empty()) {
this->LogFile = 0; this->LogFile = CM_NULLPTR;
return -1; return -1;
} }
this->LogFile = 0; this->LogFile = CM_NULLPTR;
return 0; return 0;
} }
@ -936,7 +936,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
bool randomSchedule = this->CTest->GetScheduleType() == "Random"; bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if (randomSchedule) { if (randomSchedule) {
srand((unsigned)time(0)); srand((unsigned)time(CM_NULLPTR));
} }
for (ListOfTests::iterator it = this->TestList.begin(); for (ListOfTests::iterator it = this->TestList.begin();
@ -1154,7 +1154,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
int retVal = 0; int retVal = 0;
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run command: " << *it << std::endl, this->Quiet); "Run command: " << *it << std::endl, this->Quiet);
if (!cmSystemTools::RunSingleCommand(it->c_str(), 0, 0, &retVal, 0, if (!cmSystemTools::RunSingleCommand(it->c_str(), CM_NULLPTR, CM_NULLPTR,
&retVal, CM_NULLPTR,
cmSystemTools::OUTPUT_MERGE cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || /*this->Verbose*/) ||
retVal != 0) { retVal != 0) {

View File

@ -83,12 +83,12 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->GetInitializedHandler("update"); this->CTest->GetInitializedHandler("update");
if (!handler) { if (!handler) {
this->SetError("internal CTest error. Cannot instantiate update handler"); this->SetError("internal CTest error. Cannot instantiate update handler");
return 0; return CM_NULLPTR;
} }
handler->SetCommand(this); handler->SetCommand(this);
if (source_dir.empty()) { if (source_dir.empty()) {
this->SetError("source directory not specified. Please use SOURCE tag"); this->SetError("source directory not specified. Please use SOURCE tag");
return 0; return CM_NULLPTR;
} }
handler->SetOption("SourceDirectory", source_dir.c_str()); handler->SetOption("SourceDirectory", source_dir.c_str());
handler->SetQuiet(this->Quiet); handler->SetQuiet(this->Quiet);

View File

@ -334,7 +334,7 @@ bool cmCTestUpdateHandler::SelectVCS()
// If no update command was specified, lookup one for this VCS tool. // If no update command was specified, lookup one for this VCS tool.
if (this->UpdateCommand.empty()) { if (this->UpdateCommand.empty()) {
const char* key = 0; const char* key = CM_NULLPTR;
switch (this->UpdateType) { switch (this->UpdateType) {
case e_CVS: case e_CVS:
key = "CVSCommand"; key = "CVSCommand";

View File

@ -21,7 +21,7 @@ cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
this->CTest->GetInitializedHandler("upload"); this->CTest->GetInitializedHandler("upload");
if (!handler) { if (!handler) {
this->SetError("internal CTest error. Cannot instantiate upload handler"); this->SetError("internal CTest error. Cannot instantiate upload handler");
return 0; return CM_NULLPTR;
} }
static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files); static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files);

View File

@ -65,7 +65,7 @@ bool cmCTestVC::InitialCheckout(const char* command)
ai != args.end(); ++ai) { ai != args.end(); ++ai) {
vc_co.push_back(ai->c_str()); vc_co.push_back(ai->c_str());
} }
vc_co.push_back(0); vc_co.push_back(CM_NULLPTR);
// Run the initial checkout command and log its output. // Run the initial checkout command and log its output.
this->Log << "--- Begin Initial Checkout ---\n"; this->Log << "--- Begin Initial Checkout ---\n";

View File

@ -104,8 +104,8 @@ protected:
Revision const* PriorRev; Revision const* PriorRev;
File() File()
: Status(PathUpdated) : Status(PathUpdated)
, Rev(0) , Rev(CM_NULLPTR)
, PriorRev(0) , PriorRev(CM_NULLPTR)
{ {
} }
File(PathStatus status, Revision const* rev, Revision const* priorRev) File(PathStatus status, Revision const* rev, Revision const* priorRev)
@ -121,11 +121,11 @@ protected:
/** Run a command line and send output to given parsers. */ /** Run a command line and send output to given parsers. */
bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err, bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err,
const char* workDir = 0); const char* workDir = CM_NULLPTR);
/** Run VC update command line and send output to given parsers. */ /** Run VC update command line and send output to given parsers. */
bool RunUpdateCommand(char const* const* cmd, OutputParser* out, bool RunUpdateCommand(char const* const* cmd, OutputParser* out,
OutputParser* err = 0); OutputParser* err = CM_NULLPTR);
/** Write xml element for one file. */ /** Write xml element for one file. */
void WriteXMLEntry(cmXMLWriter& xml, std::string const& path, void WriteXMLEntry(cmXMLWriter& xml, std::string const& path,

View File

@ -130,8 +130,8 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
return true; return true;
} else { } else {
// try some alternate names // try some alternate names
const char* tryname[] = { "GUX", "GTM", "ONT", 0 }; const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
for (int k = 0; tryname[k] != 0; k++) { for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
std::string routine2 = routine + tryname[k]; std::string routine2 = routine + tryname[k];
i = this->RoutineToDirectory.find(routine2); i = this->RoutineToDirectory.find(routine2);
if (i != this->RoutineToDirectory.end()) { if (i != this->RoutineToDirectory.end()) {

View File

@ -16,7 +16,7 @@
cmProcess::cmProcess() cmProcess::cmProcess()
{ {
this->Process = 0; this->Process = CM_NULLPTR;
this->Timeout = 0; this->Timeout = 0;
this->TotalTime = 0; this->TotalTime = 0;
this->ExitValue = 0; this->ExitValue = 0;
@ -52,7 +52,7 @@ bool cmProcess::StartProcess()
i != this->Arguments.end(); ++i) { i != this->Arguments.end(); ++i) {
this->ProcessArgs.push_back(i->c_str()); this->ProcessArgs.push_back(i->c_str());
} }
this->ProcessArgs.push_back(0); // null terminate the list this->ProcessArgs.push_back(CM_NULLPTR); // null terminate the list
this->Process = cmsysProcess_New(); this->Process = cmsysProcess_New();
cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin()); cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin());
if (!this->WorkingDirectory.empty()) { if (!this->WorkingDirectory.empty()) {

View File

@ -24,29 +24,30 @@
#include <form.h> #include <form.h>
static const char* cmDocumentationName[][2] = { static const char* cmDocumentationName[][2] = {
{ 0, " ccmake - Curses Interface for CMake." }, { CM_NULLPTR, " ccmake - Curses Interface for CMake." },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationUsage[][2] = { static const char* cmDocumentationUsage[][2] = {
{ 0, " ccmake <path-to-source>\n" { CM_NULLPTR, " ccmake <path-to-source>\n"
" ccmake <path-to-existing-build>" }, " ccmake <path-to-existing-build>" },
{ 0, "Specify a source directory to (re-)generate a build system for " { CM_NULLPTR,
"Specify a source directory to (re-)generate a build system for "
"it in the current working directory. Specify an existing build " "it in the current working directory. Specify an existing build "
"directory to re-generate its build system." }, "directory to re-generate its build system." },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationUsageNote[][2] = { static const char* cmDocumentationUsageNote[][2] = {
{ 0, "Run 'ccmake --help' for more information." }, { CM_NULLPTR, "Run 'ccmake --help' for more information." },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationOptions[] static const char* cmDocumentationOptions[]
[2] = { CMAKE_STANDARD_OPTIONS_TABLE, [2] = { CMAKE_STANDARD_OPTIONS_TABLE,
{ 0, 0 } }; { CM_NULLPTR, CM_NULLPTR } };
cmCursesForm* cmCursesForm::CurrentForm = 0; cmCursesForm* cmCursesForm::CurrentForm = CM_NULLPTR;
extern "C" { extern "C" {
@ -176,7 +177,7 @@ int main(int argc, char const* const* argv)
touchwin(stdscr); touchwin(stdscr);
endwin(); endwin();
delete cmCursesForm::CurrentForm; delete cmCursesForm::CurrentForm;
cmCursesForm::CurrentForm = 0; cmCursesForm::CurrentForm = CM_NULLPTR;
std::cout << std::endl << std::endl; std::cout << std::endl << std::endl;

View File

@ -32,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
{ {
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
this->Entry = 0; this->Entry = CM_NULLPTR;
this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
} }
@ -50,7 +50,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
} }
this->Entry = 0; this->Entry = CM_NULLPTR;
const char* value = cm->GetState()->GetCacheEntryValue(key); const char* value = cm->GetState()->GetCacheEntryValue(key);
assert(value); assert(value);
switch (cm->GetState()->GetCacheEntryType(key)) { switch (cm->GetState()->GetCacheEntryType(key)) {
@ -111,6 +111,6 @@ const char* cmCursesCacheEntryComposite::GetValue()
if (this->Label) { if (this->Label) {
return this->Label->GetValue(); return this->Label->GetValue();
} else { } else {
return 0; return CM_NULLPTR;
} }
} }

View File

@ -16,7 +16,7 @@ bool cmCursesForm::Debug = false;
cmCursesForm::cmCursesForm() cmCursesForm::cmCursesForm()
{ {
this->Form = 0; this->Form = CM_NULLPTR;
} }
cmCursesForm::~cmCursesForm() cmCursesForm::~cmCursesForm()
@ -24,7 +24,7 @@ cmCursesForm::~cmCursesForm()
if (this->Form) { if (this->Form) {
unpost_form(this->Form); unpost_form(this->Form);
free_form(this->Form); free_form(this->Form);
this->Form = 0; this->Form = CM_NULLPTR;
} }
} }

View File

@ -32,8 +32,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm(
this->Messages += "\n\n"; this->Messages += "\n\n";
} }
this->Title = title; this->Title = title;
this->Fields[0] = 0; this->Fields[0] = CM_NULLPTR;
this->Fields[1] = 0; this->Fields[1] = CM_NULLPTR;
} }
cmCursesLongMessageForm::~cmCursesLongMessageForm() cmCursesLongMessageForm::~cmCursesLongMessageForm()
@ -110,7 +110,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
if (this->Form) { if (this->Form) {
unpost_form(this->Form); unpost_form(this->Form);
free_form(this->Form); free_form(this->Form);
this->Form = 0; this->Form = CM_NULLPTR;
} }
const char* msg = this->Messages.c_str(); const char* msg = this->Messages.c_str();
@ -119,7 +119,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
if (this->Fields[0]) { if (this->Fields[0]) {
free_field(this->Fields[0]); free_field(this->Fields[0]);
this->Fields[0] = 0; this->Fields[0] = CM_NULLPTR;
} }
this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0); this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0);

View File

@ -36,8 +36,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
, InitialWidth(initWidth) , InitialWidth(initWidth)
{ {
this->NumberOfPages = 0; this->NumberOfPages = 0;
this->Fields = 0; this->Fields = CM_NULLPTR;
this->Entries = 0; this->Entries = CM_NULLPTR;
this->AdvancedMode = false; this->AdvancedMode = false;
this->NumberOfVisibleEntries = 0; this->NumberOfVisibleEntries = 0;
this->OkToGenerate = false; this->OkToGenerate = false;
@ -64,7 +64,7 @@ cmCursesMainForm::~cmCursesMainForm()
if (this->Form) { if (this->Form) {
unpost_form(this->Form); unpost_form(this->Form);
free_form(this->Form); free_form(this->Form);
this->Form = 0; this->Form = CM_NULLPTR;
} }
delete[] this->Fields; delete[] this->Fields;
@ -75,7 +75,7 @@ cmCursesMainForm::~cmCursesMainForm()
delete this->Entries; delete this->Entries;
if (this->CMakeInstance) { if (this->CMakeInstance) {
delete this->CMakeInstance; delete this->CMakeInstance;
this->CMakeInstance = 0; this->CMakeInstance = CM_NULLPTR;
} }
} }
@ -185,7 +185,7 @@ void cmCursesMainForm::RePost()
if (this->Form) { if (this->Form) {
unpost_form(this->Form); unpost_form(this->Form);
free_form(this->Form); free_form(this->Form);
this->Form = 0; this->Form = CM_NULLPTR;
} }
delete[] this->Fields; delete[] this->Fields;
if (this->AdvancedMode) { if (this->AdvancedMode) {
@ -215,7 +215,7 @@ void cmCursesMainForm::RePost()
this->Fields = new FIELD*[3 * this->NumberOfVisibleEntries + 1]; this->Fields = new FIELD*[3 * this->NumberOfVisibleEntries + 1];
size_t cc; size_t cc;
for (cc = 0; cc < 3 * this->NumberOfVisibleEntries + 1; cc++) { for (cc = 0; cc < 3 * this->NumberOfVisibleEntries + 1; cc++) {
this->Fields[cc] = 0; this->Fields[cc] = CM_NULLPTR;
} }
// Assign fields // Assign fields
@ -244,7 +244,7 @@ void cmCursesMainForm::RePost()
this->NumberOfVisibleEntries = 1; this->NumberOfVisibleEntries = 1;
} }
// Has to be null terminated. // Has to be null terminated.
this->Fields[3 * this->NumberOfVisibleEntries] = 0; this->Fields[3 * this->NumberOfVisibleEntries] = CM_NULLPTR;
} }
void cmCursesMainForm::Render(int left, int top, int width, int height) void cmCursesMainForm::Render(int left, int top, int width, int height)
@ -263,7 +263,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
// Delete the previous form // Delete the previous form
unpost_form(this->Form); unpost_form(this->Form);
free_form(this->Form); free_form(this->Form);
this->Form = 0; this->Form = CM_NULLPTR;
} }
// Wrong window size // Wrong window size
@ -345,7 +345,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
} }
// Give the current widget (if it exists), a chance to print keys // Give the current widget (if it exists), a chance to print keys
cmCursesWidget* cw = 0; cmCursesWidget* cw = CM_NULLPTR;
if (this->Form) { if (this->Form) {
FIELD* currentField = current_field(this->Form); FIELD* currentField = current_field(this->Form);
cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField)); cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
@ -434,7 +434,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
// Get the key of the current entry // Get the key of the current entry
FIELD* cur = current_field(this->Form); FIELD* cur = current_field(this->Form);
int findex = field_index(cur); int findex = field_index(cur);
cmCursesWidget* lbl = 0; cmCursesWidget* lbl = CM_NULLPTR;
if (findex >= 0) { if (findex >= 0) {
lbl = reinterpret_cast<cmCursesWidget*>( lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2])); field_userptr(this->Fields[findex - 2]));
@ -566,7 +566,7 @@ int cmCursesMainForm::Configure(int noconfigure)
this->FillCacheManagerFromUI(); this->FillCacheManagerFromUI();
this->CMakeInstance->SaveCache( this->CMakeInstance->SaveCache(
this->CMakeInstance->GetHomeOutputDirectory()); this->CMakeInstance->GetHomeOutputDirectory());
this->LoadCache(0); this->LoadCache(CM_NULLPTR);
// Get rid of previous errors // Get rid of previous errors
this->Errors = std::vector<std::string>(); this->Errors = std::vector<std::string>();
@ -583,7 +583,7 @@ int cmCursesMainForm::Configure(int noconfigure)
} else { } else {
retVal = this->CMakeInstance->Configure(); retVal = this->CMakeInstance->Configure();
} }
this->CMakeInstance->SetProgressCallback(0, 0); this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
keypad(stdscr, TRUE); /* Use key symbols as keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/ KEY_DOWN*/
@ -638,7 +638,7 @@ int cmCursesMainForm::Generate()
// run the generate process // run the generate process
int retVal = this->CMakeInstance->Generate(); int retVal = this->CMakeInstance->Generate();
this->CMakeInstance->SetProgressCallback(0, 0); this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
keypad(stdscr, TRUE); /* Use key symbols as keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/ KEY_DOWN*/
@ -888,7 +888,7 @@ void cmCursesMainForm::HandleInput()
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>( cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2])); field_userptr(this->Fields[findex - 2]));
const char* curField = lbl->GetValue(); const char* curField = lbl->GetValue();
const char* helpString = 0; const char* helpString = CM_NULLPTR;
const char* existingValue = const char* existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(curField); this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
@ -973,7 +973,7 @@ void cmCursesMainForm::HandleInput()
// (findex always corresponds to the value field) // (findex always corresponds to the value field)
FIELD* nextCur; FIELD* nextCur;
if (findex == 2) { if (findex == 2) {
nextCur = 0; nextCur = CM_NULLPTR;
} else if (findex == 3 * this->NumberOfVisibleEntries - 1) { } else if (findex == 3 * this->NumberOfVisibleEntries - 1) {
nextCur = this->Fields[findex - 5]; nextCur = this->Fields[findex - 5];
} else { } else {
@ -1003,7 +1003,7 @@ void cmCursesMainForm::HandleInput()
if (nextCur) { if (nextCur) {
// make the next or prev. current field after deletion // make the next or prev. current field after deletion
nextCur = 0; nextCur = CM_NULLPTR;
std::vector<cmCursesCacheEntryComposite*>::iterator it; std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); for (it = this->Entries->begin(); it != this->Entries->end();
++it) { ++it) {
@ -1052,7 +1052,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
int findex = start_index; int findex = start_index;
for (;;) { for (;;) {
if (!str.empty()) { if (!str.empty()) {
cmCursesWidget* lbl = 0; cmCursesWidget* lbl = CM_NULLPTR;
if (findex >= 0) { if (findex >= 0) {
lbl = reinterpret_cast<cmCursesWidget*>( lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2])); field_userptr(this->Fields[findex - 2]));

View File

@ -67,7 +67,7 @@ public:
* exception is during a resize. The optional argument specifies the * exception is during a resize. The optional argument specifies the
* string to be displayed in the status bar. * string to be displayed in the status bar.
*/ */
void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(0); } void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(CM_NULLPTR); }
virtual void UpdateStatusBar(const char* message); virtual void UpdateStatusBar(const char* message);
/** /**

View File

@ -72,7 +72,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return false; return false;
} }
this->OriginalString = 0; this->OriginalString = CM_NULLPTR;
this->Done = false; this->Done = false;
char debugMessage[128]; char debugMessage[128];

View File

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

View File

@ -30,7 +30,7 @@ bool cmAddCustomCommandCommand::InitialPass(
std::string source, target, main_dependency, working; std::string source, target, main_dependency, working;
std::string comment_buffer; std::string comment_buffer;
const char* comment = 0; const char* comment = CM_NULLPTR;
std::vector<std::string> depends, outputs, output, byproducts; std::vector<std::string> depends, outputs, output, byproducts;
bool verbatim = false; bool verbatim = false;
bool append = false; bool append = false;

View File

@ -47,7 +47,7 @@ bool cmAddCustomTargetCommand::InitialPass(
bool verbatim = false; bool verbatim = false;
bool uses_terminal = false; bool uses_terminal = false;
std::string comment_buffer; std::string comment_buffer;
const char* comment = 0; const char* comment = CM_NULLPTR;
std::vector<std::string> sources; std::vector<std::string> sources;
// Keep track of parser state. // Keep track of parser state.

View File

@ -151,9 +151,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
} }
if (archive_write_open( if (archive_write_open(
this->Archive, this, 0, this->Archive, this, CM_NULLPTR,
reinterpret_cast<archive_write_callback*>(&Callback::Write), reinterpret_cast<archive_write_callback*>(&Callback::Write),
0) != ARCHIVE_OK) { CM_NULLPTR) != ARCHIVE_OK) {
this->Error = "archive_write_open: "; this->Error = "archive_write_open: ";
this->Error += cm_archive_error_string(this->Archive); this->Error += cm_archive_error_string(this->Archive);
return; return;
@ -229,7 +229,8 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix)
Entry e; Entry e;
cm_archive_entry_copy_sourcepath(e, file); cm_archive_entry_copy_sourcepath(e, file);
cm_archive_entry_copy_pathname(e, dest); cm_archive_entry_copy_pathname(e, dest);
if (archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK) { if (archive_read_disk_entry_from_file(this->Disk, e, -1, CM_NULLPTR) !=
ARCHIVE_OK) {
this->Error = "archive_read_disk_entry_from_file '"; this->Error = "archive_read_disk_entry_from_file '";
this->Error += file; this->Error += file;
this->Error += "': "; this->Error += "': ";

View File

@ -72,13 +72,13 @@ public:
* skip. The remaining part of the input path is appended to the * skip. The remaining part of the input path is appended to the
* "prefix" value to construct the final name in the archive. * "prefix" value to construct the final name in the archive.
*/ */
bool Add(std::string path, size_t skip = 0, const char* prefix = 0, bool Add(std::string path, size_t skip = 0, const char* prefix = CM_NULLPTR,
bool recursive = true); bool recursive = true);
/** Returns true if there has been no error. */ /** Returns true if there has been no error. */
operator safe_bool() const operator safe_bool() const
{ {
return this->Okay() ? &cmArchiveWrite::safe_bool_true : 0; return this->Okay() ? &cmArchiveWrite::safe_bool_true : CM_NULLPTR;
} }
/** Returns true if there has been an error. */ /** Returns true if there has been an error. */

View File

@ -36,8 +36,8 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
const char* variable = args[0].c_str(); const char* variable = args[0].c_str();
// Parse remaining arguments. // Parse remaining arguments.
const char* configuration = 0; const char* configuration = CM_NULLPTR;
const char* project_name = 0; const char* project_name = CM_NULLPTR;
std::string target; std::string target;
enum Doing enum Doing
{ {

View File

@ -218,8 +218,8 @@ void CCONV cmAddUtilityCommand(void* arg, const char* utilityName,
} }
// Pass the call to the makefile instance. // Pass the call to the makefile instance.
mf->AddUtilityCommand(utilityName, (all ? false : true), 0, depends2, mf->AddUtilityCommand(utilityName, (all ? false : true), CM_NULLPTR,
commandLines); depends2, commandLines);
} }
void CCONV cmAddCustomCommand(void* arg, const char* source, void CCONV cmAddCustomCommand(void* arg, const char* source,
const char* command, int numArgs, const char* command, int numArgs,
@ -257,7 +257,7 @@ void CCONV cmAddCustomCommand(void* arg, const char* source,
} }
// Pass the call to the makefile instance. // Pass the call to the makefile instance.
const char* no_comment = 0; const char* no_comment = CM_NULLPTR;
mf->AddCustomCommandOldStyle(target, outputs2, depends2, source, mf->AddCustomCommandOldStyle(target, outputs2, depends2, source,
commandLines, no_comment); commandLines, no_comment);
} }
@ -291,8 +291,8 @@ void CCONV cmAddCustomCommandToOutput(void* arg, const char* output,
} }
// Pass the call to the makefile instance. // Pass the call to the makefile instance.
const char* no_comment = 0; const char* no_comment = CM_NULLPTR;
const char* no_working_dir = 0; const char* no_working_dir = CM_NULLPTR;
mf->AddCustomCommandToOutput(output, depends2, main_dependency, commandLines, mf->AddCustomCommandToOutput(output, depends2, main_dependency, commandLines,
no_comment, no_working_dir); no_comment, no_working_dir);
} }
@ -333,8 +333,8 @@ void CCONV cmAddCustomCommandToTarget(void* arg, const char* target,
// Pass the call to the makefile instance. // Pass the call to the makefile instance.
std::vector<std::string> no_byproducts; std::vector<std::string> no_byproducts;
std::vector<std::string> no_depends; std::vector<std::string> no_depends;
const char* no_comment = 0; const char* no_comment = CM_NULLPTR;
const char* no_working_dir = 0; const char* no_working_dir = CM_NULLPTR;
mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines, mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines,
cctype, no_comment, no_working_dir); cctype, no_comment, no_working_dir);
} }
@ -414,7 +414,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs,
result.push_back(args[i]); result.push_back(args[i]);
} }
int resargc = static_cast<int>(result.size()); int resargc = static_cast<int>(result.size());
char** resargv = 0; char** resargv = CM_NULLPTR;
if (resargc) { if (resargc) {
resargv = (char**)malloc(resargc * sizeof(char*)); resargv = (char**)malloc(resargc * sizeof(char*));
} }
@ -453,7 +453,7 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
struct cmCPluginAPISourceFile struct cmCPluginAPISourceFile
{ {
cmCPluginAPISourceFile() cmCPluginAPISourceFile()
: RealSourceFile(0) : RealSourceFile(CM_NULLPTR)
{ {
} }
cmSourceFile* RealSourceFile; cmSourceFile* RealSourceFile;
@ -525,7 +525,7 @@ void CCONV* cmGetSource(void* arg, const char* name)
} }
return (void*)i->second; return (void*)i->second;
} else { } else {
return 0; return CM_NULLPTR;
} }
} }
@ -534,7 +534,7 @@ void* CCONV cmAddSource(void* arg, void* arg2)
cmMakefile* mf = static_cast<cmMakefile*>(arg); cmMakefile* mf = static_cast<cmMakefile*>(arg);
cmCPluginAPISourceFile* osf = static_cast<cmCPluginAPISourceFile*>(arg2); cmCPluginAPISourceFile* osf = static_cast<cmCPluginAPISourceFile*>(arg2);
if (osf->FullPath.empty()) { if (osf->FullPath.empty()) {
return 0; return CM_NULLPTR;
} }
// Create the real cmSourceFile instance and copy over saved information. // Create the real cmSourceFile instance and copy over saved information.

View File

@ -70,7 +70,7 @@
struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
{ {
struct tm* lctime; struct tm* lctime;
time_t tctime = time(0); time_t tctime = time(CM_NULLPTR);
lctime = gmtime(&tctime); lctime = gmtime(&tctime);
char buf[1024]; char buf[1024];
// add todays year day and month to the time in str because // add todays year day and month to the time in str because
@ -88,7 +88,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
// As such, this time may be in the past or in the future. // As such, this time may be in the past or in the future.
time_t ntime = curl_getdate(buf, &tctime); time_t ntime = curl_getdate(buf, &tctime);
cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl); cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl);
tctime = time(0); tctime = time(CM_NULLPTR);
cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl); cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl);
const int dayLength = 24 * 60 * 60; const int dayLength = 24 * 60 * 60;
@ -134,7 +134,7 @@ std::string cmCTest::CleanString(const std::string& str)
std::string cmCTest::CurrentTime() std::string cmCTest::CurrentTime()
{ {
time_t currenttime = time(0); time_t currenttime = time(CM_NULLPTR);
struct tm* t = localtime(&currenttime); struct tm* t = localtime(&currenttime);
// return ::CleanString(ctime(&currenttime)); // return ::CleanString(ctime(&currenttime));
char current_time[1024]; char current_time[1024];
@ -244,7 +244,7 @@ std::string cmCTest::DecodeURL(const std::string& in)
for (const char* c = in.c_str(); *c; ++c) { for (const char* c = in.c_str(); *c; ++c) {
if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) { if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) {
char buf[3] = { *(c + 1), *(c + 2), 0 }; char buf[3] = { *(c + 1), *(c + 2), 0 };
out.append(1, char(strtoul(buf, 0, 16))); out.append(1, char(strtoul(buf, CM_NULLPTR, 16)));
c += 2; c += 2;
} else { } else {
out.append(1, *c); out.append(1, *c);
@ -288,7 +288,7 @@ cmCTest::cmCTest()
this->ScheduleType = ""; this->ScheduleType = "";
this->StopTime = ""; this->StopTime = "";
this->NextDayStopTime = false; this->NextDayStopTime = false;
this->OutputLogFile = 0; this->OutputLogFile = CM_NULLPTR;
this->OutputLogFileLastTag = -1; this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false; this->SuppressUpdatingCTestConfiguration = false;
this->DartVersion = 1; this->DartVersion = 1;
@ -347,7 +347,7 @@ cmCTest::cmCTest()
cmCTest::~cmCTest() cmCTest::~cmCTest()
{ {
cmDeleteAll(this->TestingHandlers); cmDeleteAll(this->TestingHandlers);
this->SetOutputLogFileName(0); this->SetOutputLogFileName(CM_NULLPTR);
} }
void cmCTest::SetParallelLevel(int level) void cmCTest::SetParallelLevel(int level)
@ -515,7 +515,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string tag; std::string tag;
if (createNewTag) { if (createNewTag) {
time_t tctime = time(0); time_t tctime = time(CM_NULLPTR);
if (this->TomorrowTag) { if (this->TomorrowTag) {
tctime += (24 * 60 * 60); tctime += (24 * 60 * 60);
} }
@ -540,7 +540,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
} }
tfin.close(); tfin.close();
} }
if (tag.empty() || (0 != command) || this->Parts[PartStart]) { if (tag.empty() || (CM_NULLPTR != command) || this->Parts[PartStart]) {
cmCTestOptionalLog( cmCTestOptionalLog(
this, DEBUG, this, DEBUG,
"TestModel: " << this->GetTestModelString() << std::endl, quiet); "TestModel: " << this->GetTestModelString() << std::endl, quiet);
@ -562,7 +562,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
ofs << this->GetTestModelString() << std::endl; ofs << this->GetTestModelString() << std::endl;
} }
ofs.close(); ofs.close();
if (0 == command) { if (CM_NULLPTR == command) {
cmCTestOptionalLog(this, OUTPUT, "Create new tag: " cmCTestOptionalLog(this, OUTPUT, "Create new tag: "
<< tag << " - " << this->GetTestModelString() << tag << " - " << this->GetTestModelString()
<< std::endl, << std::endl,
@ -860,7 +860,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it = cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler); this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) { if (it == this->TestingHandlers.end()) {
return 0; return CM_NULLPTR;
} }
it->second->Initialize(); it->second->Initialize();
return it->second; return it->second;
@ -871,7 +871,7 @@ cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it = cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler); this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) { if (it == this->TestingHandlers.end()) {
return 0; return CM_NULLPTR;
} }
return it->second; return it->second;
} }
@ -1029,7 +1029,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
a != args.end(); ++a) { a != args.end(); ++a) {
argv.push_back(a->c_str()); argv.push_back(a->c_str());
} }
argv.push_back(0); argv.push_back(CM_NULLPTR);
output = ""; output = "";
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:"); cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
@ -1057,7 +1057,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents " cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents "
<< tick_len << " bytes of output" << std::endl << tick_len << " bytes of output" << std::endl
<< " " << std::flush); << " " << std::flush);
while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
for (int cc = 0; cc < length; ++cc) { for (int cc = 0; cc < length; ++cc) {
if (data[cc] == 0) { if (data[cc] == 0) {
data[cc] = '\n'; data[cc] = '\n';
@ -1082,7 +1082,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: " cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< int(double(output.size()) / 1024.0) << "K" << std::endl); << int(double(output.size()) / 1024.0) << "K" << std::endl);
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
int result = cmsysProcess_GetState(cp); int result = cmsysProcess_GetState(cp);
@ -1211,7 +1211,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
char* data; char* data;
int length; int length;
while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
if (output) { if (output) {
tempOutput.insert(tempOutput.end(), data, data + length); tempOutput.insert(tempOutput.end(), data, data + length);
} }
@ -1221,7 +1221,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
} }
} }
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
if (output && tempOutput.begin() != tempOutput.end()) { if (output && tempOutput.begin() != tempOutput.end()) {
output->append(&*tempOutput.begin(), tempOutput.size()); output->append(&*tempOutput.begin(), tempOutput.size());
} }
@ -2181,7 +2181,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
it->second->SetSubmitIndex(this->SubmitIndex); it->second->SetSubmitIndex(this->SubmitIndex);
} }
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
if (!this->Initialize(cwd.c_str(), 0)) { if (!this->Initialize(cwd.c_str(), CM_NULLPTR)) {
res = 12; res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl); << std::endl);
@ -2325,7 +2325,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
bool inBld = bldRelpath.find("..") == bldRelpath.npos; bool inBld = bldRelpath.find("..") == bldRelpath.npos;
// TODO: Handle files with .. in their name // TODO: Handle files with .. in their name
std::string* res = 0; std::string* res = CM_NULLPTR;
if (inSrc && inBld) { if (inSrc && inBld) {
// If both have relative path with no dots, pick the shorter one // If both have relative path with no dots, pick the shorter one
@ -2375,7 +2375,7 @@ void cmCTest::EmptyCTestConfiguration()
void cmCTest::DetermineNextDayStop() void cmCTest::DetermineNextDayStop()
{ {
struct tm* lctime; struct tm* lctime;
time_t current_time = time(0); time_t current_time = time(CM_NULLPTR);
lctime = gmtime(&current_time); lctime = gmtime(&current_time);
int gm_hour = lctime->tm_hour; int gm_hour = lctime->tm_hour;
time_t gm_time = mktime(lctime); time_t gm_time = mktime(lctime);
@ -2459,7 +2459,7 @@ bool cmCTest::GetProduceXML()
const char* cmCTest::GetSpecificTrack() const char* cmCTest::GetSpecificTrack()
{ {
if (this->SpecificTrack.empty()) { if (this->SpecificTrack.empty()) {
return 0; return CM_NULLPTR;
} }
return this->SpecificTrack.c_str(); return this->SpecificTrack.c_str();
} }
@ -2534,7 +2534,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
a != args.end(); ++a) { a != args.end(); ++a) {
argv.push_back(a->c_str()); argv.push_back(a->c_str());
} }
argv.push_back(0); argv.push_back(CM_NULLPTR);
*stdOut = ""; *stdOut = "";
*stdErr = ""; *stdErr = "";
@ -2555,7 +2555,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
int res; int res;
bool done = false; bool done = false;
while (!done) { while (!done) {
res = cmsysProcess_WaitForData(cp, &data, &length, 0); res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR);
switch (res) { switch (res) {
case cmsysProcess_Pipe_STDOUT: case cmsysProcess_Pipe_STDOUT:
tempOutput.insert(tempOutput.end(), data, data + length); tempOutput.insert(tempOutput.end(), data, data + length);
@ -2572,7 +2572,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
} }
} }
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
if (!tempOutput.empty()) { if (!tempOutput.empty()) {
stdOut->append(&*tempOutput.begin(), tempOutput.size()); stdOut->append(&*tempOutput.begin(), tempOutput.size());
} }
@ -2614,7 +2614,7 @@ void cmCTest::SetOutputLogFileName(const char* name)
{ {
if (this->OutputLogFile) { if (this->OutputLogFile) {
delete this->OutputLogFile; delete this->OutputLogFile;
this->OutputLogFile = 0; this->OutputLogFile = CM_NULLPTR;
} }
if (name) { if (name) {
this->OutputLogFile = new cmGeneratedFileStream(name); this->OutputLogFile = new cmGeneratedFileStream(name);
@ -2628,7 +2628,7 @@ static const char* cmCTestStringLogType[] = { "DEBUG",
"HANDLER_VERBOSE_OUTPUT", "HANDLER_VERBOSE_OUTPUT",
"WARNING", "WARNING",
"ERROR_MESSAGE", "ERROR_MESSAGE",
0 }; CM_NULLPTR };
#ifdef cerr #ifdef cerr
#undef cerr #undef cerr

View File

@ -120,7 +120,7 @@ public:
typedef std::set<std::string> SetOfStrings; typedef std::set<std::string> SetOfStrings;
///! Process Command line arguments ///! Process Command line arguments
int Run(std::vector<std::string>&, std::string* output = 0); int Run(std::vector<std::string>&, std::string* output = CM_NULLPTR);
/** /**
* Initialize and finalize testing * Initialize and finalize testing
@ -271,8 +271,8 @@ public:
* escaped for this to with spaces. * escaped for this to with spaces.
*/ */
bool RunCommand(const char* command, std::string* stdOut, bool RunCommand(const char* command, std::string* stdOut,
std::string* stdErr, int* retVal = 0, const char* dir = 0, std::string* stdErr, int* retVal = CM_NULLPTR,
double timeout = 0.0); const char* dir = CM_NULLPTR, double timeout = 0.0);
//! Clean/make safe for xml the given value such that it may be used as //! Clean/make safe for xml the given value such that it may be used as
// one of the key fields by CDash when computing the buildid. // one of the key fields by CDash when computing the buildid.
@ -574,7 +574,7 @@ private:
//! Check if the argument is the one specified //! Check if the argument is the one specified
bool CheckArgument(const std::string& arg, const char* varg1, bool CheckArgument(const std::string& arg, const char* varg1,
const char* varg2 = 0); const char* varg2 = CM_NULLPTR);
//! Output errors from a test //! Output errors from a test
void OutputTestErrors(std::vector<char> const& process_output); void OutputTestErrors(std::vector<char> const& process_output);

View File

@ -179,7 +179,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
} }
const char* cmCacheManager::PersistentProperties[] = { "ADVANCED", "MODIFIED", const char* cmCacheManager::PersistentProperties[] = { "ADVANCED", "MODIFIED",
"STRINGS", 0 }; "STRINGS", CM_NULLPTR };
bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
CacheEntry& e) CacheEntry& e)
@ -447,7 +447,7 @@ cmCacheManager::CacheEntry* cmCacheManager::GetCacheEntry(
if (i != this->Cache.end()) { if (i != this->Cache.end()) {
return &i->second; return &i->second;
} }
return 0; return CM_NULLPTR;
} }
cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key) cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key)
@ -462,7 +462,7 @@ const char* cmCacheManager::GetInitializedCacheValue(
if (i != this->Cache.end() && i->second.Initialized) { if (i != this->Cache.end() && i->second.Initialized) {
return i->second.Value.c_str(); return i->second.Value.c_str();
} }
return 0; return CM_NULLPTR;
} }
void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::PrintCache(std::ostream& out) const
@ -616,7 +616,7 @@ const char* cmCacheManager::CacheIterator::GetProperty(
if (!this->IsAtEnd()) { if (!this->IsAtEnd()) {
return this->GetEntry().GetProperty(prop); return this->GetEntry().GetProperty(prop);
} }
return 0; return CM_NULLPTR;
} }
void cmCacheManager::CacheIterator::SetProperty(const std::string& p, void cmCacheManager::CacheIterator::SetProperty(const std::string& p,
@ -653,5 +653,5 @@ void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v)
bool cmCacheManager::CacheIterator::PropertyExists( bool cmCacheManager::CacheIterator::PropertyExists(
const std::string& prop) const const std::string& prop) const
{ {
return this->GetProperty(prop) != NULL; return this->GetProperty(prop) != CM_NULLPTR;
} }

View File

@ -113,7 +113,7 @@ public:
void PrintCache(std::ostream&) const; void PrintCache(std::ostream&) const;
///! Get the iterator for an entry with a given key. ///! Get the iterator for an entry with a given key.
cmCacheManager::CacheIterator GetCacheIterator(const char* key = 0); cmCacheManager::CacheIterator GetCacheIterator(const char* key = CM_NULLPTR);
///! Remove an entry from the cache ///! Remove an entry from the cache
void RemoveCacheEntry(const std::string& key); void RemoveCacheEntry(const std::string& key);
@ -128,7 +128,7 @@ public:
{ {
cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str());
if (it.IsAtEnd()) { if (it.IsAtEnd()) {
return 0; return CM_NULLPTR;
} }
return it.GetValue(); return it.GetValue();
} }
@ -171,7 +171,8 @@ public:
void RemoveCacheEntryProperty(std::string const& key, void RemoveCacheEntryProperty(std::string const& key,
std::string const& propName) std::string const& propName)
{ {
this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); this->GetCacheIterator(key.c_str())
.SetProperty(propName, (void*)CM_NULLPTR);
} }
void AppendCacheEntryProperty(std::string const& key, void AppendCacheEntryProperty(std::string const& key,

View File

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

View File

@ -25,7 +25,7 @@ cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
this->WarnUninitialized = false; this->WarnUninitialized = false;
this->CheckSystemVars = false; this->CheckSystemVars = false;
this->FileLine = -1; this->FileLine = -1;
this->FileName = 0; this->FileName = CM_NULLPTR;
this->RemoveEmpty = true; this->RemoveEmpty = true;
this->EmptyVariable[0] = 0; this->EmptyVariable[0] = 0;
strcpy(this->DCURLYVariable, "${"); strcpy(this->DCURLYVariable, "${");
@ -96,13 +96,13 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
e << "Syntax $" << key << "{} is not supported. " e << "Syntax $" << key << "{} is not supported. "
<< "Only ${}, $ENV{}, and $CACHE{} are allowed."; << "Only ${}, $ENV{}, and $CACHE{} are allowed.";
this->SetError(e.str()); this->SetError(e.str());
return 0; return CM_NULLPTR;
} }
char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
{ {
if (!var) { if (!var) {
return 0; return CM_NULLPTR;
} }
if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) {
std::ostringstream ostr; std::ostringstream ostr;
@ -125,7 +125,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str()); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
} }
} }
return 0; return CM_NULLPTR;
} }
if (this->EscapeQuotes && value) { if (this->EscapeQuotes && value) {
return this->AddString(cmSystemTools::EscapeQuotes(value)); return this->AddString(cmSystemTools::EscapeQuotes(value));
@ -176,7 +176,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
void cmCommandArgumentParserHelper::AllocateParserType( void cmCommandArgumentParserHelper::AllocateParserType(
cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len) cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len)
{ {
pt->str = 0; pt->str = CM_NULLPTR;
if (len == 0) { if (len == 0) {
len = static_cast<int>(strlen(str)); len = static_cast<int>(strlen(str));
} }

View File

@ -21,11 +21,11 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args,
, ArgumentsBeforeEmpty(true) , ArgumentsBeforeEmpty(true)
, CurrentIndex(0) , CurrentIndex(0)
{ {
if (args != 0) { if (args != CM_NULLPTR) {
args->AddArgument(this); args->AddArgument(this);
} }
if (this->Group != 0) { if (this->Group != CM_NULLPTR) {
this->Group->ContainedArguments.push_back(this); this->Group->ContainedArguments.push_back(this);
} }
} }
@ -45,7 +45,7 @@ void cmCommandArgument::Follows(const cmCommandArgument* arg)
void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
{ {
if (group != 0) { if (group != CM_NULLPTR) {
this->ArgumentsBeforeEmpty = false; this->ArgumentsBeforeEmpty = false;
this->ArgumentsBefore.insert(group->ContainedArguments.begin(), this->ArgumentsBefore.insert(group->ContainedArguments.begin(),
group->ContainedArguments.end()); group->ContainedArguments.end());
@ -69,7 +69,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const
bool cmCommandArgument::KeyMatches(const std::string& key) const bool cmCommandArgument::KeyMatches(const std::string& key) const
{ {
if ((this->Key == 0) || (this->Key[0] == '\0')) { if ((this->Key == CM_NULLPTR) || (this->Key[0] == '\0')) {
return true; return true;
} }
return (key == this->Key); return (key == this->Key);
@ -77,7 +77,7 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const
void cmCommandArgument::ApplyOwnGroup() void cmCommandArgument::ApplyOwnGroup()
{ {
if (this->Group != 0) { if (this->Group != CM_NULLPTR) {
for (std::vector<cmCommandArgument*>::const_iterator it = for (std::vector<cmCommandArgument*>::const_iterator it =
this->Group->ContainedArguments.begin(); this->Group->ContainedArguments.begin();
it != this->Group->ContainedArguments.end(); ++it) { it != this->Group->ContainedArguments.end(); ++it) {
@ -105,9 +105,9 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
const char* key, const char* key,
cmCommandArgumentGroup* group) cmCommandArgumentGroup* group)
: cmCommandArgument(args, key, group) : cmCommandArgument(args, key, group)
, Ignore(0) , Ignore(CM_NULLPTR)
{ {
if ((key == 0) || (*key == 0)) { if ((key == CM_NULLPTR) || (*key == 0)) {
this->DataStart = 0; this->DataStart = 0;
} else { } else {
this->DataStart = 1; this->DataStart = 1;
@ -117,7 +117,7 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index) bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index)
{ {
if (index >= this->DataStart) { if (index >= this->DataStart) {
if ((this->Ignore == 0) || (arg != this->Ignore)) { if ((this->Ignore == CM_NULLPTR) || (arg != this->Ignore)) {
this->Vector.push_back(arg); this->Vector.push_back(arg);
} }
} }
@ -134,7 +134,7 @@ cmCAString::cmCAString(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group) cmCommandArgumentGroup* group)
: cmCommandArgument(args, key, group) : cmCommandArgument(args, key, group)
{ {
if ((key == 0) || (*key == 0)) { if ((key == CM_NULLPTR) || (*key == 0)) {
this->DataStart = 0; this->DataStart = 0;
} else { } else {
this->DataStart = 1; this->DataStart = 1;
@ -216,7 +216,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
std::vector<std::string>* unconsumedArgs) std::vector<std::string>* unconsumedArgs)
{ {
if (args == 0) { if (args == CM_NULLPTR) {
return; return;
} }
@ -227,8 +227,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
(*argIt)->Reset(); (*argIt)->Reset();
} }
cmCommandArgument* activeArgument = 0; cmCommandArgument* activeArgument = CM_NULLPTR;
const cmCommandArgument* previousArgument = 0; const cmCommandArgument* previousArgument = CM_NULLPTR;
for (std::vector<std::string>::const_iterator it = args->begin(); for (std::vector<std::string>::const_iterator it = args->begin();
it != args->end(); ++it) { it != args->end(); ++it) {
for (std::vector<cmCommandArgument*>::iterator argIt = for (std::vector<cmCommandArgument*>::iterator argIt =
@ -246,10 +246,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
bool argDone = activeArgument->Consume(*it); bool argDone = activeArgument->Consume(*it);
previousArgument = activeArgument; previousArgument = activeArgument;
if (argDone) { if (argDone) {
activeArgument = 0; activeArgument = CM_NULLPTR;
} }
} else { } else {
if (unconsumedArgs != 0) { if (unconsumedArgs != CM_NULLPTR) {
unconsumedArgs->push_back(*it); unconsumedArgs->push_back(*it);
} }
} }

View File

@ -43,7 +43,7 @@ class cmCommandArgument
{ {
public: public:
cmCommandArgument(cmCommandArgumentsHelper* args, const char* key, cmCommandArgument(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = 0); cmCommandArgumentGroup* group = CM_NULLPTR);
virtual ~cmCommandArgument() {} virtual ~cmCommandArgument() {}
/// this argument may follow after arg. 0 means it comes first. /// this argument may follow after arg. 0 means it comes first.
@ -95,7 +95,7 @@ class cmCAStringVector : public cmCommandArgument
{ {
public: public:
cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, cmCAStringVector(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = 0); cmCommandArgumentGroup* group = CM_NULLPTR);
/// Return the vector of strings /// Return the vector of strings
const std::vector<std::string>& GetVector() const { return this->Vector; } const std::vector<std::string>& GetVector() const { return this->Vector; }
@ -118,7 +118,7 @@ class cmCAString : public cmCommandArgument
{ {
public: public:
cmCAString(cmCommandArgumentsHelper* args, const char* key, cmCAString(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = 0); cmCommandArgumentGroup* group = CM_NULLPTR);
/// Return the string /// Return the string
const std::string& GetString() const { return this->String; } const std::string& GetString() const { return this->String; }
@ -137,7 +137,7 @@ class cmCAEnabler : public cmCommandArgument
{ {
public: public:
cmCAEnabler(cmCommandArgumentsHelper* args, const char* key, cmCAEnabler(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = 0); cmCommandArgumentGroup* group = CM_NULLPTR);
/// Has it been enabled ? /// Has it been enabled ?
bool IsEnabled() const { return this->Enabled; } bool IsEnabled() const { return this->Enabled; }
@ -154,7 +154,7 @@ class cmCADisabler : public cmCommandArgument
{ {
public: public:
cmCADisabler(cmCommandArgumentsHelper* args, const char* key, cmCADisabler(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = 0); cmCommandArgumentGroup* group = CM_NULLPTR);
/// Is it still enabled ? /// Is it still enabled ?
bool IsEnabled() const { return this->Enabled; } bool IsEnabled() const { return this->Enabled; }

View File

@ -98,7 +98,7 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT"); const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
format = cmOutputConverter::GetFortranFormat(tgtfmt); format = cmOutputConverter::GetFortranFormat(tgtfmt);
} }
const char* var = 0; const char* var = CM_NULLPTR;
switch (format) { switch (format) {
case cmOutputConverter::FortranFormatFixed: case cmOutputConverter::FortranFormatFixed:
var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; var = "CMAKE_Fortran_FORMAT_FIXED_FLAG";

View File

@ -194,7 +194,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
this->OldLinkDirMode = false; this->OldLinkDirMode = false;
// No computation has been done. // No computation has been done.
this->CCG = 0; this->CCG = CM_NULLPTR;
} }
cmComputeLinkDepends::~cmComputeLinkDepends() cmComputeLinkDepends::~cmComputeLinkDepends()
@ -286,7 +286,7 @@ std::map<std::string, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
std::map<std::string, int>::iterator lei = std::map<std::string, int>::iterator lei =
this->LinkEntryIndex.insert(index_entry).first; this->LinkEntryIndex.insert(index_entry).first;
this->EntryList.push_back(LinkEntry()); this->EntryList.push_back(LinkEntry());
this->InferredDependSets.push_back(0); this->InferredDependSets.push_back(CM_NULLPTR);
this->EntryConstraintGraph.push_back(EdgeList()); this->EntryConstraintGraph.push_back(EdgeList());
return lei; return lei;
} }
@ -314,7 +314,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
// If the item has dependencies queue it to follow them. // If the item has dependencies queue it to follow them.
if (entry.Target) { if (entry.Target) {
// Target dependencies are always known. Follow them. // Target dependencies are always known. Follow them.
BFSEntry qe = { index, 0 }; BFSEntry qe = { index, CM_NULLPTR };
this->BFSQueue.push(qe); this->BFSQueue.push(qe);
} else { } else {
// Look for an old-style <item>_LIB_DEPENDS variable. // Look for an old-style <item>_LIB_DEPENDS variable.

View File

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

View File

@ -262,7 +262,7 @@ cmComputeLinkInformation::cmComputeLinkInformation(
this->GlobalGenerator, target, "linker search path"); this->GlobalGenerator, target, "linker search path");
this->OrderRuntimeSearchPath = new cmOrderDirectories( this->OrderRuntimeSearchPath = new cmOrderDirectories(
this->GlobalGenerator, target, "runtime search path"); this->GlobalGenerator, target, "runtime search path");
this->OrderDependentRPath = 0; this->OrderDependentRPath = CM_NULLPTR;
// Get the language used for linking this target. // Get the language used for linking this target.
this->LinkLanguage = this->Target->GetLinkerLanguage(config); this->LinkLanguage = this->Target->GetLinkerLanguage(config);
@ -283,7 +283,7 @@ cmComputeLinkInformation::cmComputeLinkInformation(
// On platforms without import libraries there may be a special flag // On platforms without import libraries there may be a special flag
// to use when creating a plugin (module) that obtains symbols from // to use when creating a plugin (module) that obtains symbols from
// the program that will load it. // the program that will load it.
this->LoaderFlag = 0; this->LoaderFlag = CM_NULLPTR;
if (!this->UseImportLibrary && if (!this->UseImportLibrary &&
this->Target->GetType() == cmState::MODULE_LIBRARY) { this->Target->GetType() == cmState::MODULE_LIBRARY) {
std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
@ -561,7 +561,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
for (std::vector<std::string>::const_iterator i = libsVec.begin(); for (std::vector<std::string>::const_iterator i = libsVec.begin();
i != libsVec.end(); ++i) { i != libsVec.end(); ++i) {
if (this->ImplicitLinkLibs.find(*i) == this->ImplicitLinkLibs.end()) { if (this->ImplicitLinkLibs.find(*i) == this->ImplicitLinkLibs.end()) {
this->AddItem(*i, 0); this->AddItem(*i, CM_NULLPTR);
} }
} }
} }
@ -693,7 +693,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
// Check if we need to include the dependent shared library in other // Check if we need to include the dependent shared library in other
// path ordering. // path ordering.
cmOrderDirectories* order = 0; cmOrderDirectories* order = CM_NULLPTR;
if (this->SharedDependencyMode == SharedDepModeLibDir && if (this->SharedDependencyMode == SharedDepModeLibDir &&
!this->LinkWithRuntimePath /* AddLibraryRuntimeInfo adds it */) { !this->LinkWithRuntimePath /* AddLibraryRuntimeInfo adds it */) {
// Add the item to the linker search path. // Add the item to the linker search path.
@ -705,7 +705,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
if (order) { if (order) {
if (tgt) { if (tgt) {
std::string soName = tgt->GetSOName(this->Config); std::string soName = tgt->GetSOName(this->Config);
const char* soname = soName.empty() ? 0 : soName.c_str(); const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str();
order->AddRuntimeLibrary(lib, soname); order->AddRuntimeLibrary(lib, soname);
} else { } else {
order->AddRuntimeLibrary(lib); order->AddRuntimeLibrary(lib);
@ -724,9 +724,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
this->LinkTypeEnabled = false; this->LinkTypeEnabled = false;
// Lookup link type selection flags. // Lookup link type selection flags.
const char* static_link_type_flag = 0; const char* static_link_type_flag = CM_NULLPTR;
const char* shared_link_type_flag = 0; const char* shared_link_type_flag = CM_NULLPTR;
const char* target_type_str = 0; const char* target_type_str = CM_NULLPTR;
switch (this->Target->GetType()) { switch (this->Target->GetType()) {
case cmState::EXECUTABLE: case cmState::EXECUTABLE:
target_type_str = "EXE"; target_type_str = "EXE";
@ -1606,7 +1606,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(
// Try to get the soname of the library. Only files with this name // Try to get the soname of the library. Only files with this name
// could possibly conflict. // could possibly conflict.
std::string soName = target->GetSOName(this->Config); std::string soName = target->GetSOName(this->Config);
const char* soname = soName.empty() ? 0 : soName.c_str(); const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str();
// Include this library in the runtime path ordering. // Include this library in the runtime path ordering.
this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname);

View File

@ -38,7 +38,7 @@ public:
Item() Item()
: Value() : Value()
, IsPath(true) , IsPath(true)
, Target(0) , Target(CM_NULLPTR)
{ {
} }
Item(Item const& item) Item(Item const& item)
@ -47,7 +47,8 @@ public:
, Target(item.Target) , Target(item.Target)
{ {
} }
Item(std::string const& v, bool p, cmGeneratorTarget const* target = 0) Item(std::string const& v, bool p,
cmGeneratorTarget const* target = CM_NULLPTR)
: Value(v) : Value(v)
, IsPath(p) , IsPath(p)
, Target(target) , Target(target)

View File

@ -291,7 +291,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
// within the project. // within the project.
if (dependee && dependee->GetType() == cmState::EXECUTABLE && if (dependee && dependee->GetType() == cmState::EXECUTABLE &&
!dependee->IsExecutableWithExports()) { !dependee->IsExecutableWithExports()) {
dependee = 0; dependee = CM_NULLPTR;
} }
if (dependee) { if (dependee) {
@ -355,7 +355,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
// within the project. // within the project.
if (linking && dependee && dependee->GetType() == cmState::EXECUTABLE && if (linking && dependee && dependee->GetType() == cmState::EXECUTABLE &&
!dependee->IsExecutableWithExports()) { !dependee->IsExecutableWithExports()) {
dependee = 0; dependee = CM_NULLPTR;
} }
if (dependee) { if (dependee) {

View File

@ -130,7 +130,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
if ((this->Policy54Status != cmPolicies::WARN && if ((this->Policy54Status != cmPolicies::WARN &&
this->Policy54Status != cmPolicies::OLD) && this->Policy54Status != cmPolicies::OLD) &&
argument.WasQuoted()) { argument.WasQuoted()) {
return 0; return CM_NULLPTR;
} }
const char* def = this->Makefile.GetDefinition(argument.GetValue()); const char* def = this->Makefile.GetDefinition(argument.GetValue());

View File

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

View File

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

View File

@ -16,6 +16,6 @@
#include "cm_curl.h" #include "cm_curl.h"
std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = 0); std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR);
#endif #endif

View File

@ -38,7 +38,7 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
, Backtrace() , Backtrace()
, Comment(comment ? comment : "") , Comment(comment ? comment : "")
, WorkingDirectory(workingDirectory ? workingDirectory : "") , WorkingDirectory(workingDirectory ? workingDirectory : "")
, HaveComment(comment != NULL) , HaveComment(comment != CM_NULLPTR)
, EscapeAllowMakeVars(false) , EscapeAllowMakeVars(false)
, EscapeOldStyle(true) , EscapeOldStyle(true)
{ {
@ -69,7 +69,7 @@ const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
const char* cmCustomCommand::GetComment() const const char* cmCustomCommand::GetComment() const
{ {
const char* no_comment = 0; const char* no_comment = CM_NULLPTR;
return this->HaveComment ? this->Comment.c_str() : no_comment; return this->HaveComment ? this->Comment.c_str() : no_comment;
} }

View File

@ -45,7 +45,7 @@ bool cmCustomCommandGenerator::UseCrossCompilingEmulator(unsigned int c) const
std::string const& argv0 = this->CC.GetCommandLines()[c][0]; std::string const& argv0 = this->CC.GetCommandLines()[c][0];
cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0);
if (target && target->GetType() == cmState::EXECUTABLE) { if (target && target->GetType() == cmState::EXECUTABLE) {
return target->GetProperty("CROSSCOMPILING_EMULATOR") != 0; return target->GetProperty("CROSSCOMPILING_EMULATOR") != CM_NULLPTR;
} }
return false; return false;
} }

View File

@ -41,7 +41,7 @@ const char* cmDefinitions::Get(const std::string& key, StackIter begin,
StackIter end) StackIter end)
{ {
Def const& def = cmDefinitions::GetInternal(key, begin, end, false); Def const& def = cmDefinitions::GetInternal(key, begin, end, false);
return def.Exists ? def.c_str() : 0; return def.Exists ? def.c_str() : CM_NULLPTR;
} }
void cmDefinitions::Raise(const std::string& key, StackIter begin, void cmDefinitions::Raise(const std::string& key, StackIter begin,

View File

@ -23,7 +23,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
: CompileDirectory() : CompileDirectory()
, LocalGenerator(lg) , LocalGenerator(lg)
, Verbose(false) , Verbose(false)
, FileComparison(0) , FileComparison(CM_NULLPTR)
, TargetDirectory(targetDir) , TargetDirectory(targetDir)
, MaxPath(16384) , MaxPath(16384)
, Dependee(new char[MaxPath]) , Dependee(new char[MaxPath])
@ -140,7 +140,7 @@ bool cmDepends::CheckDependencies(
// regenerated. // regenerated.
bool okay = true; bool okay = true;
bool dependerExists = false; bool dependerExists = false;
DependencyVector* currentDependencies = 0; DependencyVector* currentDependencies = CM_NULLPTR;
while (internalDepends.getline(this->Dependee, this->MaxPath)) { while (internalDepends.getline(this->Dependee, this->MaxPath)) {
if (this->Dependee[0] == 0 || this->Dependee[0] == '#' || if (this->Dependee[0] == 0 || this->Dependee[0] == '#' ||
@ -182,7 +182,7 @@ bool cmDepends::CheckDependencies(
bool regenerate = false; bool regenerate = false;
const char* dependee = this->Dependee + 1; const char* dependee = this->Dependee + 1;
const char* depender = this->Depender; const char* depender = this->Depender;
if (currentDependencies != 0) { if (currentDependencies != CM_NULLPTR) {
currentDependencies->push_back(dependee); currentDependencies->push_back(dependee);
} }
@ -242,9 +242,9 @@ bool cmDepends::CheckDependencies(
// Remove the information of this depender from the map, it needs // Remove the information of this depender from the map, it needs
// to be rescanned // to be rescanned
if (currentDependencies != 0) { if (currentDependencies != CM_NULLPTR) {
validDeps.erase(this->Depender); validDeps.erase(this->Depender);
currentDependencies = 0; currentDependencies = CM_NULLPTR;
} }
// Remove the depender to be sure it is rebuilt. // Remove the depender to be sure it is rebuilt.
@ -261,7 +261,7 @@ bool cmDepends::CheckDependencies(
void cmDepends::SetIncludePathFromLanguage(const std::string& lang) void cmDepends::SetIncludePathFromLanguage(const std::string& lang)
{ {
// Look for the new per "TARGET_" variant first: // Look for the new per "TARGET_" variant first:
const char* includePath = 0; const char* includePath = CM_NULLPTR;
std::string includePathVar = "CMAKE_"; std::string includePathVar = "CMAKE_";
includePathVar += lang; includePathVar += lang;
includePathVar += "_TARGET_INCLUDE_PATH"; includePathVar += "_TARGET_INCLUDE_PATH";

View File

@ -29,7 +29,7 @@ class cmDepends
public: public:
/** Instances need to know the build directory name and the relative /** Instances need to know the build directory name and the relative
path from the build directory to the target file. */ path from the build directory to the target file. */
cmDepends(cmLocalGenerator* lg = 0, const char* targetDir = ""); cmDepends(cmLocalGenerator* lg = CM_NULLPTR, const char* targetDir = "");
/** at what level will the compile be done from */ /** at what level will the compile be done from */
void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; } void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; }

View File

@ -29,7 +29,7 @@
#define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: " #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
cmDependsC::cmDependsC() cmDependsC::cmDependsC()
: ValidDeps(0) : ValidDeps(CM_NULLPTR)
{ {
} }
@ -105,7 +105,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
std::set<std::string> dependencies; std::set<std::string> dependencies;
bool haveDeps = false; bool haveDeps = false;
if (this->ValidDeps != 0) { if (this->ValidDeps != CM_NULLPTR) {
std::map<std::string, DependencyVector>::const_iterator tmpIt = std::map<std::string, DependencyVector>::const_iterator tmpIt =
this->ValidDeps->find(obj); this->ValidDeps->find(obj);
if (tmpIt != this->ValidDeps->end()) { if (tmpIt != this->ValidDeps->end()) {
@ -269,12 +269,12 @@ void cmDependsC::ReadCacheFile()
} }
std::string line; std::string line;
cmIncludeLines* cacheEntry = 0; cmIncludeLines* cacheEntry = CM_NULLPTR;
bool haveFileName = false; bool haveFileName = false;
while (cmSystemTools::GetLineFromStream(fin, line)) { while (cmSystemTools::GetLineFromStream(fin, line)) {
if (line.empty()) { if (line.empty()) {
cacheEntry = 0; cacheEntry = CM_NULLPTR;
haveFileName = false; haveFileName = false;
continue; continue;
} }
@ -312,7 +312,7 @@ void cmDependsC::ReadCacheFile()
} }
} }
} }
} else if (cacheEntry != 0) { } else if (cacheEntry != CM_NULLPTR) {
UnscannedEntry entry; UnscannedEntry entry;
entry.FileName = line; entry.FileName = line;
if (cmSystemTools::GetLineFromStream(fin, line)) { if (cmSystemTools::GetLineFromStream(fin, line)) {

View File

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

View File

@ -59,7 +59,7 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt)
if (!*pt) { if (!*pt) {
return; return;
} }
*pt = 0; *pt = CM_NULLPTR;
this->UnionsAvailable--; this->UnionsAvailable--;
} }
@ -160,13 +160,13 @@ void cmDependsJavaParserHelper::PrepareElement(
cmDependsJavaParserHelper::ParserType* me) cmDependsJavaParserHelper::ParserType* me)
{ {
// Inititalize self // Inititalize self
me->str = 0; me->str = CM_NULLPTR;
} }
void cmDependsJavaParserHelper::AllocateParserType( void cmDependsJavaParserHelper::AllocateParserType(
cmDependsJavaParserHelper::ParserType* pt, const char* str, int len) cmDependsJavaParserHelper::ParserType* pt, const char* str, int len)
{ {
pt->str = 0; pt->str = CM_NULLPTR;
if (len == 0) { if (len == 0) {
len = (int)strlen(str); len = (int)strlen(str);
} }
@ -226,7 +226,7 @@ std::vector<std::string> cmDependsJavaParserHelper::GetFilesProduced()
std::vector<CurrentClass>::const_iterator it; std::vector<CurrentClass>::const_iterator it;
for (it = toplevel.NestedClasses.begin(); it != toplevel.NestedClasses.end(); for (it = toplevel.NestedClasses.begin(); it != toplevel.NestedClasses.end();
++it) { ++it) {
it->AddFileNamesForPrinting(&files, 0, "$"); it->AddFileNamesForPrinting(&files, CM_NULLPTR, "$");
} }
return files; return files;
} }
@ -326,7 +326,7 @@ void cmDependsJavaParserHelper::Error(const char* str)
void cmDependsJavaParserHelper::UpdateCombine(const char* str1, void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
const char* str2) const char* str2)
{ {
if (this->CurrentCombine == "" && str1 != 0) { if (this->CurrentCombine == "" && str1 != CM_NULLPTR) {
this->CurrentCombine = str1; this->CurrentCombine = str1;
} }
this->CurrentCombine += "."; this->CurrentCombine += ".";

View File

@ -49,12 +49,12 @@ static const char* cmDocumentationStandardOptions[][2] = {
{ "--help-variable-list [<f>]", { "--help-variable-list [<f>]",
"List variables with help available and exit." }, "List variables with help available and exit." },
{ "--help-variables [<f>]", "Print cmake-variables manual and exit." }, { "--help-variables [<f>]", "Print cmake-variables manual and exit." },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
static const char* cmDocumentationGeneratorsHeader[][2] = { static const char* cmDocumentationGeneratorsHeader[][2] = {
{ 0, "The following generators are available on this platform:" }, { CM_NULLPTR, "The following generators are available on this platform:" },
{ 0, 0 } { CM_NULLPTR, CM_NULLPTR }
}; };
cmDocumentation::cmDocumentation() cmDocumentation::cmDocumentation()
@ -137,7 +137,7 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
this->CurrentArgument = i->Argument; this->CurrentArgument = i->Argument;
// If a file name was given, use it. Otherwise, default to the // If a file name was given, use it. Otherwise, default to the
// given stream. // given stream.
cmsys::ofstream* fout = 0; cmsys::ofstream* fout = CM_NULLPTR;
std::ostream* s = &os; std::ostream* s = &os;
if (!i->Filename.empty()) { if (!i->Filename.empty()) {
fout = new cmsys::ofstream(i->Filename.c_str()); fout = new cmsys::ofstream(i->Filename.c_str());
@ -420,7 +420,7 @@ void cmDocumentation::SetSections(
void cmDocumentation::PrependSection(const char* name, const char* docs[][2]) void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
{ {
cmDocumentationSection* sec = 0; cmDocumentationSection* sec = CM_NULLPTR;
if (this->AllSections.find(name) == this->AllSections.end()) { if (this->AllSections.find(name) == this->AllSections.end()) {
sec = sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@ -434,7 +434,7 @@ void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
void cmDocumentation::PrependSection(const char* name, void cmDocumentation::PrependSection(const char* name,
std::vector<cmDocumentationEntry>& docs) std::vector<cmDocumentationEntry>& docs)
{ {
cmDocumentationSection* sec = 0; cmDocumentationSection* sec = CM_NULLPTR;
if (this->AllSections.find(name) == this->AllSections.end()) { if (this->AllSections.find(name) == this->AllSections.end()) {
sec = sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@ -447,7 +447,7 @@ void cmDocumentation::PrependSection(const char* name,
void cmDocumentation::AppendSection(const char* name, const char* docs[][2]) void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
{ {
cmDocumentationSection* sec = 0; cmDocumentationSection* sec = CM_NULLPTR;
if (this->AllSections.find(name) == this->AllSections.end()) { if (this->AllSections.find(name) == this->AllSections.end()) {
sec = sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@ -461,7 +461,7 @@ void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
void cmDocumentation::AppendSection(const char* name, void cmDocumentation::AppendSection(const char* name,
std::vector<cmDocumentationEntry>& docs) std::vector<cmDocumentationEntry>& docs)
{ {
cmDocumentationSection* sec = 0; cmDocumentationSection* sec = CM_NULLPTR;
if (this->AllSections.find(name) == this->AllSections.end()) { if (this->AllSections.find(name) == this->AllSections.end()) {
sec = sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());

View File

@ -39,7 +39,7 @@ public:
* help arguments. * help arguments.
*/ */
bool CheckOptions(int argc, const char* const* argv, bool CheckOptions(int argc, const char* const* argv,
const char* exitOpt = 0); const char* exitOpt = CM_NULLPTR);
/** /**
* Print help requested on the command line. Call after * Print help requested on the command line. Call after

View File

@ -26,7 +26,7 @@ private:
static cmDynamicLoaderCache* Instance; static cmDynamicLoaderCache* Instance;
}; };
cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = 0; cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = CM_NULLPTR;
cmDynamicLoaderCache::~cmDynamicLoaderCache() cmDynamicLoaderCache::~cmDynamicLoaderCache()
{ {
@ -75,7 +75,7 @@ void cmDynamicLoaderCache::FlushCache()
cmsys::DynamicLoader::CloseLibrary(it->second); cmsys::DynamicLoader::CloseLibrary(it->second);
} }
delete cmDynamicLoaderCache::Instance; delete cmDynamicLoaderCache::Instance;
cmDynamicLoaderCache::Instance = 0; cmDynamicLoaderCache::Instance = CM_NULLPTR;
} }
cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance() cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance()

View File

@ -672,7 +672,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (dssi->second.Position > 0) { if (dssi->second.Position > 0) {
return &dssi->second; return &dssi->second;
} }
return 0; return CM_NULLPTR;
} }
// Create an entry for this tag. Assume it is missing until found. // Create an entry for this tag. Assume it is missing until found.
@ -683,14 +683,14 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
// Try reading the dynamic section. // Try reading the dynamic section.
if (!this->LoadDynamicSection()) { if (!this->LoadDynamicSection()) {
return 0; return CM_NULLPTR;
} }
// Get the string table referenced by the DYNAMIC section. // Get the string table referenced by the DYNAMIC section.
ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex];
if (sec.sh_link >= this->SectionHeaders.size()) { if (sec.sh_link >= this->SectionHeaders.size()) {
this->SetErrorMessage("Section DYNAMIC has invalid string table index."); this->SetErrorMessage("Section DYNAMIC has invalid string table index.");
return 0; return CM_NULLPTR;
} }
ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link]; ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link];
@ -705,7 +705,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (dyn.d_un.d_val >= strtab.sh_size) { if (dyn.d_un.d_val >= strtab.sh_size) {
this->SetErrorMessage("Section DYNAMIC references string beyond " this->SetErrorMessage("Section DYNAMIC references string beyond "
"the end of its string section."); "the end of its string section.");
return 0; return CM_NULLPTR;
} }
// Seek to the position reported by the entry. // Seek to the position reported by the entry.
@ -734,7 +734,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (!this->Stream) { if (!this->Stream) {
this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); this->SetErrorMessage("Dynamic section specifies unreadable RPATH.");
se.Value = ""; se.Value = "";
return 0; return CM_NULLPTR;
} }
// The value has been read successfully. Report it. // The value has been read successfully. Report it.
@ -745,14 +745,14 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
return &se; return &se;
} }
} }
return 0; return CM_NULLPTR;
} }
//============================================================================ //============================================================================
// External class implementation. // External class implementation.
cmELF::cmELF(const char* fname) cmELF::cmELF(const char* fname)
: Internal(0) : Internal(CM_NULLPTR)
{ {
// Try to open the file. // Try to open the file.
cmsys::auto_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname)); cmsys::auto_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
@ -879,7 +879,7 @@ cmELF::StringEntry const* cmELF::GetSOName()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) { this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) {
return this->Internal->GetSOName(); return this->Internal->GetSOName();
} else { } else {
return 0; return CM_NULLPTR;
} }
} }
@ -890,7 +890,7 @@ cmELF::StringEntry const* cmELF::GetRPath()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRPath(); return this->Internal->GetRPath();
} else { } else {
return 0; return CM_NULLPTR;
} }
} }
@ -901,7 +901,7 @@ cmELF::StringEntry const* cmELF::GetRunPath()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRunPath(); return this->Internal->GetRunPath();
} else { } else {
return 0; return CM_NULLPTR;
} }
} }

View File

@ -90,7 +90,7 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args,
args[1].c_str(), verbose); args[1].c_str(), verbose);
} else { } else {
result = cmExecProgramCommand::RunCommand(command.c_str(), output, retVal, result = cmExecProgramCommand::RunCommand(command.c_str(), output, retVal,
0, verbose); CM_NULLPTR, verbose);
} }
if (!result) { if (!result) {
retVal = -1; retVal = -1;
@ -209,7 +209,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
} }
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
const char* cmd[] = { "/bin/sh", "-c", command, 0 }; const char* cmd[] = { "/bin/sh", "-c", command, CM_NULLPTR };
cmsysProcess_SetCommand(cp, cmd); cmsysProcess_SetCommand(cp, cmd);
#endif #endif
@ -219,7 +219,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
int length; int length;
char* data; char* data;
int p; int p;
while ((p = cmsysProcess_WaitForData(cp, &data, &length, 0), p)) { while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) { if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) {
if (verbose) { if (verbose) {
cmSystemTools::Stdout(data, length); cmSystemTools::Stdout(data, length);
@ -229,7 +229,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
} }
// All output has been read. Wait for the process to exit. // All output has been read. Wait for the process to exit.
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
// Check the result of running the process. // Check the result of running the process.
std::string msg; std::string msg;

View File

@ -50,7 +50,8 @@ public:
private: private:
static bool RunCommand(const char* command, std::string& output, int& retVal, static bool RunCommand(const char* command, std::string& output, int& retVal,
const char* directory = 0, bool verbose = true); const char* directory = CM_NULLPTR,
bool verbose = true);
}; };
#endif #endif

View File

@ -161,7 +161,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
return false; return false;
} else { } else {
// Add the null terminating pointer to the command argument list. // Add the null terminating pointer to the command argument list.
cmds[i].push_back(0); cmds[i].push_back(CM_NULLPTR);
} }
} }
@ -228,7 +228,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
int length; int length;
char* data; char* data;
int p; int p;
while ((p = cmsysProcess_WaitForData(cp, &data, &length, 0), p)) { while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
// Put the output in the right place. // Put the output in the right place.
if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) { if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) {
if (output_variable.empty()) { if (output_variable.empty()) {
@ -246,7 +246,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
} }
// All output has been read. Wait for the process to exit. // All output has been read. Wait for the process to exit.
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, CM_NULLPTR);
// Fix the text in the output strings. // Fix the text in the output strings.
cmExecuteProcessCommandFixText(tempOutput, output_strip_trailing_whitespace); cmExecuteProcessCommandFixText(tempOutput, output_strip_trailing_whitespace);

View File

@ -18,8 +18,8 @@
cmExportBuildFileGenerator::cmExportBuildFileGenerator() cmExportBuildFileGenerator::cmExportBuildFileGenerator()
{ {
this->LG = 0; this->LG = CM_NULLPTR;
this->ExportSet = 0; this->ExportSet = CM_NULLPTR;
} }
void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg) void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg)

View File

@ -35,7 +35,7 @@ cmExportCommand::cmExportCommand()
, Filename(&Helper, "FILE", &ArgumentGroup) , Filename(&Helper, "FILE", &ArgumentGroup)
, ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup) , ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup)
{ {
this->ExportSet = 0; this->ExportSet = CM_NULLPTR;
} }
// cmExportCommand // cmExportCommand
@ -50,10 +50,10 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
if (args[0] == "PACKAGE") { if (args[0] == "PACKAGE") {
return this->HandlePackage(args); return this->HandlePackage(args);
} else if (args[0] == "EXPORT") { } else if (args[0] == "EXPORT") {
this->ExportSetName.Follows(0); this->ExportSetName.Follows(CM_NULLPTR);
this->ArgumentGroup.Follows(&this->ExportSetName); this->ArgumentGroup.Follows(&this->ExportSetName);
} else { } else {
this->Targets.Follows(0); this->Targets.Follows(CM_NULLPTR);
this->ArgumentGroup.Follows(&this->Targets); this->ArgumentGroup.Follows(&this->Targets);
} }

View File

@ -63,7 +63,8 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorExpression ge; cmGeneratorExpression ge;
cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, 0, 0); cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName,
CM_NULLPTR, CM_NULLPTR);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);

View File

@ -21,7 +21,7 @@ int cmExpr_yyparse(yyscan_t yyscanner);
cmExprParserHelper::cmExprParserHelper() cmExprParserHelper::cmExprParserHelper()
{ {
this->FileLine = -1; this->FileLine = -1;
this->FileName = 0; this->FileName = CM_NULLPTR;
} }
cmExprParserHelper::~cmExprParserHelper() cmExprParserHelper::~cmExprParserHelper()

View File

@ -289,8 +289,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
xml.StartElement("Build"); xml.StartElement("Build");
this->AppendTarget(xml, "all", 0, make.c_str(), lgs[0], compiler.c_str(), this->AppendTarget(xml, "all", CM_NULLPTR, make.c_str(), lgs[0],
makeArgs); compiler.c_str(), makeArgs);
// add all executable and library targets and some of the GLOBAL // add all executable and library targets and some of the GLOBAL
// and UTILITY targets // and UTILITY targets
@ -306,7 +306,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// not from the subdirs // not from the subdirs
if (strcmp((*lg)->GetCurrentBinaryDirectory(), if (strcmp((*lg)->GetCurrentBinaryDirectory(),
(*lg)->GetBinaryDirectory()) == 0) { (*lg)->GetBinaryDirectory()) == 0) {
this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg,
compiler.c_str(), makeArgs); compiler.c_str(), makeArgs);
} }
} break; } break;
@ -322,7 +322,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
break; break;
} }
this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg,
compiler.c_str(), makeArgs); compiler.c_str(), makeArgs);
break; break;
case cmState::EXECUTABLE: case cmState::EXECUTABLE:
@ -515,7 +515,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
xml.StartElement("Target"); xml.StartElement("Target");
xml.Attribute("title", targetName); xml.Attribute("title", targetName);
if (target != 0) { if (target != CM_NULLPTR) {
int cbTargetType = this->GetCBTargetType(target); int cbTargetType = this->GetCBTargetType(target);
std::string workingDir = lg->GetCurrentBinaryDirectory(); std::string workingDir = lg->GetCurrentBinaryDirectory();
if (target->GetType() == cmState::EXECUTABLE) { if (target->GetType() == cmState::EXECUTABLE) {
@ -523,12 +523,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
// set the working directory to this dir. // set the working directory to this dir.
const char* runtimeOutputDir = const char* runtimeOutputDir =
makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"); makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY");
if (runtimeOutputDir != 0) { if (runtimeOutputDir != CM_NULLPTR) {
workingDir = runtimeOutputDir; workingDir = runtimeOutputDir;
} else { } else {
const char* executableOutputDir = const char* executableOutputDir =
makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
if (executableOutputDir != 0) { if (executableOutputDir != CM_NULLPTR) {
workingDir = executableOutputDir; workingDir = executableOutputDir;
} }
} }

View File

@ -217,17 +217,17 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
// now we have both, decide which one to use // now we have both, decide which one to use
std::string valueToUse; std::string valueToUse;
if (envVarValue == 0 && cacheValue == 0) { if (envVarValue == CM_NULLPTR && cacheValue == CM_NULLPTR) {
// nothing known, do nothing // nothing known, do nothing
valueToUse = ""; valueToUse = "";
} else if (envVarValue != 0 && cacheValue == 0) { } else if (envVarValue != CM_NULLPTR && cacheValue == CM_NULLPTR) {
// The variable is in the env, but not in the cache. Use it and put it // The variable is in the env, but not in the cache. Use it and put it
// in the cache // in the cache
valueToUse = envVarValue; valueToUse = envVarValue;
mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
cacheEntryName.c_str(), cmState::STRING, true); cacheEntryName.c_str(), cmState::STRING, true);
mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory()); mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
} else if (envVarValue == 0 && cacheValue != 0) { } else if (envVarValue == CM_NULLPTR && cacheValue != CM_NULLPTR) {
// It is already in the cache, but not in the env, so use it from the cache // It is already in the cache, but not in the env, so use it from the cache
valueToUse = cacheValue; valueToUse = cacheValue;
} else { } else {

Some files were not shown because too many files have changed in this diff Show More