summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-09-18 21:57:50 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-19 15:44:21 (GMT)
commita5279ae553caba7ab875ee06d2ce2d079907145d (patch)
tree06b58455c6c0e385fb5986b5aed447b7db173d90 /Source/CPack
parenta1cdf537ffb33db3a368dc4c2c3662fa27568400 (diff)
downloadCMake-a5279ae553caba7ab875ee06d2ce2d079907145d.zip
CMake-a5279ae553caba7ab875ee06d2ce2d079907145d.tar.gz
CMake-a5279ae553caba7ab875ee06d2ce2d079907145d.tar.bz2
Use C++11 nullptr (cont.)
Fix remaining occurrences of the issue addressed in commit 5962db4389 (Use C++11 nullptr, 2017-08-22) that are only showing up on macOS. Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx8
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx6
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx10
7 files changed, 23 insertions, 23 deletions
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index b48bf12..d3de02b 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -34,7 +34,7 @@ int main(int argc, char* argv[])
}
fileName = CFSTR("RuntimeScript");
if (!(scriptFileURL =
- CFBundleCopyResourceURL(appBundle, fileName, NULL, NULL))) {
+ CFBundleCopyResourceURL(appBundle, fileName, nullptr, nullptr))) {
DebugError("CFBundleCopyResourceURL failed");
return 1;
}
@@ -71,7 +71,7 @@ int main(int argc, char* argv[])
for (cc = 1; cc < argc; ++cc) {
args.push_back(argv[cc]);
}
- args.push_back(0);
+ args.push_back(nullptr);
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*args.begin());
@@ -83,7 +83,7 @@ int main(int argc, char* argv[])
std::vector<char> tempOutput;
char* data;
int length;
- while (cmsysProcess_WaitForData(cp, &data, &length, 0)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
// Translate NULL characters in the output into valid text.
for (int i = 0; i < length; ++i) {
if (data[i] == '\0') {
@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
std::cout.write(data, length);
}
- cmsysProcess_WaitForExit(cp, 0);
+ cmsysProcess_WaitForExit(cp, nullptr);
bool result = true;
if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) {
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index d538901..bbf2a50 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -19,7 +19,7 @@ cmCPackBundleGenerator::~cmCPackBundleGenerator()
int cmCPackBundleGenerator::InitializeInternal()
{
const char* name = this->GetOption("CPACK_BUNDLE_NAME");
- if (0 == name) {
+ if (nullptr == name) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set to use the Bundle generator."
<< std::endl);
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 8758d32..88204c8 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -242,9 +242,9 @@ bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command,
{
int exit_code = 1;
- bool result =
- cmSystemTools::RunSingleCommand(command.str().c_str(), output, output,
- &exit_code, 0, this->GeneratorVerbose, 0);
+ bool result = cmSystemTools::RunSingleCommand(command.str().c_str(), output,
+ output, &exit_code, nullptr,
+ this->GeneratorVerbose, 0);
if (!result || exit_code) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error executing: " << command.str()
@@ -553,10 +553,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
header_data.push_back(languages.size());
for (size_t i = 0; i < languages.size(); ++i) {
CFStringRef language_cfstring = CFStringCreateWithCString(
- NULL, languages[i].c_str(), kCFStringEncodingUTF8);
+ nullptr, languages[i].c_str(), kCFStringEncodingUTF8);
CFStringRef iso_language =
CFLocaleCreateCanonicalLanguageIdentifierFromString(
- NULL, language_cfstring);
+ nullptr, language_cfstring);
if (!iso_language) {
cmCPackLogger(cmCPackLog::LOG_ERROR, languages[i]
<< " is not a recognized language" << std::endl);
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 8ea88a8..e75061e 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -154,9 +154,9 @@ int cmCPackOSXX11Generator::PackageFiles()
int numTries = 10;
bool res = false;
while (numTries > 0) {
- res =
- cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, &output,
- &retVal, 0, this->GeneratorVerbose, 0);
+ res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
+ &output, &retVal, nullptr,
+ this->GeneratorVerbose, 0);
if (res && !retVal) {
numTries = -1;
break;
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 70ae267..321b6a7 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -70,7 +70,7 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
std::map<std::string, cmCPackComponentGroup>::iterator groupIt;
for (groupIt = this->ComponentGroups.begin();
groupIt != this->ComponentGroups.end(); ++groupIt) {
- if (groupIt->second.ParentGroup == 0) {
+ if (groupIt->second.ParentGroup == nullptr) {
CreateChoiceOutline(groupIt->second, xout);
}
}
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 8db7cfb..6624b16 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -294,9 +294,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
int numTries = 10;
bool res = false;
while (numTries > 0) {
- res =
- cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, &output,
- &retVal, 0, this->GeneratorVerbose, 0);
+ res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
+ &output, &retVal, nullptr,
+ this->GeneratorVerbose, 0);
if (res && !retVal) {
numTries = -1;
break;
@@ -466,7 +466,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
std::string output;
int retVal = 1;
bool res = cmSystemTools::RunSingleCommand(
- command, &output, &output, &retVal, 0, this->GeneratorVerbose, 0);
+ command, &output, &output, &retVal, nullptr, this->GeneratorVerbose, 0);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker"
<< std::endl);
if (!res || retVal) {
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index 1389eaa..ed4463c 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -54,7 +54,7 @@ int cmCPackProductBuildGenerator::PackageFiles()
} else {
if (!this->GenerateComponentPackage(basePackageDir,
this->GetOption("CPACK_PACKAGE_NAME"),
- toplevel, NULL)) {
+ toplevel, nullptr)) {
return 0;
}
}
@@ -145,9 +145,9 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command)
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl);
std::string output, error_output;
int retVal = 1;
- bool res =
- cmSystemTools::RunSingleCommand(command.c_str(), &output, &error_output,
- &retVal, 0, this->GeneratorVerbose, 0);
+ bool res = cmSystemTools::RunSingleCommand(command.c_str(), &output,
+ &error_output, &retVal, nullptr,
+ this->GeneratorVerbose, 0);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running command" << std::endl);
if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str());
@@ -174,7 +174,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building component package: "
<< packageFile << std::endl);
- const char* comp_name = component ? component->Name.c_str() : NULL;
+ const char* comp_name = component ? component->Name.c_str() : nullptr;
const char* preflight = this->GetComponentScript("PREFLIGHT", comp_name);
const char* postflight = this->GetComponentScript("POSTFLIGHT", comp_name);