Merge topic 'compiler-features'

059a6ca0 Merge branch 'unknown-aliased-target' into compiler-features
1d6909a2 use CM_NULLPTR
b4b73f56 cxx features: add check for nullptr
a7a92390 mark functions with CM_OVERRIDE
9e2d6f0c CM_OVERRIDE: mark destructor overridden in the feature test.
2ca76a66 Validate target name in ALIASED_TARGET property getter
This commit is contained in:
Brad King 2016-06-28 09:06:39 -04:00 committed by CMake Topic Stage
commit f913121758
401 changed files with 2302 additions and 2123 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

@ -46,7 +46,7 @@ public:
/** /**
* Destruct IFW generator * Destruct IFW generator
*/ */
virtual ~cmCPackIFWGenerator(); ~cmCPackIFWGenerator() CM_OVERRIDE;
/** /**
* Compare \a version with QtIFW framework version * Compare \a version with QtIFW framework version
@ -70,18 +70,18 @@ protected:
* @brief Initialize generator * @brief Initialize generator
* @return 0 on failure * @return 0 on failure
*/ */
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
virtual int PackageFiles(); int PackageFiles() CM_OVERRIDE;
virtual const char* GetPackagingInstallPrefix(); const char* GetPackagingInstallPrefix() CM_OVERRIDE;
/** /**
* @brief Extension of binary installer * @brief Extension of binary installer
* @return Executable suffix or value from default implementation * @return Executable suffix or value from default implementation
*/ */
virtual const char* GetOutputExtension(); const char* GetOutputExtension() CM_OVERRIDE;
virtual std::string GetComponentInstallDirNameSuffix( std::string GetComponentInstallDirNameSuffix(
const std::string& componentName); const std::string& componentName) CM_OVERRIDE;
/** /**
* @brief Get Component * @brief Get Component
@ -92,8 +92,8 @@ protected:
* *
* @return Pointer to component * @return Pointer to component
*/ */
virtual cmCPackComponent* GetComponent(const std::string& projectName, cmCPackComponent* GetComponent(const std::string& projectName,
const std::string& componentName); const std::string& componentName) CM_OVERRIDE;
/** /**
* @brief Get group of component * @brief Get group of component
@ -104,12 +104,13 @@ protected:
* *
* @return Pointer to component group * @return Pointer to component group
*/ */
virtual cmCPackComponentGroup* GetComponentGroup( cmCPackComponentGroup* GetComponentGroup(
const std::string& projectName, const std::string& groupName); const std::string& projectName, const std::string& groupName) CM_OVERRIDE;
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const; enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
virtual bool SupportsAbsoluteDestination() const; CM_OVERRIDE;
virtual bool SupportsComponentInstallation() const; bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
protected: protected:
// Methods // Methods

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

@ -27,10 +27,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPack7zGenerator(); cmCPack7zGenerator();
virtual ~cmCPack7zGenerator(); ~cmCPack7zGenerator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".7z"; } const char* GetOutputExtension() CM_OVERRIDE { return ".7z"; }
}; };
#endif #endif

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

@ -32,14 +32,14 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format); cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format);
virtual ~cmCPackArchiveGenerator(); ~cmCPackArchiveGenerator() CM_OVERRIDE;
// Used to add a header to the archive // Used to add a header to the archive
virtual int GenerateHeader(std::ostream* os); virtual int GenerateHeader(std::ostream* os);
// component support // component support
virtual bool SupportsComponentInstallation() const; bool SupportsComponentInstallation() const CM_OVERRIDE;
protected: protected:
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
/** /**
* Add the files belonging to the specified component * Add the files belonging to the specified component
* to the provided (already opened) archive. * to the provided (already opened) archive.
@ -55,7 +55,7 @@ protected:
* method will call either PackageComponents or * method will call either PackageComponents or
* PackageComponentsAllInOne. * PackageComponentsAllInOne.
*/ */
int PackageFiles(); int PackageFiles() CM_OVERRIDE;
/** /**
* The method used to package files when component * The method used to package files when component
* install is used. This will create one * install is used. This will create one
@ -67,7 +67,7 @@ protected:
* components will be put in a single installer. * components will be put in a single installer.
*/ */
int PackageComponentsAllInOne(); int PackageComponentsAllInOne();
virtual const char* GetOutputExtension() = 0; const char* GetOutputExtension() CM_OVERRIDE = 0;
cmArchiveWrite::Compress Compress; cmArchiveWrite::Compress Compress;
std::string ArchiveFormat; std::string ArchiveFormat;
}; };

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

@ -28,7 +28,7 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackDebGenerator(); cmCPackDebGenerator();
virtual ~cmCPackDebGenerator(); ~cmCPackDebGenerator() CM_OVERRIDE;
static bool CanGenerate() static bool CanGenerate()
{ {
@ -45,7 +45,7 @@ public:
} }
protected: protected:
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
/** /**
* This method factors out the work done in component packaging case. * This method factors out the work done in component packaging case.
*/ */
@ -62,11 +62,11 @@ protected:
* components will be put in a single installer. * components will be put in a single installer.
*/ */
int PackageComponentsAllInOne(const std::string& compInstDirName); int PackageComponentsAllInOne(const std::string& compInstDirName);
virtual int PackageFiles(); int PackageFiles() CM_OVERRIDE;
virtual const char* GetOutputExtension() { return ".deb"; } const char* GetOutputExtension() CM_OVERRIDE { return ".deb"; }
virtual bool SupportsComponentInstallation() const; bool SupportsComponentInstallation() const CM_OVERRIDE;
virtual std::string GetComponentInstallDirNameSuffix( std::string GetComponentInstallDirNameSuffix(
const std::string& componentName); const std::string& componentName) CM_OVERRIDE;
private: private:
int createDeb(); int createDeb();

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

@ -101,7 +101,7 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackGenerator(); cmCPackGenerator();
virtual ~cmCPackGenerator(); ~cmCPackGenerator() CM_OVERRIDE;
//! Set and get the options //! Set and get the options
void SetOption(const std::string& op, const char* value); void SetOption(const std::string& op, const char* value);
@ -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,7 +28,7 @@ public:
cmTypeMacro(cmCPackGeneratorFactory, cmObject); cmTypeMacro(cmCPackGeneratorFactory, cmObject);
cmCPackGeneratorFactory(); cmCPackGeneratorFactory();
~cmCPackGeneratorFactory(); ~cmCPackGeneratorFactory() CM_OVERRIDE;
//! Get the generator //! Get the generator
cmCPackGenerator* NewGenerator(const std::string& name); cmCPackGenerator* NewGenerator(const std::string& name);

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

@ -42,7 +42,7 @@ public:
cmTypeMacro(cmCPackLog, cmObject); cmTypeMacro(cmCPackLog, cmObject);
cmCPackLog(); cmCPackLog();
~cmCPackLog(); ~cmCPackLog() CM_OVERRIDE;
enum __log_tags enum __log_tags
{ {

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

@ -36,21 +36,22 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackNSISGenerator(bool nsis64 = false); cmCPackNSISGenerator(bool nsis64 = false);
virtual ~cmCPackNSISGenerator(); ~cmCPackNSISGenerator() CM_OVERRIDE;
protected: protected:
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr); void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr);
int PackageFiles(); int PackageFiles() CM_OVERRIDE;
virtual const char* GetOutputExtension() { return ".exe"; } const char* GetOutputExtension() CM_OVERRIDE { return ".exe"; }
virtual const char* GetOutputPostfix() { return "win32"; } const char* GetOutputPostfix() CM_OVERRIDE { return "win32"; }
bool GetListOfSubdirectories(const char* dir, bool GetListOfSubdirectories(const char* dir,
std::vector<std::string>& dirs); std::vector<std::string>& dirs);
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const; enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
virtual bool SupportsAbsoluteDestination() const; CM_OVERRIDE;
virtual bool SupportsComponentInstallation() const; bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
/// Produce a string that contains the NSIS code to describe a /// Produce a string that contains the NSIS code to describe a
/// particular component. Any added macros will be emitted via /// particular component. Any added macros will be emitted via

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

@ -32,7 +32,7 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackRPMGenerator(); cmCPackRPMGenerator();
virtual ~cmCPackRPMGenerator(); ~cmCPackRPMGenerator() CM_OVERRIDE;
static bool CanGenerate() static bool CanGenerate()
{ {
@ -49,8 +49,8 @@ public:
} }
protected: protected:
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
virtual int PackageFiles(); int PackageFiles() CM_OVERRIDE;
/** /**
* This method factors out the work done in component packaging case. * This method factors out the work done in component packaging case.
*/ */
@ -67,10 +67,10 @@ protected:
* components will be put in a single installer. * components will be put in a single installer.
*/ */
int PackageComponentsAllInOne(const std::string& compInstDirName); int PackageComponentsAllInOne(const std::string& compInstDirName);
virtual const char* GetOutputExtension() { return ".rpm"; } const char* GetOutputExtension() CM_OVERRIDE { return ".rpm"; }
virtual bool SupportsComponentInstallation() const; bool SupportsComponentInstallation() const CM_OVERRIDE;
virtual std::string GetComponentInstallDirNameSuffix( std::string GetComponentInstallDirNameSuffix(
const std::string& componentName); const std::string& componentName) CM_OVERRIDE;
void AddGeneratedPackageNames(); void AddGeneratedPackageNames();
}; };

View File

@ -28,13 +28,13 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackSTGZGenerator(); cmCPackSTGZGenerator();
virtual ~cmCPackSTGZGenerator(); ~cmCPackSTGZGenerator() CM_OVERRIDE;
protected: protected:
int PackageFiles(); int PackageFiles() CM_OVERRIDE;
virtual int InitializeInternal(); int InitializeInternal() CM_OVERRIDE;
int GenerateHeader(std::ostream* os); int GenerateHeader(std::ostream* os) CM_OVERRIDE;
virtual const char* GetOutputExtension() { return ".sh"; } const char* GetOutputExtension() CM_OVERRIDE { return ".sh"; }
}; };
#endif #endif

View File

@ -27,10 +27,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackTGZGenerator(); cmCPackTGZGenerator();
virtual ~cmCPackTGZGenerator(); ~cmCPackTGZGenerator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".tar.gz"; } const char* GetOutputExtension() CM_OVERRIDE { return ".tar.gz"; }
}; };
#endif #endif

View File

@ -27,10 +27,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackTXZGenerator(); cmCPackTXZGenerator();
virtual ~cmCPackTXZGenerator(); ~cmCPackTXZGenerator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".tar.xz"; } const char* GetOutputExtension() CM_OVERRIDE { return ".tar.xz"; }
}; };
#endif #endif

View File

@ -26,10 +26,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackTarBZip2Generator(); cmCPackTarBZip2Generator();
virtual ~cmCPackTarBZip2Generator(); ~cmCPackTarBZip2Generator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".tar.bz2"; } const char* GetOutputExtension() CM_OVERRIDE { return ".tar.bz2"; }
}; };
#endif #endif

View File

@ -26,10 +26,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackTarCompressGenerator(); cmCPackTarCompressGenerator();
virtual ~cmCPackTarCompressGenerator(); ~cmCPackTarCompressGenerator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".tar.Z"; } const char* GetOutputExtension() CM_OVERRIDE { return ".tar.Z"; }
}; };
#endif #endif

View File

@ -27,10 +27,10 @@ public:
* Construct generator * Construct generator
*/ */
cmCPackZIPGenerator(); cmCPackZIPGenerator();
virtual ~cmCPackZIPGenerator(); ~cmCPackZIPGenerator() CM_OVERRIDE;
protected: protected:
virtual const char* GetOutputExtension() { return ".zip"; } const char* GetOutputExtension() CM_OVERRIDE { return ".zip"; }
}; };
#endif #endif

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> ");
@ -183,14 +183,15 @@ public:
{ {
this->InitializeParser(); this->InitializeParser();
} }
~LogParser() { this->CleanupParser(); } ~LogParser() CM_OVERRIDE { this->CleanupParser(); }
int InitializeParser() CM_OVERRIDE int InitializeParser() CM_OVERRIDE
{ {
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

@ -24,20 +24,20 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestBZR(cmCTest* ctest, std::ostream& log); cmCTestBZR(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestBZR(); ~cmCTestBZR() CM_OVERRIDE;
private: private:
// Implement cmCTestVC internal API. // Implement cmCTestVC internal API.
virtual void NoteOldRevision(); void NoteOldRevision() CM_OVERRIDE;
virtual void NoteNewRevision(); void NoteNewRevision() CM_OVERRIDE;
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
// URL of repository directory checked out in the working tree. // URL of repository directory checked out in the working tree.
std::string URL; std::string URL;
std::string LoadInfo(); std::string LoadInfo();
void LoadModifications(); void LoadModifications() CM_OVERRIDE;
void LoadRevisions(); void LoadRevisions() CM_OVERRIDE;
// Parsing helper classes. // Parsing helper classes.
class InfoParser; class InfoParser;

View File

@ -28,8 +28,8 @@
class cmCTestBatchTestHandler : public cmCTestMultiProcessHandler class cmCTestBatchTestHandler : public cmCTestMultiProcessHandler
{ {
public: public:
~cmCTestBatchTestHandler(); ~cmCTestBatchTestHandler() CM_OVERRIDE;
virtual void RunTests(); void RunTests() CM_OVERRIDE;
protected: protected:
void WriteBatchScript(); void WriteBatchScript();

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

@ -30,12 +30,12 @@ public:
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
//! Set all the build and test arguments //! Set all the build and test arguments
virtual int ProcessCommandLineArguments( int ProcessCommandLineArguments(const std::string& currentArg, size_t& idx,
const std::string& currentArg, size_t& idx, const std::vector<std::string>& allArgs)
const std::vector<std::string>& allArgs); CM_OVERRIDE;
/* /*
* Get the output variable * Get the output variable
@ -44,7 +44,7 @@ public:
cmCTestBuildAndTestHandler(); cmCTestBuildAndTestHandler();
virtual void Initialize(); void Initialize() CM_OVERRIDE;
protected: protected:
///! Run CMake and build a test and then run it as a single test. ///! Run CMake and build a test and then run it as a single test.

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

@ -26,12 +26,12 @@ class cmCTestBuildCommand : public cmCTestHandlerCommand
{ {
public: public:
cmCTestBuildCommand(); cmCTestBuildCommand();
~cmCTestBuildCommand(); ~cmCTestBuildCommand() CM_OVERRIDE;
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestBuildCommand* ni = new cmCTestBuildCommand; cmCTestBuildCommand* ni = new cmCTestBuildCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -42,10 +42,10 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_build"; } std::string GetName() const CM_OVERRIDE { return "ctest_build"; }
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);
@ -65,7 +65,7 @@ protected:
ctb_LAST ctb_LAST
}; };
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
}; };
#endif #endif

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

@ -36,16 +36,16 @@ public:
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
cmCTestBuildHandler(); cmCTestBuildHandler();
void PopulateCustomVectors(cmMakefile* mf); void PopulateCustomVectors(cmMakefile* mf) CM_OVERRIDE;
/** /**
* Initialize handler * Initialize handler
*/ */
virtual void Initialize(); void Initialize() CM_OVERRIDE;
int GetTotalErrors() { return this->TotalErrors; } int GetTotalErrors() { return this->TotalErrors; }
int GetTotalWarnings() { return this->TotalWarnings; } int GetTotalWarnings() { return this->TotalWarnings; }

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

@ -24,12 +24,12 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestCVS(cmCTest* ctest, std::ostream& log); cmCTestCVS(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestCVS(); ~cmCTestCVS() CM_OVERRIDE;
private: private:
// Implement cmCTestVC internal API. // Implement cmCTestVC internal API.
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
virtual bool WriteXMLUpdates(cmXMLWriter& xml); bool WriteXMLUpdates(cmXMLWriter& xml) CM_OVERRIDE;
// Update status for files in each directory. // Update status for files in each directory.
class Directory : public std::map<std::string, PathStatus> class Directory : public std::map<std::string, PathStatus>

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

@ -27,7 +27,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestConfigureCommand* ni = new cmCTestConfigureCommand; cmCTestConfigureCommand* ni = new cmCTestConfigureCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -38,12 +38,12 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_configure"; } std::string GetName() const CM_OVERRIDE { return "ctest_configure"; }
cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand);
protected: protected:
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
enum enum
{ {

View File

@ -29,11 +29,11 @@ public:
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
cmCTestConfigureHandler(); cmCTestConfigureHandler();
void Initialize(); void Initialize() CM_OVERRIDE;
}; };
#endif #endif

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

@ -27,7 +27,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestCoverageCommand* ni = new cmCTestCoverageCommand; cmCTestCoverageCommand* ni = new cmCTestCoverageCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -38,15 +38,15 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_coverage"; } std::string GetName() const CM_OVERRIDE { return "ctest_coverage"; }
cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand);
protected: protected:
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
virtual bool CheckArgumentKeyword(std::string const& arg); bool CheckArgumentKeyword(std::string const& arg) CM_OVERRIDE;
virtual bool CheckArgumentValue(std::string const& arg); bool CheckArgumentValue(std::string const& arg) CM_OVERRIDE;
enum enum
{ {

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

@ -45,16 +45,16 @@ public:
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
cmCTestCoverageHandler(); cmCTestCoverageHandler();
virtual void Initialize(); void Initialize() CM_OVERRIDE;
/** /**
* This method is called when reading CTest custom file * This method is called when reading CTest custom file
*/ */
void PopulateCustomVectors(cmMakefile* mf); void PopulateCustomVectors(cmMakefile* mf) CM_OVERRIDE;
/** Report coverage only for sources with these labels. */ /** Report coverage only for sources with these labels. */
void SetLabelFilter(std::set<std::string> const& labels); void SetLabelFilter(std::set<std::string> const& labels);

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

@ -28,7 +28,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestEmptyBinaryDirectoryCommand* ni = cmCTestEmptyBinaryDirectoryCommand* ni =
new cmCTestEmptyBinaryDirectoryCommand; new cmCTestEmptyBinaryDirectoryCommand;
@ -41,13 +41,13 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const std::string GetName() const CM_OVERRIDE
{ {
return "ctest_empty_binary_directory"; return "ctest_empty_binary_directory";
} }

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

@ -24,15 +24,15 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestGIT(cmCTest* ctest, std::ostream& log); cmCTestGIT(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestGIT(); ~cmCTestGIT() CM_OVERRIDE;
private: private:
unsigned int CurrentGitVersion; unsigned int CurrentGitVersion;
unsigned int GetGitVersion(); unsigned int GetGitVersion();
std::string GetWorkingRevision(); std::string GetWorkingRevision();
virtual void NoteOldRevision(); void NoteOldRevision() CM_OVERRIDE;
virtual void NoteNewRevision(); void NoteNewRevision() CM_OVERRIDE;
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
std::string FindGitDir(); std::string FindGitDir();
std::string FindTopDir(); std::string FindTopDir();
@ -41,8 +41,8 @@ private:
bool UpdateByCustom(std::string const& custom); bool UpdateByCustom(std::string const& custom);
bool UpdateInternal(); bool UpdateInternal();
void LoadRevisions(); void LoadRevisions() CM_OVERRIDE;
void LoadModifications(); void LoadModifications() CM_OVERRIDE;
// "public" needed by older Sun compilers // "public" needed by older Sun compilers
public: public:

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

@ -74,7 +74,7 @@ public:
* Construct handler * Construct handler
*/ */
cmCTestGenericHandler(); cmCTestGenericHandler();
virtual ~cmCTestGenericHandler(); ~cmCTestGenericHandler() CM_OVERRIDE;
typedef std::map<std::string, std::string> t_StringToString; typedef std::map<std::string, std::string> t_StringToString;

View File

@ -26,11 +26,11 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestGlobalVC(cmCTest* ctest, std::ostream& log); cmCTestGlobalVC(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestGlobalVC(); ~cmCTestGlobalVC() CM_OVERRIDE;
protected: protected:
// Implement cmCTestVC internal API. // Implement cmCTestVC internal API.
virtual bool WriteXMLUpdates(cmXMLWriter& xml); bool WriteXMLUpdates(cmXMLWriter& xml) CM_OVERRIDE;
/** Represent a vcs-reported action for one path in a revision. */ /** Represent a vcs-reported action for one path in a revision. */
struct Change struct Change

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> ");
@ -171,7 +171,7 @@ public:
{ {
this->InitializeParser(); this->InitializeParser();
} }
~LogParser() { this->CleanupParser(); } ~LogParser() CM_OVERRIDE { this->CleanupParser(); }
private: private:
cmCTestHG* HG; cmCTestHG* HG;
@ -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

@ -24,16 +24,16 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestHG(cmCTest* ctest, std::ostream& log); cmCTestHG(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestHG(); ~cmCTestHG() CM_OVERRIDE;
private: private:
std::string GetWorkingRevision(); std::string GetWorkingRevision();
virtual void NoteOldRevision(); void NoteOldRevision() CM_OVERRIDE;
virtual void NoteNewRevision(); void NoteNewRevision() CM_OVERRIDE;
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
void LoadRevisions(); void LoadRevisions() CM_OVERRIDE;
void LoadModifications(); void LoadModifications() CM_OVERRIDE;
// Parsing helper classes. // Parsing helper classes.
class IdentifyParser; class IdentifyParser;

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,8 +30,8 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
cmTypeMacro(cmCTestHandlerCommand, cmCTestCommand); cmTypeMacro(cmCTestHandlerCommand, cmCTestCommand);

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

@ -29,7 +29,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestMemCheckCommand* ni = new cmCTestMemCheckCommand; cmCTestMemCheckCommand* ni = new cmCTestMemCheckCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -40,12 +40,12 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_memcheck"; } std::string GetName() const CM_OVERRIDE { return "ctest_memcheck"; }
cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand); cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand);
protected: protected:
cmCTestGenericHandler* InitializeActualHandler(); cmCTestGenericHandler* InitializeActualHandler() CM_OVERRIDE;
}; };
#endif #endif

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)
{ {
@ -241,9 +241,9 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
// define the standard set of errors // define the standard set of errors
//---------------------------------------------------------------------- //----------------------------------------------------------------------
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

@ -33,16 +33,17 @@ class cmCTestMemCheckHandler : public cmCTestTestHandler
public: public:
cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler); cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler);
void PopulateCustomVectors(cmMakefile* mf); void PopulateCustomVectors(cmMakefile* mf) CM_OVERRIDE;
cmCTestMemCheckHandler(); cmCTestMemCheckHandler();
void Initialize(); void Initialize() CM_OVERRIDE;
protected: protected:
virtual int PreProcessHandler(); int PreProcessHandler() CM_OVERRIDE;
virtual int PostProcessHandler(); int PostProcessHandler() CM_OVERRIDE;
virtual void GenerateTestCommand(std::vector<std::string>& args, int test); void GenerateTestCommand(std::vector<std::string>& args,
int test) CM_OVERRIDE;
private: private:
enum enum
@ -125,7 +126,7 @@ private:
/** /**
* Generate the Dart compatible output * Generate the Dart compatible output
*/ */
void GenerateDartOutput(cmXMLWriter& xml); void GenerateDartOutput(cmXMLWriter& xml) CM_OVERRIDE;
std::vector<std::string> CustomPreMemCheck; std::vector<std::string> CustomPreMemCheck;
std::vector<std::string> CustomPostMemCheck; std::vector<std::string> CustomPostMemCheck;

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

@ -27,7 +27,7 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestP4(cmCTest* ctest, std::ostream& log); cmCTestP4(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestP4(); ~cmCTestP4() CM_OVERRIDE;
private: private:
std::vector<std::string> ChangeLists; std::vector<std::string> ChangeLists;
@ -54,13 +54,13 @@ private:
void SetP4Options(std::vector<char const*>& options); void SetP4Options(std::vector<char const*>& options);
std::string GetWorkingRevision(); std::string GetWorkingRevision();
virtual void NoteOldRevision(); void NoteOldRevision() CM_OVERRIDE;
virtual void NoteNewRevision(); void NoteNewRevision() CM_OVERRIDE;
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
bool UpdateCustom(const std::string& custom); bool UpdateCustom(const std::string& custom);
void LoadRevisions(); void LoadRevisions() CM_OVERRIDE;
void LoadModifications(); void LoadModifications() CM_OVERRIDE;
// Parsing helper classes. // Parsing helper classes.
class IdentifyParser; class IdentifyParser;

View File

@ -28,7 +28,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand; cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -39,13 +39,13 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_read_custom_files"; } std::string GetName() const CM_OVERRIDE { return "ctest_read_custom_files"; }
cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand); cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand);
}; };

View File

@ -28,7 +28,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand; cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -40,13 +40,13 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_run_script"; } std::string GetName() const CM_OVERRIDE { return "ctest_run_script"; }
cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand); cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand);
}; };

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);
@ -311,7 +311,7 @@ public:
{ {
this->InitializeParser(); this->InitializeParser();
} }
~LogParser() { this->CleanupParser(); } ~LogParser() CM_OVERRIDE { this->CleanupParser(); }
private: private:
cmCTestSVN* SVN; cmCTestSVN* SVN;
cmCTestSVN::SVNInfo& SVNRepo; cmCTestSVN::SVNInfo& SVNRepo;

View File

@ -26,14 +26,14 @@ public:
/** Construct with a CTest instance and update log stream. */ /** Construct with a CTest instance and update log stream. */
cmCTestSVN(cmCTest* ctest, std::ostream& log); cmCTestSVN(cmCTest* ctest, std::ostream& log);
virtual ~cmCTestSVN(); ~cmCTestSVN() CM_OVERRIDE;
private: private:
// Implement cmCTestVC internal API. // Implement cmCTestVC internal API.
virtual void CleanupImpl(); void CleanupImpl() CM_OVERRIDE;
virtual void NoteOldRevision(); void NoteOldRevision() CM_OVERRIDE;
virtual void NoteNewRevision(); void NoteNewRevision() CM_OVERRIDE;
virtual bool UpdateImpl(); bool UpdateImpl() CM_OVERRIDE;
bool RunSVNCommand(std::vector<char const*> const& parameters, bool RunSVNCommand(std::vector<char const*> const& parameters,
OutputParser* out, OutputParser* err); OutputParser* out, OutputParser* err);
@ -78,8 +78,8 @@ private:
std::string LoadInfo(SVNInfo& svninfo); std::string LoadInfo(SVNInfo& svninfo);
void LoadExternals(); void LoadExternals();
void LoadModifications(); void LoadModifications() CM_OVERRIDE;
void LoadRevisions(); void LoadRevisions() CM_OVERRIDE;
void LoadRevisions(SVNInfo& svninfo); void LoadRevisions(SVNInfo& svninfo);
void GuessBase(SVNInfo& svninfo, std::vector<Change> const& changes); void GuessBase(SVNInfo& svninfo, std::vector<Change> const& changes);
@ -87,7 +87,7 @@ private:
void DoRevisionSVN(Revision const& revision, void DoRevisionSVN(Revision const& revision,
std::vector<Change> const& changes); std::vector<Change> const& changes);
void WriteXMLGlobal(cmXMLWriter& xml); void WriteXMLGlobal(cmXMLWriter& xml) CM_OVERRIDE;
// Parsing helper classes. // Parsing helper classes.
class InfoParser; class InfoParser;

View File

@ -59,7 +59,7 @@ class cmCTestScriptFunctionBlocker : public cmFunctionBlocker
{ {
public: public:
cmCTestScriptFunctionBlocker() {} cmCTestScriptFunctionBlocker() {}
virtual ~cmCTestScriptFunctionBlocker() {} ~cmCTestScriptFunctionBlocker() CM_OVERRIDE {}
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf, bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) CM_OVERRIDE; cmExecutionStatus&) CM_OVERRIDE;
// virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf); // virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
@ -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

@ -71,7 +71,7 @@ public:
/** /**
* Run a dashboard using a specified confiuration script * Run a dashboard using a specified confiuration script
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
/* /*
* Run a script * Run a script
@ -104,9 +104,9 @@ public:
double GetRemainingTimeAllowed(); double GetRemainingTimeAllowed();
cmCTestScriptHandler(); cmCTestScriptHandler();
~cmCTestScriptHandler(); ~cmCTestScriptHandler() CM_OVERRIDE;
void Initialize(); void Initialize() CM_OVERRIDE;
void CreateCMake(); void CreateCMake();
cmake* GetCMake() { return this->CMake; } cmake* GetCMake() { return this->CMake; }

View File

@ -28,7 +28,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestSleepCommand* ni = new cmCTestSleepCommand; cmCTestSleepCommand* ni = new cmCTestSleepCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -40,13 +40,13 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_sleep"; } std::string GetName() const CM_OVERRIDE { return "ctest_sleep"; }
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand); cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);
}; };

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

@ -27,7 +27,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestStartCommand* ni = new cmCTestStartCommand; cmCTestStartCommand* ni = new cmCTestStartCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -41,8 +41,8 @@ public:
* This is called when the command is first encountered in * This is called when the command is first encountered in
* the CMakeLists.txt file. * the CMakeLists.txt file.
*/ */
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* Will this invocation of ctest_start create a new TAG file? * Will this invocation of ctest_start create a new TAG file?
@ -57,7 +57,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_start"; } std::string GetName() const CM_OVERRIDE { return "ctest_start"; }
cmTypeMacro(cmCTestStartCommand, cmCTestCommand); cmTypeMacro(cmCTestStartCommand, cmCTestCommand);

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

@ -38,7 +38,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestSubmitCommand* ni = new cmCTestSubmitCommand; cmCTestSubmitCommand* ni = new cmCTestSubmitCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -46,21 +46,21 @@ public:
return ni; return ni;
} }
virtual bool InitialPass(std::vector<std::string> const& args, bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status); cmExecutionStatus& status) CM_OVERRIDE;
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_submit"; } std::string GetName() const CM_OVERRIDE { return "ctest_submit"; }
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
protected: protected:
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
virtual bool CheckArgumentKeyword(std::string const& arg); bool CheckArgumentKeyword(std::string const& arg) CM_OVERRIDE;
virtual bool CheckArgumentValue(std::string const& arg); bool CheckArgumentValue(std::string const& arg) CM_OVERRIDE;
enum enum
{ {

View File

@ -41,7 +41,7 @@ class cmCTestSubmitHandler::ResponseParser : public cmXMLParser
{ {
public: public:
ResponseParser() { this->Status = STATUS_OK; } ResponseParser() { this->Status = STATUS_OK; }
~ResponseParser() {} ~ResponseParser() CM_OVERRIDE {}
public: public:
enum StatusType enum StatusType
@ -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,14 +26,14 @@ public:
cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler); cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler);
cmCTestSubmitHandler(); cmCTestSubmitHandler();
~cmCTestSubmitHandler() { this->LogFile = 0; } ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = CM_NULLPTR; }
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
void Initialize(); void Initialize() CM_OVERRIDE;
/** Specify a set of parts (by name) to submit. */ /** Specify a set of parts (by name) to submit. */
void SelectParts(std::set<cmCTest::Part> const& parts); void SelectParts(std::set<cmCTest::Part> const& parts);

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

@ -27,7 +27,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestTestCommand* ni = new cmCTestTestCommand; cmCTestTestCommand* ni = new cmCTestTestCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -38,13 +38,13 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_test"; } std::string GetName() const CM_OVERRIDE { return "ctest_test"; }
cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand);
protected: protected:
virtual cmCTestGenericHandler* InitializeActualHandler(); virtual cmCTestGenericHandler* InitializeActualHandler();
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
enum enum
{ {

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

@ -36,7 +36,7 @@ public:
/** /**
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
/** /**
* When both -R and -I are used should te resulting test list be the * When both -R and -I are used should te resulting test list be the
@ -54,7 +54,7 @@ public:
/** /**
* This method is called when reading CTest custom file * This method is called when reading CTest custom file
*/ */
void PopulateCustomVectors(cmMakefile* mf); void PopulateCustomVectors(cmMakefile* mf) CM_OVERRIDE;
///! Control the use of the regular expresisons, call these methods to turn ///! Control the use of the regular expresisons, call these methods to turn
/// them on /// them on
@ -90,7 +90,7 @@ public:
*/ */
bool SetTestsProperties(const std::vector<std::string>& args); bool SetTestsProperties(const std::vector<std::string>& args);
void Initialize(); void Initialize() CM_OVERRIDE;
// NOTE: This struct is Saved/Restored // NOTE: This struct is Saved/Restored
// in cmCTestTestHandler, if you add to this class // in cmCTestTestHandler, if you add to this class

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

@ -27,7 +27,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestUpdateCommand* ni = new cmCTestUpdateCommand; cmCTestUpdateCommand* ni = new cmCTestUpdateCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -38,12 +38,12 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_update"; } std::string GetName() const CM_OVERRIDE { return "ctest_update"; }
cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand);
protected: protected:
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
}; };
#endif #endif

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

@ -29,7 +29,7 @@ public:
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
cmCTestUpdateHandler(); cmCTestUpdateHandler();
@ -48,7 +48,7 @@ public:
/** /**
* Initialize handler * Initialize handler
*/ */
virtual void Initialize(); void Initialize() CM_OVERRIDE;
private: private:
// Some structures needed for update // Some structures needed for update

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

@ -30,7 +30,7 @@ public:
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */
virtual cmCommand* Clone() cmCommand* Clone() CM_OVERRIDE
{ {
cmCTestUploadCommand* ni = new cmCTestUploadCommand; cmCTestUploadCommand* ni = new cmCTestUploadCommand;
ni->CTest = this->CTest; ni->CTest = this->CTest;
@ -41,15 +41,15 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual std::string GetName() const { return "ctest_upload"; } std::string GetName() const CM_OVERRIDE { return "ctest_upload"; }
cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand);
protected: protected:
cmCTestGenericHandler* InitializeHandler(); cmCTestGenericHandler* InitializeHandler() CM_OVERRIDE;
virtual bool CheckArgumentKeyword(std::string const& arg); bool CheckArgumentKeyword(std::string const& arg) CM_OVERRIDE;
virtual bool CheckArgumentValue(std::string const& arg); bool CheckArgumentValue(std::string const& arg) CM_OVERRIDE;
enum enum
{ {

View File

@ -26,14 +26,14 @@ public:
cmTypeMacro(cmCTestUploadHandler, cmCTestGenericHandler); cmTypeMacro(cmCTestUploadHandler, cmCTestGenericHandler);
cmCTestUploadHandler(); cmCTestUploadHandler();
~cmCTestUploadHandler() {} ~cmCTestUploadHandler() CM_OVERRIDE {}
/* /*
* The main entry point for this class * The main entry point for this class
*/ */
int ProcessHandler(); int ProcessHandler() CM_OVERRIDE;
void Initialize(); void Initialize() CM_OVERRIDE;
/** Specify a set of files to submit. */ /** Specify a set of files to submit. */
void SetFiles(cmCTest::SetOfStrings const& files); void SetFiles(cmCTest::SetOfStrings const& 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

@ -28,7 +28,7 @@ public:
protected: protected:
// implement virtual from parent // implement virtual from parent
bool LoadCoverageData(const char* dir); bool LoadCoverageData(const char* dir) CM_OVERRIDE;
// remove files with no coverage // remove files with no coverage
void RemoveUnCoveredFiles(); void RemoveUnCoveredFiles();
// Read a single mcov file // Read a single mcov file

View File

@ -20,7 +20,7 @@ public:
this->CurFileName = ""; this->CurFileName = "";
} }
virtual ~XMLParser() {} ~XMLParser() CM_OVERRIDE {}
protected: protected:
void EndElement(const std::string& name) CM_OVERRIDE void EndElement(const std::string& name) CM_OVERRIDE

View File

@ -28,7 +28,7 @@ public:
protected: protected:
// implement virtual from parent // implement virtual from parent
bool LoadCoverageData(const char* dir); bool LoadCoverageData(const char* dir) CM_OVERRIDE;
// Read a single mcov file // Read a single mcov file
bool ReadMCovFile(const char* f); bool ReadMCovFile(const char* f);
// find out what line in a mumps file (filepath) the given entry point // find out what line in a mumps file (filepath) the given entry point

View File

@ -20,7 +20,7 @@ public:
this->PackageName = ""; this->PackageName = "";
} }
virtual ~XMLParser() {} ~XMLParser() CM_OVERRIDE {}
protected: protected:
void EndElement(const std::string&) CM_OVERRIDE {} void EndElement(const std::string&) CM_OVERRIDE {}

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

@ -32,6 +32,7 @@ function(cm_check_cxx_feature name)
endfunction() endfunction()
if(CMAKE_CXX_STANDARD) if(CMAKE_CXX_STANDARD)
cm_check_cxx_feature(nullptr)
cm_check_cxx_feature(override) cm_check_cxx_feature(override)
cm_check_cxx_feature(unordered_map) cm_check_cxx_feature(unordered_map)
cm_check_cxx_feature(unordered_set) cm_check_cxx_feature(unordered_set)

View File

@ -0,0 +1,14 @@
int test(int)
{
return -1;
}
int test(int*)
{
return 0;
}
int main()
{
return test(nullptr);
}

View File

@ -1,10 +1,12 @@
struct Foo struct Foo
{ {
virtual ~Foo() {}
virtual int test() const = 0; virtual int test() const = 0;
}; };
struct Bar : Foo struct Bar : Foo
{ {
~Bar() override {}
int test() const override { return 0; } int test() const override { return 0; }
}; };

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