diff options
Diffstat (limited to 'Source')
47 files changed, 237 insertions, 145 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 811f4f7..fb13b21 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 6) -set(CMake_VERSION_PATCH 20160903) +set(CMake_VERSION_PATCH 20160906) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 640e437..14436da 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -330,8 +330,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, if (!cpack_dmg_disable_applications_symlink) { std::ostringstream application_link; application_link << staging.str() << "/Applications"; - cmSystemTools::CreateSymlink("/Applications", - application_link.str().c_str()); + cmSystemTools::CreateSymlink("/Applications", application_link.str()); } // Optionally add a custom volume icon ... @@ -755,7 +754,7 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix( // the current COMPONENT belongs to. std::string groupVar = "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; - const char* _groupName = GetOption(groupVar.c_str()); + const char* _groupName = GetOption(groupVar); if (_groupName) { std::string groupName = _groupName; diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index c0d2553..c36439f 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -102,15 +102,14 @@ int cmCPackOSXX11Generator::PackageFiles() } std::string applicationsLinkName = diskImageDirectory + "/Applications"; - cmSystemTools::CreateSymlink("/Applications", applicationsLinkName.c_str()); + cmSystemTools::CreateSymlink("/Applications", applicationsLinkName); - if (!this->CopyResourcePlistFile("VolumeIcon.icns", - diskImageDirectory.c_str(), + if (!this->CopyResourcePlistFile("VolumeIcon.icns", diskImageDirectory, ".VolumeIcon.icns", true) || - !this->CopyResourcePlistFile("DS_Store", diskImageDirectory.c_str(), - ".DS_Store", true) || + !this->CopyResourcePlistFile("DS_Store", diskImageDirectory, ".DS_Store", + true) || !this->CopyResourcePlistFile("background.png", - diskImageBackgroundImageDir.c_str(), + diskImageBackgroundImageDir, "background.png", true) || !this->CopyResourcePlistFile("RuntimeScript", dir) || !this->CopyResourcePlistFile("OSXX11.Info.plist", contDir, diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 19b587a..e5b96e3 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -225,8 +225,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component, dirName += '/'; dirName += component.Name; dirName += this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); - unsigned long installedSize = - component.GetInstalledSizeInKbytes(dirName.c_str()); + unsigned long installedSize = component.GetInstalledSizeInKbytes(dirName); xout.StartElement("pkg-ref"); xout.Attribute("id", packageId); @@ -283,7 +282,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name, { std::string uname = cmSystemTools::UpperCase(name); std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname; - const char* inFileName = this->GetOption(cpackVar.c_str()); + const char* inFileName = this->GetOption(cpackVar); if (!inFileName) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str() @@ -314,7 +313,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name, // Set this so that distribution.dist gets the right name (without // the path). - this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(), + this->SetOption("CPACK_RESOURCE_FILE_" + uname + "_NOPATH", (name + ext).c_str()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, @@ -358,7 +357,7 @@ int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir, std::string dst = resdir; dst += "/"; dst += name; - cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str()); + cmSystemTools::CopyFileAlways(script, dst); cmSystemTools::SetPermissions(dst.c_str(), 0777); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "copy script : " << script << "\ninto " << dst << std::endl); diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index ce329ca..0704e9f 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -118,13 +118,13 @@ int cmCPackPackageMakerGenerator::PackageFiles() // then copy them into the resource directory and make // them executable if (preflight) { - this->CopyInstallScript(resDir.c_str(), preflight, "preflight"); + this->CopyInstallScript(resDir, preflight, "preflight"); } if (postflight) { - this->CopyInstallScript(resDir.c_str(), postflight, "postflight"); + this->CopyInstallScript(resDir, postflight, "postflight"); } if (postupgrade) { - this->CopyInstallScript(resDir.c_str(), postupgrade, "postupgrade"); + this->CopyInstallScript(resDir, postupgrade, "postupgrade"); } } else if (postflight) { // create a postflight component to house the script @@ -160,7 +160,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() // copy postflight script into resource directory of .pkg std::string resourceDir = packageFile + "/Contents/Resources"; - this->CopyInstallScript(resourceDir.c_str(), postflight, "postflight"); + this->CopyInstallScript(resourceDir, postflight, "postflight"); } if (!this->Components.empty()) { @@ -254,9 +254,9 @@ int cmCPackPackageMakerGenerator::PackageFiles() this->SetOption("CPACK_MODULE_VERSION_SUFFIX", ""); // Copy or create all of the resource files we need. - if (!this->CopyCreateResourceFile("License", resDir.c_str()) || - !this->CopyCreateResourceFile("ReadMe", resDir.c_str()) || - !this->CopyCreateResourceFile("Welcome", resDir.c_str()) || + if (!this->CopyCreateResourceFile("License", resDir) || + !this->CopyCreateResourceFile("ReadMe", resDir) || + !this->CopyCreateResourceFile("Welcome", resDir) || !this->CopyResourcePlistFile("Info.plist") || !this->CopyResourcePlistFile("Description.plist")) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" @@ -372,7 +372,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() } // Get path to the real PackageMaker, not a symlink: - pkgPath = cmSystemTools::GetRealPath(pkgPath.c_str()); + pkgPath = cmSystemTools::GetRealPath(pkgPath); // Up from there to find the version.plist file in the "Contents" dir: std::string contents_dir; contents_dir = cmSystemTools::GetFilenamePath(pkgPath); diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index c2a13d0..d867046 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -73,9 +73,9 @@ int cmCPackProductBuildGenerator::PackageFiles() // Copy or create all of the resource files we need. std::string resDir = packageDirFileName + "/Contents"; - if (!this->CopyCreateResourceFile("License", resDir.c_str()) || - !this->CopyCreateResourceFile("ReadMe", resDir.c_str()) || - !this->CopyCreateResourceFile("Welcome", resDir.c_str())) { + if (!this->CopyCreateResourceFile("License", resDir) || + !this->CopyCreateResourceFile("ReadMe", resDir) || + !this->CopyCreateResourceFile("Welcome", resDir)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" << std::endl); return 0; @@ -185,10 +185,10 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( // then copy them into the script directory and make // them executable if (preflight) { - this->CopyInstallScript(scriptDir.c_str(), preflight, "preinstall"); + this->CopyInstallScript(scriptDir, preflight, "preinstall"); } if (postflight) { - this->CopyInstallScript(scriptDir.c_str(), postflight, "postinstall"); + this->CopyInstallScript(scriptDir, postflight, "postinstall"); } // The command that will be used to run ProductBuild diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 80bb55d..2e062bc 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,19 +9,22 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmCursesStandardIncludes.h" - -#include "../cmDocumentation.h" -#include "../cmSystemTools.h" -#include "../cmake.h" - -#include <signal.h> -#include <sys/ioctl.h> +#include <cmConfigure.h> +#include "cmCursesForm.h" #include "cmCursesMainForm.h" -#include <cmsys/Encoding.hxx> +#include "cmCursesStandardIncludes.h" +#include "cmDocumentation.h" +#include "cmDocumentationEntry.h" +#include "cmSystemTools.h" +#include "cmake.h" -#include <form.h> +#include <cmsys/Encoding.hxx> +#include <iostream> +#include <signal.h> +#include <string.h> +#include <string> +#include <vector> static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " ccmake - Curses Interface for CMake." }, diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index 99f7dcc..de95bae 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -11,7 +11,10 @@ ============================================================================*/ #include "cmCursesBoolWidget.h" -#include "cmCursesMainForm.h" +#include "cmCursesWidget.h" +#include "cmState.h" + +#include <string> cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h index d2899ee..b9f1b16 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.h +++ b/Source/CursesDialog/cmCursesBoolWidget.h @@ -12,6 +12,9 @@ #ifndef cmCursesBoolWidget_h #define cmCursesBoolWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" class cmCursesMainForm; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 462cb6e..d115c77 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -11,18 +11,20 @@ ============================================================================*/ #include "cmCursesCacheEntryComposite.h" -#include "../cmState.h" -#include "../cmSystemTools.h" -#include "../cmake.h" #include "cmCursesBoolWidget.h" -#include "cmCursesDummyWidget.h" #include "cmCursesFilePathWidget.h" #include "cmCursesLabelWidget.h" #include "cmCursesOptionsWidget.h" #include "cmCursesPathWidget.h" #include "cmCursesStringWidget.h" +#include "cmCursesWidget.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmake.h" #include <assert.h> +#include <cmConfigure.h> +#include <vector> cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, int labelwidth, int entrywidth) diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index c9c8238..c717e1a 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,8 +12,12 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include "cmCursesLabelWidget.h" +#include <cmConfigure.h> // IWYU pragma: keep +#include <string> + +class cmCursesLabelWidget; +class cmCursesWidget; class cmake; class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index a960090..fe73e7e 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -11,6 +11,9 @@ ============================================================================*/ #include "cmCursesDummyWidget.h" +#include "cmCursesWidget.h" +#include "cmState.h" + cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h index e6ca91e..cf88e6e 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.h +++ b/Source/CursesDialog/cmCursesDummyWidget.h @@ -12,6 +12,9 @@ #ifndef cmCursesDummyWidget_h #define cmCursesDummyWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" class cmCursesMainForm; diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 28a74a9..654e0d4 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -11,6 +11,9 @@ ============================================================================*/ #include "cmCursesFilePathWidget.h" +#include "cmCursesPathWidget.h" +#include "cmState.h" + cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h index 72adc77..86c78ce 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.h +++ b/Source/CursesDialog/cmCursesFilePathWidget.h @@ -12,6 +12,8 @@ #ifndef cmCursesFilePathWidget_h #define cmCursesFilePathWidget_h +#include <cmConfigure.h> // IWYU pragma: keep + #include "cmCursesPathWidget.h" class cmCursesFilePathWidget : public cmCursesPathWidget diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx index b3320c9..699dabc 100644 --- a/Source/CursesDialog/cmCursesForm.cxx +++ b/Source/CursesDialog/cmCursesForm.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCursesForm.h" +#include <cmConfigure.h> + cmsys::ofstream cmCursesForm::DebugFile; bool cmCursesForm::Debug = false; diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h index c0192fc..bf97c66 100644 --- a/Source/CursesDialog/cmCursesForm.h +++ b/Source/CursesDialog/cmCursesForm.h @@ -12,6 +12,8 @@ #ifndef cmCursesForm_h #define cmCursesForm_h +#include <cmConfigure.h> // IWYU pragma: keep + #include "cmCursesStandardIncludes.h" #include <cmsys/FStream.hxx> diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx index 784738b..0ed9240 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.cxx +++ b/Source/CursesDialog/cmCursesLabelWidget.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCursesLabelWidget.h" +#include "cmCursesWidget.h" + cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, int left, int top, const std::string& name) : cmCursesWidget(width, height, left, top) diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h index ff645af..990078b 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.h +++ b/Source/CursesDialog/cmCursesLabelWidget.h @@ -12,8 +12,13 @@ #ifndef cmCursesLabelWidget_h #define cmCursesLabelWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" +#include <string> + class cmCursesMainForm; class cmCursesLabelWidget : public cmCursesWidget diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 47f98a2..75b136c 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -11,10 +11,13 @@ ============================================================================*/ #include "cmCursesLongMessageForm.h" -#include "../cmSystemTools.h" -#include "../cmVersion.h" -#include "../cmake.h" +#include "cmCursesForm.h" #include "cmCursesMainForm.h" +#include "cmCursesStandardIncludes.h" +#include "cmVersion.h" + +#include <stdio.h> +#include <string.h> inline int ctrl(int z) { diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index a12ed2f..f8e8544 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -12,11 +12,13 @@ #ifndef cmCursesLongMessageForm_h #define cmCursesLongMessageForm_h -#include "cmCursesStandardIncludes.h" +#include <cmConfigure.h> #include "cmCursesForm.h" +#include "cmCursesStandardIncludes.h" -class cmCursesCacheEntryComposite; +#include <string> +#include <vector> class cmCursesLongMessageForm : public cmCursesForm { diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1d036c4..d8d1a7d 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -11,19 +11,22 @@ ============================================================================*/ #include "cmCursesMainForm.h" -#include "../cmSystemTools.h" -#include "../cmVersion.h" -#include "../cmake.h" #include "cmAlgorithms.h" -#include "cmCursesBoolWidget.h" #include "cmCursesCacheEntryComposite.h" #include "cmCursesDummyWidget.h" -#include "cmCursesFilePathWidget.h" +#include "cmCursesForm.h" #include "cmCursesLabelWidget.h" #include "cmCursesLongMessageForm.h" -#include "cmCursesPathWidget.h" +#include "cmCursesStandardIncludes.h" #include "cmCursesStringWidget.h" +#include "cmCursesWidget.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmVersion.h" +#include "cmake.h" + +#include <stdio.h> +#include <string.h> inline int ctrl(int z) { @@ -742,8 +745,6 @@ void cmCursesMainForm::FixValue(cmState::CacheEntryType type, } } -#include <unistd.h> - void cmCursesMainForm::HandleInput() { int x = 0, y = 0; diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index d17ee33..1140945 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -12,13 +12,17 @@ #ifndef cmCursesMainForm_h #define cmCursesMainForm_h -#include "cmCursesStandardIncludes.h" +#include <cmConfigure.h> -#include "../cmState.h" #include "cmCursesForm.h" +#include "cmCursesStandardIncludes.h" +#include "cmState.h" + +#include <stddef.h> +#include <string> +#include <vector> class cmCursesCacheEntryComposite; -class cmCursesWidget; class cmake; /** \class cmCursesMainForm diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 9a88aef..f7a8cc6 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -11,7 +11,8 @@ ============================================================================*/ #include "cmCursesOptionsWidget.h" -#include "cmCursesMainForm.h" +#include "cmCursesWidget.h" +#include "cmState.h" #define ctrl(z) ((z)&037) diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h index f88b6bc..80dccad 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.h +++ b/Source/CursesDialog/cmCursesOptionsWidget.h @@ -12,8 +12,14 @@ #ifndef cmCursesOptionsWidget_h #define cmCursesOptionsWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" +#include <string> +#include <vector> + class cmCursesMainForm; class cmCursesOptionsWidget : public cmCursesWidget diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index 33fffd1..2ee64c7 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -12,8 +12,12 @@ #include "cmCursesPathWidget.h" #include "cmCursesMainForm.h" +#include "cmCursesStringWidget.h" +#include "cmState.h" #include "cmSystemTools.h" +#include <vector> + cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h index cd26df6..0ffce04 100644 --- a/Source/CursesDialog/cmCursesPathWidget.h +++ b/Source/CursesDialog/cmCursesPathWidget.h @@ -12,8 +12,15 @@ #ifndef cmCursesPathWidget_h #define cmCursesPathWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesStringWidget.h" +#include <string> + +class cmCursesMainForm; + class cmCursesPathWidget : public cmCursesStringWidget { public: diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 0953978..4929958 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -14,8 +14,6 @@ #include <cmConfigure.h> -#include "../cmStandardIncludes.h" - #if defined(__sun__) && defined(__GNUC__) #define _MSE_INT_H #endif diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index db98a00..726a128 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -11,7 +11,14 @@ ============================================================================*/ #include "cmCursesStringWidget.h" +#include "cmCursesForm.h" #include "cmCursesMainForm.h" +#include "cmCursesStandardIncludes.h" +#include "cmCursesWidget.h" +#include "cmState.h" + +#include <stdio.h> +#include <string.h> inline int ctrl(int z) { diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h index c8ca482..2bcf7e6 100644 --- a/Source/CursesDialog/cmCursesStringWidget.h +++ b/Source/CursesDialog/cmCursesStringWidget.h @@ -12,8 +12,13 @@ #ifndef cmCursesStringWidget_h #define cmCursesStringWidget_h +#include <cmConfigure.h> + +#include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" +#include <string> + class cmCursesMainForm; /** \class cmCursesStringWidget diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx index 49f2795..ed76e7c 100644 --- a/Source/CursesDialog/cmCursesWidget.cxx +++ b/Source/CursesDialog/cmCursesWidget.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCursesWidget.h" +#include <cmConfigure.h> + cmCursesWidget::cmCursesWidget(int width, int height, int left, int top) { this->Field = new_field(height, width, top, left, 0, 0); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 2ac5bb8..3f438af 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,9 +12,12 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h +#include <cmConfigure.h> // IWYU pragma: keep + #include "cmCursesStandardIncludes.h" +#include "cmState.h" -#include "../cmState.h" +#include <string> class cmCursesMainForm; diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx index dc7a4b0..a94c54b 100644 --- a/Source/QtDialog/AddCacheEntry.cxx +++ b/Source/QtDialog/AddCacheEntry.cxx @@ -64,7 +64,8 @@ QVariant AddCacheEntry::value() const QWidget* w = this->StackedWidget->currentWidget(); if (qobject_cast<QLineEdit*>(w)) { return static_cast<QLineEdit*>(w)->text(); - } else if (qobject_cast<QCheckBox*>(w)) { + } + if (qobject_cast<QCheckBox*>(w)) { return static_cast<QCheckBox*>(w)->isChecked(); } return QVariant(); diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 5a8a5be..4de4bef 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -29,18 +29,19 @@ #include "cmSystemTools.h" // IWYU pragma: keep -static const char* cmDocumentationName[][2] = { { 0, +static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " cmake-gui - CMake GUI." }, - { 0, 0 } }; + { CM_NULLPTR, CM_NULLPTR } }; static const char* cmDocumentationUsage[][2] = { - { 0, " cmake-gui [options]\n" - " cmake-gui [options] <path-to-source>\n" - " cmake-gui [options] <path-to-existing-build>" }, - { 0, 0 } + { CM_NULLPTR, " cmake-gui [options]\n" + " cmake-gui [options] <path-to-source>\n" + " cmake-gui [options] <path-to-existing-build>" }, + { CM_NULLPTR, CM_NULLPTR } }; -static const char* cmDocumentationOptions[][2] = { { 0, 0 } }; +static const char* cmDocumentationOptions[] + [2] = { { CM_NULLPTR, CM_NULLPTR } }; #if defined(Q_OS_MAC) static int cmOSXInstall(std::string dir); diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index fda3e58..5b84597 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -41,7 +41,7 @@ QCMakeThread::QCMakeThread(QObject* p) : QThread(p) - , CMakeInstance(NULL) + , CMakeInstance(CM_NULLPTR) { } @@ -57,7 +57,7 @@ void QCMakeThread::run() emit this->cmakeInitialized(); this->exec(); delete this->CMakeInstance; - this->CMakeInstance = NULL; + this->CMakeInstance = CM_NULLPTR; } CMakeSetupDialog::CMakeSetupDialog() diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h index bdb1962..276e2a5 100644 --- a/Source/QtDialog/Compilers.h +++ b/Source/QtDialog/Compilers.h @@ -3,6 +3,8 @@ #ifndef COMPILERS_HPP #define COMPILERS_HPP +#include <cmConfigure.h> + #include <QWidget> #include <ui_Compilers.h> @@ -11,7 +13,7 @@ class Compilers : public QWidget, public Ui::Compilers { Q_OBJECT public: - Compilers(QWidget* p = NULL) + Compilers(QWidget* p = CM_NULLPTR) : QWidget(p) { this->setupUi(this); diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index ca5e3b5..c34751a 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -129,8 +129,9 @@ bool StartCompilerSetup::crossCompilerSetup() const void StartCompilerSetup::onSelectionChanged(bool on) { - if (on) + if (on) { selectionChanged(); + } } void StartCompilerSetup::onGeneratorChanged(QString const& name) @@ -144,12 +145,15 @@ void StartCompilerSetup::onGeneratorChanged(QString const& name) int StartCompilerSetup::nextId() const { - if (compilerSetup()) + if (compilerSetup()) { return NativeSetup; - if (crossCompilerSetup()) + } + if (crossCompilerSetup()) { return CrossSetup; - if (crossCompilerToolChainFile()) + } + if (crossCompilerToolChainFile()) { return ToolchainSetup; + } return -1; } @@ -515,7 +519,8 @@ QString FirstConfigure::getCCompiler() const { if (this->compilerSetup()) { return this->mNativeCompilerSetupPage->getCCompiler(); - } else if (this->crossCompilerSetup()) { + } + if (this->crossCompilerSetup()) { return this->mCrossCompilerSetupPage->getCCompiler(); } return QString(); @@ -525,7 +530,8 @@ QString FirstConfigure::getCXXCompiler() const { if (this->compilerSetup()) { return this->mNativeCompilerSetupPage->getCXXCompiler(); - } else if (this->crossCompilerSetup()) { + } + if (this->crossCompilerSetup()) { return this->mCrossCompilerSetupPage->getCXXCompiler(); } return QString(); @@ -535,7 +541,8 @@ QString FirstConfigure::getFortranCompiler() const { if (this->compilerSetup()) { return this->mNativeCompilerSetupPage->getFortranCompiler(); - } else if (this->crossCompilerSetup()) { + } + if (this->crossCompilerSetup()) { return this->mCrossCompilerSetupPage->getFortranCompiler(); } return QString(); diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index a818c6b..7eadb09 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -13,6 +13,8 @@ #ifndef QCMake_h #define QCMake_h +#include <cmConfigure.h> + #include "cmake.h" #ifdef _MSC_VER @@ -71,7 +73,7 @@ class QCMake : public QObject { Q_OBJECT public: - QCMake(QObject* p = 0); + QCMake(QObject* p = CM_NULLPTR); ~QCMake(); public slots: /// load the cache file in a directory diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index cc1f4aa..88ea049 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -33,7 +33,7 @@ public: } protected: - bool filterAcceptsRow(int row, const QModelIndex& p) const + bool filterAcceptsRow(int row, const QModelIndex& p) const CM_OVERRIDE { QStringList strs; const QAbstractItemModel* m = this->sourceModel(); @@ -87,7 +87,7 @@ public: protected: bool ShowAdvanced; - bool filterAcceptsRow(int row, const QModelIndex& p) const + bool filterAcceptsRow(int row, const QModelIndex& p) const CM_OVERRIDE { const QAbstractItemModel* m = this->sourceModel(); QModelIndex idx = m->index(row, 0, p); @@ -160,7 +160,8 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, // want home/end to go to begin/end of rows, not columns if (act == MoveHome) { return this->model()->index(0, 1); - } else if (act == MoveEnd) { + } + if (act == MoveEnd) { return this->model()->index(this->model()->rowCount() - 1, 1); } return QTreeView::moveCursor(act, mod); @@ -538,15 +539,16 @@ void QCMakeCacheModelDelegate::setFileDialogFlag(bool f) this->FileDialogFlag = f; } -QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, - const QStyleOptionViewItem&, - const QModelIndex& idx) const +QWidget* QCMakeCacheModelDelegate::createEditor( + QWidget* p, const QStyleOptionViewItem& /*option*/, + const QModelIndex& idx) const { QModelIndex var = idx.sibling(idx.row(), 0); int type = var.data(QCMakeCacheModel::TypeRole).toInt(); if (type == QCMakeProperty::BOOL) { - return NULL; - } else if (type == QCMakeProperty::PATH) { + return CM_NULLPTR; + } + if (type == QCMakeProperty::PATH) { QCMakePathEditor* editor = new QCMakePathEditor(p, var.data(Qt::DisplayRole).toString()); QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this, @@ -645,7 +647,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, QStyleOptionButton opt; opt.QStyleOption::operator=(option); sz = sz.expandedTo( - style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, NULL) + style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, CM_NULLPTR) .size()); return sz; diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index 4b3eb34..fc481b8 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -67,7 +67,7 @@ void QCMakeFilePathEditor::chooseFile() this->fileDialogExists(true); path = QFileDialog::getOpenFileName(this, title, info.absolutePath(), QString(), - NULL, QFileDialog::DontResolveSymlinks); + CM_NULLPTR, QFileDialog::DontResolveSymlinks); this->fileDialogExists(false); if (!path.isEmpty()) { @@ -99,7 +99,7 @@ void QCMakePathEditor::chooseFile() // use same QDirModel for all completers static QDirModel* fileDirModel() { - static QDirModel* m = NULL; + static QDirModel* m = CM_NULLPTR; if (!m) { m = new QDirModel(); } @@ -107,7 +107,7 @@ static QDirModel* fileDirModel() } static QDirModel* pathDirModel() { - static QDirModel* m = NULL; + static QDirModel* m = CM_NULLPTR; if (!m) { m = new QDirModel(); m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot); diff --git a/Source/QtDialog/QCMakeWidgets.h b/Source/QtDialog/QCMakeWidgets.h index f1e87ce..0d95e63 100644 --- a/Source/QtDialog/QCMakeWidgets.h +++ b/Source/QtDialog/QCMakeWidgets.h @@ -13,6 +13,8 @@ #ifndef QCMakeWidgets_h #define QCMakeWidgets_h +#include <cmConfigure.h> + #include <QComboBox> #include <QCompleter> #include <QLineEdit> @@ -43,7 +45,7 @@ class QCMakePathEditor : public QCMakeFileEditor { Q_OBJECT public: - QCMakePathEditor(QWidget* p = NULL, const QString& var = QString()); + QCMakePathEditor(QWidget* p = CM_NULLPTR, const QString& var = QString()); void chooseFile(); }; @@ -52,7 +54,8 @@ class QCMakeFilePathEditor : public QCMakeFileEditor { Q_OBJECT public: - QCMakeFilePathEditor(QWidget* p = NULL, const QString& var = QString()); + QCMakeFilePathEditor(QWidget* p = CM_NULLPTR, + const QString& var = QString()); void chooseFile(); }; diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 6a2dfe8..473634d 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -80,7 +80,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, std::string str; if (cmSystemTools::GetEnv(var, str)) { if (this->EscapeQuotes) { - return this->AddString(cmSystemTools::EscapeQuotes(str.c_str())); + return this->AddString(cmSystemTools::EscapeQuotes(str)); } return this->AddString(str); } diff --git a/Source/cmFilePathUuid.cxx b/Source/cmFilePathUuid.cxx index b2def51..d47a0da 100644 --- a/Source/cmFilePathUuid.cxx +++ b/Source/cmFilePathUuid.cxx @@ -118,7 +118,7 @@ std::string cmFilePathUuid::GetChecksumString( // Calculate the file ( seed + relative path + name ) checksum std::vector<unsigned char> hashBytes = cmCryptoHash::New("SHA256")->ByteHashString( - (sourceRelSeed + sourceRelPath + sourceFilename).c_str()); + sourceRelSeed + sourceRelPath + sourceFilename); checksumBase32 = cmBase32Encoder().encodeString(&hashBytes[0], hashBytes.size(), false); diff --git a/Source/cmFilePathUuid.h b/Source/cmFilePathUuid.h index 87cfcf8..b54dc47 100644 --- a/Source/cmFilePathUuid.h +++ b/Source/cmFilePathUuid.h @@ -52,8 +52,9 @@ public: * @arg outputPrefix optional string to prepend to the result * @arg outputSuffix optional string to append to the result */ - std::string get(const std::string& filePath, const char* outputPrefix = NULL, - const char* outputSuffix = NULL); + std::string get(const std::string& filePath, + const char* outputPrefix = CM_NULLPTR, + const char* outputSuffix = CM_NULLPTR); private: void initParentDirs(const std::string& currentSrcDir, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b4bc084..5653820 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -397,7 +397,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( std::string listfile = root->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - allBuildGt->AddSource(listfile.c_str()); + allBuildGt->AddSource(listfile); // Add XCODE depend helper std::string dir = root->GetCurrentBinaryDirectory(); @@ -405,9 +405,9 @@ void cmGlobalXCodeGenerator::AddExtraTargets( if (this->XcodeVersion < 50) { makeHelper.push_back("make"); makeHelper.push_back("-C"); - makeHelper.push_back(dir.c_str()); + makeHelper.push_back(dir); makeHelper.push_back("-f"); - makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str()); + makeHelper.push_back(this->CurrentXCodeHackMakefile); makeHelper.push_back(""); // placeholder, see below } @@ -480,7 +480,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( listfile = lg->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - target->AddSource(listfile.c_str()); + target->AddSource(listfile); } } } @@ -841,7 +841,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( // lastKnownFileType as folder in order for Xcode to be able to // open the contents of the folder. // (Xcode 4.6 does not like explicitFileType=folder). - if (cmSystemTools::FileIsDirectory(fullpath.c_str())) { + if (cmSystemTools::FileIsDirectory(fullpath)) { fileType = (ext == "xcassets" ? "folder.assetcatalog" : "folder"); useLastKnownFileType = true; } else { @@ -856,7 +856,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( // Store the file path relative to the top of the source tree. std::string path = this->RelativeToSource(fullpath.c_str()); - std::string name = cmSystemTools::GetFilenameName(path.c_str()); + std::string name = cmSystemTools::GetFilenameName(path); const char* sourceTree = (cmSystemTools::FileIsFullPath(path.c_str()) ? "<absolute>" : "SOURCE_ROOT"); @@ -898,8 +898,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen) this->CurrentMakefile = gen->GetMakefile(); std::string outdir = cmSystemTools::CollapseFullPath( this->CurrentLocalGenerator->GetCurrentBinaryDirectory()); - cmSystemTools::SplitPath(outdir.c_str(), - this->CurrentOutputDirectoryComponents); + cmSystemTools::SplitPath(outdir, this->CurrentOutputDirectoryComponents); // Select the current set of configuration types. this->CurrentConfigurationTypes.clear(); @@ -951,7 +950,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( std::string targetName = gtgt->GetName(); // make sure ALL_BUILD, INSTALL, etc are only done once - if (this->SpecialTargetEmitted(targetName.c_str())) { + if (this->SpecialTargetEmitted(targetName)) { continue; } @@ -1223,7 +1222,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt) cmGeneratedFileStream fout(fname.c_str()); fout << "\n"; } - if (cmSourceFile* sf = mf->GetOrCreateSource(fname.c_str())) { + if (cmSourceFile* sf = mf->GetOrCreateSource(fname)) { sf->SetProperty("LANGUAGE", llang.c_str()); gtgt->AddSource(fname); } @@ -1468,7 +1467,7 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase( currentConfig != this->CurrentConfigurationTypes.end(); currentConfig++) { this->CreateCustomRulesMakefile(makefile.c_str(), target, commands, - currentConfig->c_str()); + *currentConfig); } std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory(); @@ -1550,8 +1549,8 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( ccg.GetDepends().begin(); d != ccg.GetDepends().end(); ++d) { std::string dep; - if (this->CurrentLocalGenerator->GetRealDependency(d->c_str(), - configName, dep)) { + if (this->CurrentLocalGenerator->GetRealDependency(*d, configName, + dep)) { makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep.c_str()); } @@ -1662,7 +1661,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } if (!extraLinkOptionsVar.empty()) { this->CurrentLocalGenerator->AddConfigVariableFlags( - extraLinkOptions, extraLinkOptionsVar.c_str(), configName); + extraLinkOptions, extraLinkOptionsVar, configName); } if (gtgt->GetType() == cmState::OBJECT_LIBRARY || @@ -1678,7 +1677,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, if (!configName.empty()) { std::string linkFlagsVar = "LINK_FLAGS_"; linkFlagsVar += cmSystemTools::UpperCase(configName); - if (const char* linkFlags = gtgt->GetProperty(linkFlagsVar.c_str())) { + if (const char* linkFlags = gtgt->GetProperty(linkFlagsVar)) { this->CurrentLocalGenerator->AppendFlags(extraLinkOptions, linkFlags); } } @@ -1916,7 +1915,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, configName); for (std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { - if (this->NameResolvesToFramework(i->c_str())) { + if (this->NameResolvesToFramework(*i)) { std::string frameworkDir = *i; frameworkDir += "/../"; frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir); @@ -2165,7 +2164,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, std::string processed = ge.Parse(gtgt->GetProperty(*i)) ->Evaluate(this->CurrentLocalGenerator, configName); - buildSettings->AddAttribute(attribute.c_str(), + buildSettings->AddAttribute(attribute, this->CreateString(processed)); } } @@ -2195,7 +2194,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget( cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXAggregateTarget); - target->SetComment(gtgt->GetName().c_str()); + target->SetComment(gtgt->GetName()); cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST); std::vector<cmXCodeObject*> emptyContentVector; this->CreateCustomCommands(buildPhases, 0, 0, 0, emptyContentVector, 0, @@ -2233,7 +2232,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget( } } - target->SetId(this->GetOrCreateId(gtgt->GetName(), target->GetId()).c_str()); + target->SetId(this->GetOrCreateId(gtgt->GetName(), target->GetId())); return target; } @@ -2257,7 +2256,7 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target, comment += " \""; comment += gtgt->GetName(); comment += "\""; - configlist->SetComment(comment.c_str()); + configlist->SetComment(comment); target->AddAttribute("buildConfigurationList", this->CreateObjectReference(configlist)); for (unsigned int i = 0; i < configVector.size(); ++i) { @@ -2266,9 +2265,9 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target, buildConfigurations->AddObject(config); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); - this->CreateBuildSettings(gtgt, buildSettings, configVector[i].c_str()); + this->CreateBuildSettings(gtgt, buildSettings, configVector[i]); config->AddAttribute("name", this->CreateString(configVector[i])); - config->SetComment(configVector[i].c_str()); + config->SetComment(configVector[i]); config->AddAttribute("buildSettings", buildSettings); } if (!configVector.empty()) { @@ -2367,7 +2366,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); defConfig = this->CurrentMakefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->CreateBuildSettings(gtgt, buildSettings, defConfig.c_str()); + this->CreateBuildSettings(gtgt, buildSettings, defConfig); target->AddAttribute("buildSettings", buildSettings); } cmXCodeObject* dependencies = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -2385,7 +2384,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( fullName += gtgt->GetName(); fullName += ".a"; } else { - fullName = gtgt->GetFullName(defConfig.c_str()); + fullName = gtgt->GetFullName(defConfig); } fileRef->AddAttribute("path", this->CreateString(fullName)); if (this->XcodeVersion == 15) { @@ -2393,7 +2392,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( } fileRef->AddAttribute("sourceTree", this->CreateString("BUILT_PRODUCTS_DIR")); - fileRef->SetComment(gtgt->GetName().c_str()); + fileRef->SetComment(gtgt->GetName()); target->AddAttribute("productReference", this->CreateObjectReference(fileRef)); if (const char* productType = this->GetTargetProductType(gtgt)) { @@ -2401,7 +2400,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( } target->SetTarget(gtgt); this->XCodeObjectMap[gtgt] = target; - target->SetId(this->GetOrCreateId(gtgt->GetName(), target->GetId()).c_str()); + target->SetId(this->GetOrCreateId(gtgt->GetName(), target->GetId())); return target; } @@ -2426,15 +2425,14 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, std::string guidStoreName = name; guidStoreName += "_GUID_CMAKE"; const char* storedGUID = - this->CMakeInstance->GetCacheDefinition(guidStoreName.c_str()); + this->CMakeInstance->GetCacheDefinition(guidStoreName); if (storedGUID) { return storedGUID; } - this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), id.c_str(), - "Stored Xcode object GUID", - cmState::INTERNAL); + this->CMakeInstance->AddCacheEntry( + guidStoreName, id.c_str(), "Stored Xcode object GUID", cmState::INTERNAL); return id; } @@ -2482,7 +2480,7 @@ void cmGlobalXCodeGenerator::AppendOrAddBuildSetting(cmXCodeObject* settings, std::string oldValue = attr->GetString(); oldValue += " "; oldValue += value; - attr->SetString(oldValue.c_str()); + attr->SetString(oldValue); } } } @@ -2582,7 +2580,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) std::vector<std::string> const& libDeps = cli.GetDepends(); for (std::vector<std::string>::const_iterator j = libDeps.begin(); j != libDeps.end(); ++j) { - target->AddDependLibrary(configName, j->c_str()); + target->AddDependLibrary(configName, *j); } } @@ -2891,8 +2889,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( std::string project_id = "PROJECT_"; project_id += root->GetProjectName(); this->RootObject->SetId( - this->GetOrCreateId(project_id.c_str(), this->RootObject->GetId()) - .c_str()); + this->GetOrCreateId(project_id.c_str(), this->RootObject->GetId())); group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); this->RootObject->AddAttribute("mainGroup", @@ -2963,7 +2960,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( comment += " \""; comment += this->CurrentProject; comment += "\""; - configlist->SetComment(comment.c_str()); + configlist->SetComment(comment); configlist->AddAttribute("defaultConfigurationIsVisible", this->CreateString("0")); configlist->AddAttribute("defaultConfigurationName", @@ -3373,8 +3370,7 @@ std::string cmGlobalXCodeGenerator::LookupFlags( std::string varName = varNamePrefix; varName += varNameLang; varName += varNameSuffix; - if (const char* varValue = - this->CurrentMakefile->GetDefinition(varName.c_str())) { + if (const char* varValue = this->CurrentMakefile->GetDefinition(varName)) { if (*varValue) { return varValue; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cecf7b7..694a9f6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1373,7 +1373,7 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target, } // Add preprocessor definitions for this target and configuration. - this->AddCompileDefinitions(defines, target, config, lang.c_str()); + this->AddCompileDefinitions(defines, target, config, lang); } std::string cmLocalGenerator::GetTargetFortranFlags( diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 7c53a3d..9878912 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -20,10 +20,10 @@ cmXMLParser::cmXMLParser() { - this->Parser = 0; + this->Parser = CM_NULLPTR; this->ParseError = 0; - this->ReportCallback = 0; - this->ReportCallbackData = 0; + this->ReportCallback = CM_NULLPTR; + this->ReportCallbackData = CM_NULLPTR; } cmXMLParser::~cmXMLParser() @@ -64,7 +64,7 @@ int cmXMLParser::InitializeParser() } // Create the expat XML parser. - this->Parser = XML_ParserCreate(0); + this->Parser = XML_ParserCreate(CM_NULLPTR); XML_SetElementHandler(static_cast<XML_Parser>(this->Parser), &cmXMLParserStartElement, &cmXMLParserEndElement); XML_SetCharacterDataHandler(static_cast<XML_Parser>(this->Parser), @@ -108,7 +108,7 @@ int cmXMLParser::CleanupParser() // Clean up the parser. XML_ParserFree(static_cast<XML_Parser>(this->Parser)); - this->Parser = 0; + this->Parser = CM_NULLPTR; return result; } @@ -165,7 +165,7 @@ const char* cmXMLParser::FindAttribute(const char** atts, } } } - return 0; + return CM_NULLPTR; } void cmXMLParserStartElement(void* parser, const char* name, const char** atts) |