Jelajahi Sumber

Merge topic 'string-clear'

5db3aac1 Meta: replace empty-string assignments with `clear()`.

Acked-by: Kitware Robot <[email protected]>
Merge-request: !1276
Brad King 8 tahun lalu
induk
melakukan
7c28081c14
70 mengubah file dengan 212 tambahan dan 212 penghapusan
  1. 2 2
      Source/CPack/IFW/cmCPackIFWGenerator.cxx
  2. 10 10
      Source/CPack/IFW/cmCPackIFWPackage.cxx
  3. 7 7
      Source/CPack/IFW/cmCPackIFWRepository.cxx
  4. 1 1
      Source/CPack/cmCPackDebGenerator.cxx
  5. 1 1
      Source/CPack/cpack.cxx
  6. 2 2
      Source/CTest/cmCTestBZR.cxx
  7. 1 1
      Source/CTest/cmCTestBuildAndTestHandler.cxx
  8. 12 12
      Source/CTest/cmCTestBuildHandler.cxx
  9. 5 5
      Source/CTest/cmCTestCoverageHandler.cxx
  10. 4 4
      Source/CTest/cmCTestCurl.cxx
  11. 1 1
      Source/CTest/cmCTestHG.cxx
  12. 10 10
      Source/CTest/cmCTestMemCheckHandler.cxx
  13. 7 7
      Source/CTest/cmCTestRunTest.cxx
  14. 16 16
      Source/CTest/cmCTestScriptHandler.cxx
  15. 3 3
      Source/CTest/cmCTestSubmitHandler.cxx
  16. 7 7
      Source/CTest/cmCTestTestHandler.cxx
  17. 1 1
      Source/CTest/cmCTestUpdateHandler.cxx
  18. 3 3
      Source/CTest/cmParseCacheCoverage.cxx
  19. 2 2
      Source/CTest/cmParseCoberturaCoverage.cxx
  20. 3 3
      Source/CTest/cmParseGTMCoverage.cxx
  21. 4 4
      Source/CTest/cmParseJacocoCoverage.cxx
  22. 1 1
      Source/bindexplib.cxx
  23. 1 1
      Source/cmBuildNameCommand.cxx
  24. 7 7
      Source/cmCTest.cxx
  25. 2 2
      Source/cmCacheManager.cxx
  26. 2 2
      Source/cmCommandArgumentParserHelper.cxx
  27. 1 1
      Source/cmCommandArgumentsHelper.cxx
  28. 1 1
      Source/cmComputeLinkInformation.cxx
  29. 1 1
      Source/cmConditionEvaluator.cxx
  30. 3 3
      Source/cmCoreTryCompile.cxx
  31. 1 1
      Source/cmDependsFortran.cxx
  32. 6 6
      Source/cmExportFileGenerator.cxx
  33. 2 2
      Source/cmExtraEclipseCDT4Generator.cxx
  34. 1 1
      Source/cmExtraSublimeTextGenerator.cxx
  35. 7 7
      Source/cmFileCommand.cxx
  36. 1 1
      Source/cmFileLock.cxx
  37. 1 1
      Source/cmFindPathCommand.cxx
  38. 1 1
      Source/cmFortranParserImpl.cxx
  39. 3 3
      Source/cmGeneratorExpression.cxx
  40. 9 9
      Source/cmGeneratorTarget.cxx
  41. 2 2
      Source/cmGlobalVisualStudio10Generator.cxx
  42. 2 2
      Source/cmGlobalVisualStudio7Generator.cxx
  43. 1 1
      Source/cmGlobalVisualStudio8Generator.cxx
  44. 1 1
      Source/cmIncludeDirectoryCommand.cxx
  45. 1 1
      Source/cmInstallCommandArguments.cxx
  46. 1 1
      Source/cmLoadCacheCommand.cxx
  47. 1 1
      Source/cmLocalCommonGenerator.cxx
  48. 1 1
      Source/cmLocalNinjaGenerator.cxx
  49. 2 2
      Source/cmLocalUnixMakefileGenerator3.cxx
  50. 2 2
      Source/cmLocalVisualStudio7Generator.cxx
  51. 1 1
      Source/cmLocalVisualStudioGenerator.cxx
  52. 4 4
      Source/cmMakefile.cxx
  53. 1 1
      Source/cmMakefileTargetGenerator.cxx
  54. 3 3
      Source/cmNinjaNormalTargetGenerator.cxx
  55. 1 1
      Source/cmNinjaTargetGenerator.cxx
  56. 1 1
      Source/cmOutputRequiredFilesCommand.cxx
  57. 2 2
      Source/cmProcessTools.cxx
  58. 3 3
      Source/cmRST.cxx
  59. 1 1
      Source/cmScriptGenerator.cxx
  60. 1 1
      Source/cmSearchPath.cxx
  61. 2 2
      Source/cmStateDirectory.cxx
  62. 7 7
      Source/cmSystemTools.cxx
  63. 2 2
      Source/cmTarget.cxx
  64. 5 5
      Source/cmTryRunCommand.cxx
  65. 1 1
      Source/cmVSSetupHelper.cxx
  66. 1 1
      Source/cmVisualStudio10TargetGenerator.cxx
  67. 1 1
      Source/cmVisualStudioSlnParser.cxx
  68. 4 4
      Source/cmVisualStudioWCEPlatformParser.cxx
  69. 2 2
      Source/cmake.cxx
  70. 2 2
      Source/cmakemain.cxx

+ 2 - 2
Source/CPack/IFW/cmCPackIFWGenerator.cxx

@@ -258,7 +258,7 @@ int cmCPackIFWGenerator::InitializeInternal()
 
 
   const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
   const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
   if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) {
   if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) {
-    this->BinCreator = "";
+    this->BinCreator.clear();
   } else {
   } else {
     this->BinCreator = BinCreatorStr;
     this->BinCreator = BinCreatorStr;
   }
   }
@@ -274,7 +274,7 @@ int cmCPackIFWGenerator::InitializeInternal()
 
 
   const char* RepoGenStr = this->GetOption(RepoGenOpt);
   const char* RepoGenStr = this->GetOption(RepoGenOpt);
   if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) {
   if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) {
-    this->RepoGen = "";
+    this->RepoGen.clear();
   } else {
   } else {
     this->RepoGen = RepoGenStr;
     this->RepoGen = RepoGenStr;
   }
   }

+ 10 - 10
Source/CPack/IFW/cmCPackIFWPackage.cxx

@@ -111,19 +111,19 @@ void cmCPackIFWPackage::DefaultConfiguration()
 {
 {
   this->DisplayName.clear();
   this->DisplayName.clear();
   this->Description.clear();
   this->Description.clear();
-  this->Version = "";
-  this->ReleaseDate = "";
-  this->Script = "";
+  this->Version.clear();
+  this->ReleaseDate.clear();
+  this->Script.clear();
   this->Licenses.clear();
   this->Licenses.clear();
   this->UserInterfaces.clear();
   this->UserInterfaces.clear();
   this->Translations.clear();
   this->Translations.clear();
-  this->SortingPriority = "";
-  this->UpdateText = "";
-  this->Default = "";
-  this->Essential = "";
-  this->Virtual = "";
-  this->ForcedInstallation = "";
-  this->RequiresAdminRights = "";
+  this->SortingPriority.clear();
+  this->UpdateText.clear();
+  this->Default.clear();
+  this->Essential.clear();
+  this->Virtual.clear();
+  this->ForcedInstallation.clear();
+  this->RequiresAdminRights.clear();
 }
 }
 
 
 // Defaul configuration (all in one package)
 // Defaul configuration (all in one package)

+ 7 - 7
Source/CPack/IFW/cmCPackIFWRepository.cxx

@@ -62,49 +62,49 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
   if (const char* url = this->GetOption(prefix + "URL")) {
   if (const char* url = this->GetOption(prefix + "URL")) {
     this->Url = url;
     this->Url = url;
   } else {
   } else {
-    this->Url = "";
+    this->Url.clear();
   }
   }
 
 
   // Old url
   // Old url
   if (const char* oldUrl = this->GetOption(prefix + "OLD_URL")) {
   if (const char* oldUrl = this->GetOption(prefix + "OLD_URL")) {
     this->OldUrl = oldUrl;
     this->OldUrl = oldUrl;
   } else {
   } else {
-    this->OldUrl = "";
+    this->OldUrl.clear();
   }
   }
 
 
   // New url
   // New url
   if (const char* newUrl = this->GetOption(prefix + "NEW_URL")) {
   if (const char* newUrl = this->GetOption(prefix + "NEW_URL")) {
     this->NewUrl = newUrl;
     this->NewUrl = newUrl;
   } else {
   } else {
-    this->NewUrl = "";
+    this->NewUrl.clear();
   }
   }
 
 
   // Enabled
   // Enabled
   if (this->IsOn(prefix + "DISABLED")) {
   if (this->IsOn(prefix + "DISABLED")) {
     this->Enabled = "0";
     this->Enabled = "0";
   } else {
   } else {
-    this->Enabled = "";
+    this->Enabled.clear();
   }
   }
 
 
   // Username
   // Username
   if (const char* username = this->GetOption(prefix + "USERNAME")) {
   if (const char* username = this->GetOption(prefix + "USERNAME")) {
     this->Username = username;
     this->Username = username;
   } else {
   } else {
-    this->Username = "";
+    this->Username.clear();
   }
   }
 
 
   // Password
   // Password
   if (const char* password = this->GetOption(prefix + "PASSWORD")) {
   if (const char* password = this->GetOption(prefix + "PASSWORD")) {
     this->Password = password;
     this->Password = password;
   } else {
   } else {
-    this->Password = "";
+    this->Password.clear();
   }
   }
 
 
   // DisplayName
   // DisplayName
   if (const char* displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
   if (const char* displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
     this->DisplayName = displayName;
     this->DisplayName = displayName;
   } else {
   } else {
-    this->DisplayName = "";
+    this->DisplayName.clear();
   }
   }
 
 
   return this->IsValid();
   return this->IsValid();

+ 1 - 1
Source/CPack/cmCPackDebGenerator.cxx

@@ -400,7 +400,7 @@ int cmCPackDebGenerator::createDeb()
     compression_suffix = ".gz";
     compression_suffix = ".gz";
     tar_compression_type = cmArchiveWrite::CompressGZip;
     tar_compression_type = cmArchiveWrite::CompressGZip;
   } else if (!strcmp(debian_compression_type, "none")) {
   } else if (!strcmp(debian_compression_type, "none")) {
-    compression_suffix = "";
+    compression_suffix.clear();
     tar_compression_type = cmArchiveWrite::CompressNone;
     tar_compression_type = cmArchiveWrite::CompressNone;
   } else {
   } else {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
     cmCPackLogger(cmCPackLog::LOG_ERROR,

+ 1 - 1
Source/CPack/cpack.cxx

@@ -135,7 +135,7 @@ int main(int argc, char const* const* argv)
   cpackDefinitions definitions;
   cpackDefinitions definitions;
   definitions.Log = &log;
   definitions.Log = &log;
 
 
-  cpackConfigFile = "";
+  cpackConfigFile.clear();
 
 
   cmsys::CommandLineArguments arg;
   cmsys::CommandLineArguments arg;
   arg.Initialize(argc, argv);
   arg.Initialize(argc, argv);

+ 2 - 2
Source/CTest/cmCTestBZR.cxx

@@ -309,11 +309,11 @@ private:
 
 
           // Hand this line to the subclass implementation.
           // Hand this line to the subclass implementation.
           if (!this->ProcessLine()) {
           if (!this->ProcessLine()) {
-            this->Line = "";
+            this->Line.clear();
             return false;
             return false;
           }
           }
 
 
-          this->Line = "";
+          this->Line.clear();
           last_is_new_line = true;
           last_is_new_line = true;
         }
         }
       } else {
       } else {

+ 1 - 1
Source/CTest/cmCTestBuildAndTestHandler.cxx

@@ -32,7 +32,7 @@ const char* cmCTestBuildAndTestHandler::GetOutput()
 }
 }
 int cmCTestBuildAndTestHandler::ProcessHandler()
 int cmCTestBuildAndTestHandler::ProcessHandler()
 {
 {
-  this->Output = "";
+  this->Output.clear();
   std::string output;
   std::string output;
   cmSystemTools::ResetErrorOccuredFlag();
   cmSystemTools::ResetErrorOccuredFlag();
   int retv = this->RunCMakeAndTest(&this->Output);
   int retv = this->RunCMakeAndTest(&this->Output);

+ 12 - 12
Source/CTest/cmCTestBuildHandler.cxx

@@ -171,8 +171,8 @@ cmCTestBuildHandler::cmCTestBuildHandler()
 void cmCTestBuildHandler::Initialize()
 void cmCTestBuildHandler::Initialize()
 {
 {
   this->Superclass::Initialize();
   this->Superclass::Initialize();
-  this->StartBuild = "";
-  this->EndBuild = "";
+  this->StartBuild.clear();
+  this->EndBuild.clear();
   this->CustomErrorMatches.clear();
   this->CustomErrorMatches.clear();
   this->CustomErrorExceptions.clear();
   this->CustomErrorExceptions.clear();
   this->CustomWarningMatches.clear();
   this->CustomWarningMatches.clear();
@@ -190,8 +190,8 @@ void cmCTestBuildHandler::Initialize()
   this->BuildOutputLogSize = 0;
   this->BuildOutputLogSize = 0;
   this->CurrentProcessingLine.clear();
   this->CurrentProcessingLine.clear();
 
 
-  this->SimplifySourceDir = "";
-  this->SimplifyBuildDir = "";
+  this->SimplifySourceDir.clear();
+  this->SimplifyBuildDir.clear();
   this->OutputLineCounter = 0;
   this->OutputLineCounter = 0;
   this->ErrorsAndWarnings.clear();
   this->ErrorsAndWarnings.clear();
   this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
   this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
@@ -371,8 +371,8 @@ int cmCTestBuildHandler::ProcessHandler()
                                          this->WarningExceptionRegex);
                                          this->WarningExceptionRegex);
 
 
   // Determine source and binary tree substitutions to simplify the output.
   // Determine source and binary tree substitutions to simplify the output.
-  this->SimplifySourceDir = "";
-  this->SimplifyBuildDir = "";
+  this->SimplifySourceDir.clear();
+  this->SimplifyBuildDir.clear();
   if (this->CTest->GetCTestConfiguration("SourceDirectory").size() > 20) {
   if (this->CTest->GetCTestConfiguration("SourceDirectory").size() > 20) {
     std::string srcdir =
     std::string srcdir =
       this->CTest->GetCTestConfiguration("SourceDirectory") + "/";
       this->CTest->GetCTestConfiguration("SourceDirectory") + "/";
@@ -888,8 +888,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
         errorwarning.Text =
         errorwarning.Text =
           "*** WARNING non-zero return value in ctest from: ";
           "*** WARNING non-zero return value in ctest from: ";
         errorwarning.Text += argv[0];
         errorwarning.Text += argv[0];
-        errorwarning.PreContext = "";
-        errorwarning.PostContext = "";
+        errorwarning.PreContext.clear();
+        errorwarning.PostContext.clear();
         errorwarning.Error = false;
         errorwarning.Error = false;
         this->ErrorsAndWarnings.push_back(errorwarning);
         this->ErrorsAndWarnings.push_back(errorwarning);
         this->TotalWarnings++;
         this->TotalWarnings++;
@@ -911,8 +911,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
     errorwarning.LogLine = 1;
     errorwarning.LogLine = 1;
     errorwarning.Text = "*** ERROR executing: ";
     errorwarning.Text = "*** ERROR executing: ";
     errorwarning.Text += cmsysProcess_GetErrorString(cp);
     errorwarning.Text += cmsysProcess_GetErrorString(cp);
-    errorwarning.PreContext = "";
-    errorwarning.PostContext = "";
+    errorwarning.PreContext.clear();
+    errorwarning.PostContext.clear();
     errorwarning.Error = true;
     errorwarning.Error = true;
     this->ErrorsAndWarnings.push_back(errorwarning);
     this->ErrorsAndWarnings.push_back(errorwarning);
     this->TotalErrors++;
     this->TotalErrors++;
@@ -996,8 +996,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
         // This is an error or warning, so generate report
         // This is an error or warning, so generate report
         errorwarning.LogLine = static_cast<int>(this->OutputLineCounter + 1);
         errorwarning.LogLine = static_cast<int>(this->OutputLineCounter + 1);
         errorwarning.Text = line;
         errorwarning.Text = line;
-        errorwarning.PreContext = "";
-        errorwarning.PostContext = "";
+        errorwarning.PreContext.clear();
+        errorwarning.PostContext.clear();
 
 
         // Copy pre-context to report
         // Copy pre-context to report
         for (std::string const& pc : this->PreContext) {
         for (std::string const& pc : this->PreContext) {

+ 5 - 5
Source/CTest/cmCTestCoverageHandler.cxx

@@ -1073,7 +1073,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           break;
           break;
         }
         }
 
 
-        actualSourceFile = "";
+        actualSourceFile.clear();
         sourceFile = st1re1.match(2);
         sourceFile = st1re1.match(2);
       } else if (st1re2.find(line.c_str())) {
       } else if (st1re2.find(line.c_str())) {
         if (gcovStyle == 0) {
         if (gcovStyle == 0) {
@@ -1098,7 +1098,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           break;
           break;
         }
         }
 
 
-        actualSourceFile = "";
+        actualSourceFile.clear();
         sourceFile = st2re1.match(1);
         sourceFile = st2re1.match(1);
       } else if (st2re2.find(line.c_str())) {
       } else if (st2re2.find(line.c_str())) {
         if (gcovStyle == 0) {
         if (gcovStyle == 0) {
@@ -1240,11 +1240,11 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           }
           }
         }
         }
 
 
-        actualSourceFile = "";
+        actualSourceFile.clear();
       }
       }
 
 
       if (!sourceFile.empty() && actualSourceFile.empty()) {
       if (!sourceFile.empty() && actualSourceFile.empty()) {
-        gcovFile = "";
+        gcovFile.clear();
 
 
         // Is it in the source dir or the binary dir?
         // Is it in the source dir or the binary dir?
         //
         //
@@ -1541,7 +1541,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
             }
             }
           }
           }
 
 
-          actualSourceFile = "";
+          actualSourceFile.clear();
         }
         }
       }
       }
     }
     }

+ 4 - 4
Source/CTest/cmCTestCurl.cxx

@@ -109,7 +109,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
                              std::string const& url, std::string const& fields,
                              std::string const& url, std::string const& fields,
                              std::string& response)
                              std::string& response)
 {
 {
-  response = "";
+  response.clear();
   if (!this->InitCurl()) {
   if (!this->InitCurl()) {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed");
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed");
     return false;
     return false;
@@ -185,7 +185,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
 bool cmCTestCurl::HttpRequest(std::string const& url,
 bool cmCTestCurl::HttpRequest(std::string const& url,
                               std::string const& fields, std::string& response)
                               std::string const& fields, std::string& response)
 {
 {
-  response = "";
+  response.clear();
   cmCTestOptionalLog(this->CTest, DEBUG, "HttpRequest\n"
   cmCTestOptionalLog(this->CTest, DEBUG, "HttpRequest\n"
                        << "url: " << url << "\n"
                        << "url: " << url << "\n"
                        << "fields " << fields << "\n",
                        << "fields " << fields << "\n",
@@ -240,10 +240,10 @@ bool cmCTestCurl::HttpRequest(std::string const& url,
 
 
 void cmCTestCurl::SetProxyType()
 void cmCTestCurl::SetProxyType()
 {
 {
-  this->HTTPProxy = "";
+  this->HTTPProxy.clear();
   // this is the default
   // this is the default
   this->HTTPProxyType = CURLPROXY_HTTP;
   this->HTTPProxyType = CURLPROXY_HTTP;
-  this->HTTPProxyAuth = "";
+  this->HTTPProxyAuth.clear();
   if (cmSystemTools::GetEnv("HTTP_PROXY", this->HTTPProxy)) {
   if (cmSystemTools::GetEnv("HTTP_PROXY", this->HTTPProxy)) {
     std::string port;
     std::string port;
     if (cmSystemTools::GetEnv("HTTP_PROXY_PORT", port)) {
     if (cmSystemTools::GetEnv("HTTP_PROXY_PORT", port)) {

+ 1 - 1
Source/CTest/cmCTestHG.cxx

@@ -250,7 +250,7 @@ private:
         currPath += i;
         currPath += i;
       } else {
       } else {
         output.push_back(currPath);
         output.push_back(currPath);
-        currPath = "";
+        currPath.clear();
       }
       }
     }
     }
     output.push_back(currPath);
     output.push_back(currPath);

+ 10 - 10
Source/CTest/cmCTestMemCheckHandler.cxx

@@ -122,11 +122,11 @@ void cmCTestMemCheckHandler::Initialize()
   this->LogWithPID = false;
   this->LogWithPID = false;
   this->CustomMaximumPassedTestOutputSize = 0;
   this->CustomMaximumPassedTestOutputSize = 0;
   this->CustomMaximumFailedTestOutputSize = 0;
   this->CustomMaximumFailedTestOutputSize = 0;
-  this->MemoryTester = "";
+  this->MemoryTester.clear();
   this->MemoryTesterDynamicOptions.clear();
   this->MemoryTesterDynamicOptions.clear();
   this->MemoryTesterOptions.clear();
   this->MemoryTesterOptions.clear();
   this->MemoryTesterStyle = UNKNOWN;
   this->MemoryTesterStyle = UNKNOWN;
-  this->MemoryTesterOutputFile = "";
+  this->MemoryTesterOutputFile.clear();
   this->DefectCount = 0;
   this->DefectCount = 0;
 }
 }
 
 
@@ -417,8 +417,8 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
 
 
 bool cmCTestMemCheckHandler::InitializeMemoryChecking()
 bool cmCTestMemCheckHandler::InitializeMemoryChecking()
 {
 {
-  this->MemoryTesterEnvironmentVariable = "";
-  this->MemoryTester = "";
+  this->MemoryTesterEnvironmentVariable.clear();
+  this->MemoryTester.clear();
   // Setup the command
   // Setup the command
   if (cmSystemTools::FileExists(
   if (cmSystemTools::FileExists(
         this->CTest->GetCTestConfiguration("MemoryCheckCommand").c_str())) {
         this->CTest->GetCTestConfiguration("MemoryCheckCommand").c_str())) {
@@ -725,7 +725,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
   std::vector<std::string> lines;
   std::vector<std::string> lines;
   cmSystemTools::Split(str.c_str(), lines);
   cmSystemTools::Split(str.c_str(), lines);
   std::ostringstream ostr;
   std::ostringstream ostr;
-  log = "";
+  log.clear();
   for (std::string const& l : lines) {
   for (std::string const& l : lines) {
     std::string resultFound;
     std::string resultFound;
     if (leakWarning.find(l)) {
     if (leakWarning.find(l)) {
@@ -755,7 +755,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
   std::vector<std::string> lines;
   std::vector<std::string> lines;
   cmSystemTools::Split(str.c_str(), lines);
   cmSystemTools::Split(str.c_str(), lines);
   std::ostringstream ostr;
   std::ostringstream ostr;
-  log = "";
+  log.clear();
 
 
   cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): ");
   cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): ");
 
 
@@ -805,7 +805,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
   std::string::size_type cc;
   std::string::size_type cc;
 
 
   std::ostringstream ostr;
   std::ostringstream ostr;
-  log = "";
+  log.clear();
 
 
   int defects = 0;
   int defects = 0;
 
 
@@ -928,7 +928,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
 bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
 bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
   const std::string& str, std::string& log, std::vector<int>& results)
   const std::string& str, std::string& log, std::vector<int>& results)
 {
 {
-  log = "";
+  log.clear();
   double sttime = cmSystemTools::GetTime();
   double sttime = cmSystemTools::GetTime();
   std::vector<std::string> lines;
   std::vector<std::string> lines;
   cmSystemTools::Split(str.c_str(), lines);
   cmSystemTools::Split(str.c_str(), lines);
@@ -1079,7 +1079,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
     if (g.GetFiles().empty()) {
     if (g.GetFiles().empty()) {
       std::string log = "Cannot find memory tester output file: " + ofile;
       std::string log = "Cannot find memory tester output file: " + ofile;
       cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
       cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
-      ofile = "";
+      ofile.clear();
     } else {
     } else {
       files = g.GetFiles();
       files = g.GetFiles();
       return;
       return;
@@ -1087,7 +1087,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
   } else if (!cmSystemTools::FileExists(ofile.c_str())) {
   } else if (!cmSystemTools::FileExists(ofile.c_str())) {
     std::string log = "Cannot find memory tester output file: " + ofile;
     std::string log = "Cannot find memory tester output file: " + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
     cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
-    ofile = "";
+    ofile.clear();
   }
   }
   files.push_back(ofile);
   files.push_back(ofile);
 }
 }

+ 7 - 7
Source/CTest/cmCTestRunTest.cxx

@@ -30,8 +30,8 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
   this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
   this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
   this->TestResult.TestCount = 0;
   this->TestResult.TestCount = 0;
   this->TestResult.Properties = nullptr;
   this->TestResult.Properties = nullptr;
-  this->ProcessOutput = "";
-  this->CompressedOutput = "";
+  this->ProcessOutput.clear();
+  this->CompressedOutput.clear();
   this->CompressionRatio = 2;
   this->CompressionRatio = 2;
   this->StopTimePassed = false;
   this->StopTimePassed = false;
   this->NumberOfRunsLeft = 1; // default to 1 run of the test
   this->NumberOfRunsLeft = 1; // default to 1 run of the test
@@ -426,7 +426,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     this->TestResult.Path = this->TestProperties->Directory;
     this->TestResult.Path = this->TestProperties->Directory;
     this->TestProcess = new cmProcess;
     this->TestProcess = new cmProcess;
     this->TestResult.Output = "Disabled";
     this->TestResult.Output = "Disabled";
-    this->TestResult.FullCommandLine = "";
+    this->TestResult.FullCommandLine.clear();
     return false;
     return false;
   }
   }
 
 
@@ -451,7 +451,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     *this->TestHandler->LogFile << msg << std::endl;
     *this->TestHandler->LogFile << msg << std::endl;
     cmCTestLog(this->CTest, HANDLER_OUTPUT, msg << std::endl);
     cmCTestLog(this->CTest, HANDLER_OUTPUT, msg << std::endl);
     this->TestResult.Output = msg;
     this->TestResult.Output = msg;
-    this->TestResult.FullCommandLine = "";
+    this->TestResult.FullCommandLine.clear();
     this->TestResult.CompletionStatus = "Fixture dependency failed";
     this->TestResult.CompletionStatus = "Fixture dependency failed";
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     return false;
     return false;
@@ -471,7 +471,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     *this->TestHandler->LogFile << msg << std::endl;
     *this->TestHandler->LogFile << msg << std::endl;
     cmCTestLog(this->CTest, ERROR_MESSAGE, msg << std::endl);
     cmCTestLog(this->CTest, ERROR_MESSAGE, msg << std::endl);
     this->TestResult.Output = msg;
     this->TestResult.Output = msg;
-    this->TestResult.FullCommandLine = "";
+    this->TestResult.FullCommandLine.clear();
     this->TestResult.CompletionStatus = "Missing Configuration";
     this->TestResult.CompletionStatus = "Missing Configuration";
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     return false;
     return false;
@@ -487,7 +487,7 @@ bool cmCTestRunTest::StartTest(size_t total)
       cmCTestLog(this->CTest, ERROR_MESSAGE,
       cmCTestLog(this->CTest, ERROR_MESSAGE,
                  "Unable to find required file: " << file << std::endl);
                  "Unable to find required file: " << file << std::endl);
       this->TestResult.Output = "Unable to find required file: " + file;
       this->TestResult.Output = "Unable to find required file: " + file;
-      this->TestResult.FullCommandLine = "";
+      this->TestResult.FullCommandLine.clear();
       this->TestResult.CompletionStatus = "Required Files Missing";
       this->TestResult.CompletionStatus = "Required Files Missing";
       this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
       this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
       return false;
       return false;
@@ -503,7 +503,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     cmCTestLog(this->CTest, ERROR_MESSAGE,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Unable to find executable: " << args[1] << std::endl);
                "Unable to find executable: " << args[1] << std::endl);
     this->TestResult.Output = "Unable to find executable: " + args[1];
     this->TestResult.Output = "Unable to find executable: " + args[1];
-    this->TestResult.FullCommandLine = "";
+    this->TestResult.FullCommandLine.clear();
     this->TestResult.CompletionStatus = "Unable to find executable";
     this->TestResult.CompletionStatus = "Unable to find executable";
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     return false;
     return false;

+ 16 - 16
Source/CTest/cmCTestScriptHandler.cxx

@@ -93,18 +93,18 @@ void cmCTestScriptHandler::Initialize()
   this->EmptyBinDir = false;
   this->EmptyBinDir = false;
   this->EmptyBinDirOnce = false;
   this->EmptyBinDirOnce = false;
 
 
-  this->SourceDir = "";
-  this->BinaryDir = "";
-  this->BackupSourceDir = "";
-  this->BackupBinaryDir = "";
-  this->CTestRoot = "";
-  this->CVSCheckOut = "";
-  this->CTestCmd = "";
-  this->UpdateCmd = "";
-  this->CTestEnv = "";
-  this->InitialCache = "";
-  this->CMakeCmd = "";
-  this->CMOutFile = "";
+  this->SourceDir.clear();
+  this->BinaryDir.clear();
+  this->BackupSourceDir.clear();
+  this->BackupBinaryDir.clear();
+  this->CTestRoot.clear();
+  this->CVSCheckOut.clear();
+  this->CTestCmd.clear();
+  this->UpdateCmd.clear();
+  this->CTestEnv.clear();
+  this->InitialCache.clear();
+  this->CMakeCmd.clear();
+  this->CMOutFile.clear();
   this->ExtraUpdates.clear();
   this->ExtraUpdates.clear();
 
 
   this->MinimumInterval = 20 * 60;
   this->MinimumInterval = 20 * 60;
@@ -593,7 +593,7 @@ int cmCTestScriptHandler::CheckOutSourceDir()
   if (!cmSystemTools::FileExists(this->SourceDir.c_str()) &&
   if (!cmSystemTools::FileExists(this->SourceDir.c_str()) &&
       !this->CVSCheckOut.empty()) {
       !this->CVSCheckOut.empty()) {
     // we must now checkout the src dir
     // we must now checkout the src dir
-    output = "";
+    output.clear();
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                "Run cvs: " << this->CVSCheckOut << std::endl);
                "Run cvs: " << this->CVSCheckOut << std::endl);
     res = cmSystemTools::RunSingleCommand(
     res = cmSystemTools::RunSingleCommand(
@@ -659,7 +659,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
       std::string fullCommand = command;
       std::string fullCommand = command;
       fullCommand += " update ";
       fullCommand += " update ";
       fullCommand += cvsArgs[1];
       fullCommand += cvsArgs[1];
-      output = "";
+      output.clear();
       retVal = 0;
       retVal = 0;
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                  "Run Update: " << fullCommand << std::endl);
                  "Run Update: " << fullCommand << std::endl);
@@ -762,7 +762,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
     command = this->CMakeCmd;
     command = this->CMakeCmd;
     command += " \"";
     command += " \"";
     command += this->SourceDir;
     command += this->SourceDir;
-    output = "";
+    output.clear();
     command += "\"";
     command += "\"";
     retVal = 0;
     retVal = 0;
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -802,7 +802,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
   // for each variable/argument do a putenv
   // for each variable/argument do a putenv
   for (std::string const& ctestCommand : ctestCommands) {
   for (std::string const& ctestCommand : ctestCommands) {
     command = ctestCommand;
     command = ctestCommand;
-    output = "";
+    output.clear();
     retVal = 0;
     retVal = 0;
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                "Run ctest command: " << command << std::endl);
                "Run ctest command: " << command << std::endl);

+ 3 - 3
Source/CTest/cmCTestSubmitHandler.cxx

@@ -140,10 +140,10 @@ void cmCTestSubmitHandler::Initialize()
   this->HasWarnings = false;
   this->HasWarnings = false;
   this->HasErrors = false;
   this->HasErrors = false;
   this->Superclass::Initialize();
   this->Superclass::Initialize();
-  this->HTTPProxy = "";
+  this->HTTPProxy.clear();
   this->HTTPProxyType = 0;
   this->HTTPProxyType = 0;
-  this->HTTPProxyAuth = "";
-  this->FTPProxy = "";
+  this->HTTPProxyAuth.clear();
+  this->FTPProxy.clear();
   this->FTPProxyType = 0;
   this->FTPProxyType = 0;
   this->LogFile = nullptr;
   this->LogFile = nullptr;
   this->Files.clear();
   this->Files.clear();

+ 7 - 7
Source/CTest/cmCTestTestHandler.cxx

@@ -351,8 +351,8 @@ void cmCTestTestHandler::Initialize()
   this->TestResults.clear();
   this->TestResults.clear();
 
 
   this->CustomTestsIgnore.clear();
   this->CustomTestsIgnore.clear();
-  this->StartTest = "";
-  this->EndTest = "";
+  this->StartTest.clear();
+  this->EndTest.clear();
 
 
   this->CustomPreTest.clear();
   this->CustomPreTest.clear();
   this->CustomPostTest.clear();
   this->CustomPostTest.clear();
@@ -368,13 +368,13 @@ void cmCTestTestHandler::Initialize()
   this->UseExcludeRegExpFirst = false;
   this->UseExcludeRegExpFirst = false;
   this->IncludeLabelRegularExpression = "";
   this->IncludeLabelRegularExpression = "";
   this->ExcludeLabelRegularExpression = "";
   this->ExcludeLabelRegularExpression = "";
-  this->IncludeRegExp = "";
-  this->ExcludeRegExp = "";
+  this->IncludeRegExp.clear();
+  this->ExcludeRegExp.clear();
   this->ExcludeFixtureRegExp.clear();
   this->ExcludeFixtureRegExp.clear();
   this->ExcludeFixtureSetupRegExp.clear();
   this->ExcludeFixtureSetupRegExp.clear();
   this->ExcludeFixtureCleanupRegExp.clear();
   this->ExcludeFixtureCleanupRegExp.clear();
 
 
-  TestsToRunString = "";
+  TestsToRunString.clear();
   this->UseUnion = false;
   this->UseUnion = false;
   this->TestList.clear();
   this->TestList.clear();
 }
 }
@@ -1595,9 +1595,9 @@ std::string cmCTestTestHandler::FindExecutable(
   // if everything else failed, check the users path, but only if a full path
   // if everything else failed, check the users path, but only if a full path
   // wasn't specified
   // wasn't specified
   if (fullPath.empty() && filepath.empty()) {
   if (fullPath.empty() && filepath.empty()) {
-    std::string path = cmSystemTools::FindProgram(filename.c_str());
+    std::string const path = cmSystemTools::FindProgram(filename.c_str());
     if (path != "") {
     if (path != "") {
-      resultingConfig = "";
+      resultingConfig.clear();
       return path;
       return path;
     }
     }
   }
   }

+ 1 - 1
Source/CTest/cmCTestUpdateHandler.cxx

@@ -39,7 +39,7 @@ cmCTestUpdateHandler::cmCTestUpdateHandler()
 void cmCTestUpdateHandler::Initialize()
 void cmCTestUpdateHandler::Initialize()
 {
 {
   this->Superclass::Initialize();
   this->Superclass::Initialize();
-  this->UpdateCommand = "";
+  this->UpdateCommand.clear();
   this->UpdateType = e_CVS;
   this->UpdateType = e_CVS;
 }
 }
 
 

+ 3 - 3
Source/CTest/cmParseCacheCoverage.cxx

@@ -146,7 +146,7 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
         cmCTestLog(this->CTest, ERROR_MESSAGE,
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Could not find mumps file for routine: " << routine
                    "Could not find mumps file for routine: " << routine
                                                              << "\n");
                                                              << "\n");
-        filepath = "";
+        filepath.clear();
         continue; // move to next line
         continue; // move to next line
       }
       }
     }
     }
@@ -154,8 +154,8 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
     else {
     else {
       // Totals in arg 0 marks the end of a routine
       // Totals in arg 0 marks the end of a routine
       if (separateLine[0].substr(0, 6) == "Totals") {
       if (separateLine[0].substr(0, 6) == "Totals") {
-        routine = ""; // at the end of this routine
-        filepath = "";
+        routine.clear(); // at the end of this routine
+        filepath.clear();
         continue; // move to next line
         continue; // move to next line
       }
       }
     }
     }

+ 2 - 2
Source/CTest/cmParseCoberturaCoverage.cxx

@@ -21,7 +21,7 @@ public:
     this->SkipThisClass = false;
     this->SkipThisClass = false;
     this->FilePaths.push_back(this->Coverage.SourceDir);
     this->FilePaths.push_back(this->Coverage.SourceDir);
     this->FilePaths.push_back(this->Coverage.BinaryDir);
     this->FilePaths.push_back(this->Coverage.BinaryDir);
-    this->CurFileName = "";
+    this->CurFileName.clear();
   }
   }
 
 
   ~XMLParser() override {}
   ~XMLParser() override {}
@@ -67,7 +67,7 @@ protected:
                                               << std::endl,
                                               << std::endl,
                              this->Coverage.Quiet);
                              this->Coverage.Quiet);
           std::string filename = atts[tagCount + 1];
           std::string filename = atts[tagCount + 1];
-          this->CurFileName = "";
+          this->CurFileName.clear();
 
 
           // Check if this is an absolute path that falls within our
           // Check if this is an absolute path that falls within our
           // source or binary directories.
           // source or binary directories.

+ 3 - 3
Source/CTest/cmParseGTMCoverage.cxx

@@ -182,7 +182,7 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
       // save the argument into the argument vector
       // save the argument into the argument vector
       args.push_back(arg);
       args.push_back(arg);
       // start on a new argument
       // start on a new argument
-      arg = "";
+      arg.clear();
       // if we are at the end of the ), then finish while loop
       // if we are at the end of the ), then finish while loop
       if (cur == ')') {
       if (cur == ')') {
         done = true;
         done = true;
@@ -233,8 +233,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
     // To avoid double counting of line 0 of each entry point,
     // To avoid double counting of line 0 of each entry point,
     // Don't count the lines that do not give an explicit line
     // Don't count the lines that do not give an explicit line
     // number.
     // number.
-    routine = "";
-    function = "";
+    routine.clear();
+    function.clear();
   } else {
   } else {
     // this is the format for this line
     // this is the format for this line
     // ^COVERAGE("%RSEL","SRC",count)
     // ^COVERAGE("%RSEL","SRC",count)

+ 4 - 4
Source/CTest/cmParseJacocoCoverage.cxx

@@ -18,9 +18,9 @@ public:
     : CTest(ctest)
     : CTest(ctest)
     , Coverage(cont)
     , Coverage(cont)
   {
   {
-    this->FilePath = "";
-    this->PackagePath = "";
-    this->PackageName = "";
+    this->FilePath.clear();
+    this->PackagePath.clear();
+    this->PackageName.clear();
   }
   }
 
 
   ~XMLParser() override {}
   ~XMLParser() override {}
@@ -32,7 +32,7 @@ protected:
   {
   {
     if (name == "package") {
     if (name == "package") {
       this->PackageName = atts[1];
       this->PackageName = atts[1];
-      this->PackagePath = "";
+      this->PackagePath.clear();
     } else if (name == "sourcefile") {
     } else if (name == "sourcefile") {
       std::string fileName = atts[1];
       std::string fileName = atts[1];
 
 

+ 1 - 1
Source/bindexplib.cxx

@@ -218,7 +218,7 @@ public:
           *    The name of the Function entry points
           *    The name of the Function entry points
           */
           */
           if (pSymbolTable->N.Name.Short != 0) {
           if (pSymbolTable->N.Name.Short != 0) {
-            symbol = "";
+            symbol.clear();
             symbol.insert(0, (const char*)pSymbolTable->N.ShortName, 8);
             symbol.insert(0, (const char*)pSymbolTable->N.ShortName, 8);
           } else {
           } else {
             symbol = stringTable + pSymbolTable->N.Name.Long;
             symbol = stringTable + pSymbolTable->N.Name.Long;

+ 1 - 1
Source/cmBuildNameCommand.cxx

@@ -36,7 +36,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
 
 
   std::string buildname = "WinNT";
   std::string buildname = "WinNT";
   if (this->Makefile->GetDefinition("UNIX")) {
   if (this->Makefile->GetDefinition("UNIX")) {
-    buildname = "";
+    buildname.clear();
     cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname);
     cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname);
     if (!buildname.empty()) {
     if (!buildname.empty()) {
       std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";
       std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";

+ 7 - 7
Source/cmCTest.cxx

@@ -281,9 +281,9 @@ cmCTest::cmCTest()
   this->GlobalTimeout = 0;
   this->GlobalTimeout = 0;
   this->LastStopTimeout = 24 * 60 * 60;
   this->LastStopTimeout = 24 * 60 * 60;
   this->CompressXMLFiles = false;
   this->CompressXMLFiles = false;
-  this->CTestConfigFile = "";
-  this->ScheduleType = "";
-  this->StopTime = "";
+  this->CTestConfigFile.clear();
+  this->ScheduleType.clear();
+  this->StopTime.clear();
   this->NextDayStopTime = false;
   this->NextDayStopTime = false;
   this->OutputLogFile = nullptr;
   this->OutputLogFile = nullptr;
   this->OutputLogFileLastTag = -1;
   this->OutputLogFileLastTag = -1;
@@ -477,7 +477,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
                &min);
                &min);
         if (year != lctime->tm_year + 1900 || mon != lctime->tm_mon + 1 ||
         if (year != lctime->tm_year + 1900 || mon != lctime->tm_mon + 1 ||
             day != lctime->tm_mday) {
             day != lctime->tm_mday) {
-          tag = "";
+          tag.clear();
         }
         }
         std::string tagmode;
         std::string tagmode;
         if (cmSystemTools::GetLineFromStream(tfin, tagmode)) {
         if (cmSystemTools::GetLineFromStream(tfin, tagmode)) {
@@ -975,7 +975,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
   }
   }
   argv.push_back(nullptr);
   argv.push_back(nullptr);
 
 
-  output = "";
+  output.clear();
   cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
   cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
   for (char const* arg : argv) {
   for (char const* arg : argv) {
     if (!arg) {
     if (!arg) {
@@ -1147,7 +1147,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
   }
   }
   std::vector<char> tempOutput;
   std::vector<char> tempOutput;
   if (output) {
   if (output) {
-    *output = "";
+    output->clear();
   }
   }
 
 
   CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
   CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
@@ -2513,7 +2513,7 @@ const char* cmCTest::GetSpecificTrack()
 void cmCTest::SetSpecificTrack(const char* track)
 void cmCTest::SetSpecificTrack(const char* track)
 {
 {
   if (!track) {
   if (!track) {
-    this->SpecificTrack = "";
+    this->SpecificTrack.clear();
     return;
     return;
   }
   }
   this->SpecificTrack = track;
   this->SpecificTrack = track;

+ 2 - 2
Source/cmCacheManager.cxx

@@ -480,7 +480,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
     e.Value = value;
     e.Value = value;
     e.Initialized = true;
     e.Initialized = true;
   } else {
   } else {
-    e.Value = "";
+    e.Value.clear();
   }
   }
   e.Type = type;
   e.Type = type;
   // make sure we only use unix style paths
   // make sure we only use unix style paths
@@ -543,7 +543,7 @@ void cmCacheManager::CacheIterator::SetValue(const char* value)
     entry->Value = value;
     entry->Value = value;
     entry->Initialized = true;
     entry->Initialized = true;
   } else {
   } else {
-    entry->Value = "";
+    entry->Value.clear();
   }
   }
 }
 }
 
 

+ 2 - 2
Source/cmCommandArgumentParserHelper.cxx

@@ -234,7 +234,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
   this->InputBufferPos = 0;
   this->InputBufferPos = 0;
   this->CurrentLine = 0;
   this->CurrentLine = 0;
 
 
-  this->Result = "";
+  this->Result.clear();
 
 
   yyscan_t yyscanner;
   yyscan_t yyscanner;
   cmCommandArgument_yylex_init(&yyscanner);
   cmCommandArgument_yylex_init(&yyscanner);
@@ -298,7 +298,7 @@ void cmCommandArgumentParserHelper::SetMakefile(const cmMakefile* mf)
 void cmCommandArgumentParserHelper::SetResult(const char* value)
 void cmCommandArgumentParserHelper::SetResult(const char* value)
 {
 {
   if (!value) {
   if (!value) {
-    this->Result = "";
+    this->Result.clear();
     return;
     return;
   }
   }
   this->Result = value;
   this->Result = value;

+ 1 - 1
Source/cmCommandArgumentsHelper.cxx

@@ -133,7 +133,7 @@ bool cmCAString::DoConsume(const std::string& arg, unsigned int index)
 
 
 void cmCAString::DoReset()
 void cmCAString::DoReset()
 {
 {
-  this->String = "";
+  this->String.clear();
 }
 }
 
 
 cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, const char* key,
 cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, const char* key,

+ 1 - 1
Source/cmComputeLinkInformation.cxx

@@ -1483,7 +1483,7 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
       if (!line.empty() && (line.size() + i.size() + 2) > max_size) {
       if (!line.empty() && (line.size() + i.size() + 2) > max_size) {
         os << line << "\n";
         os << line << "\n";
         sep = "  ";
         sep = "  ";
-        line = "";
+        line.clear();
       }
       }
       line += sep;
       line += sep;
       line += i;
       line += i;

+ 1 - 1
Source/cmConditionEvaluator.cxx

@@ -83,7 +83,7 @@ bool cmConditionEvaluator::IsTrue(
   const std::vector<cmExpandedCommandArgument>& args, std::string& errorString,
   const std::vector<cmExpandedCommandArgument>& args, std::string& errorString,
   cmake::MessageType& status)
   cmake::MessageType& status)
 {
 {
-  errorString = "";
+  errorString.clear();
 
 
   // handle empty invocation
   // handle empty invocation
   if (args.empty()) {
   if (args.empty()) {

+ 3 - 3
Source/cmCoreTryCompile.cxx

@@ -71,7 +71,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
                                      bool isTryRun)
                                      bool isTryRun)
 {
 {
   this->BinaryDirectory = argv[1];
   this->BinaryDirectory = argv[1];
-  this->OutputFile = "";
+  this->OutputFile.clear();
   // which signature were we called with ?
   // which signature were we called with ?
   this->SrcFileSignature = true;
   this->SrcFileSignature = true;
 
 
@@ -919,8 +919,8 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
 void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
 void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
                                       cmStateEnums::TargetType targetType)
                                       cmStateEnums::TargetType targetType)
 {
 {
-  this->FindErrorMessage = "";
-  this->OutputFile = "";
+  this->FindErrorMessage.clear();
+  this->OutputFile.clear();
   std::string tmpOutputFile = "/";
   std::string tmpOutputFile = "/";
   if (targetType == cmStateEnums::EXECUTABLE) {
   if (targetType == cmStateEnums::EXECUTABLE) {
     tmpOutputFile += targetName;
     tmpOutputFile += targetName;

+ 1 - 1
Source/cmDependsFortran.cxx

@@ -219,7 +219,7 @@ void cmDependsFortran::LocateModules()
                                           info.Provides.end());
                                           info.Provides.end());
 
 
     for (std::string const& r : info.Requires) {
     for (std::string const& r : info.Requires) {
-      this->Internal->TargetRequires[r] = "";
+      this->Internal->TargetRequires[r].clear();
     }
     }
   }
   }
 
 

+ 6 - 6
Source/cmExportFileGenerator.cxx

@@ -137,7 +137,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
   if (input) {
   if (input) {
     if (!*input) {
     if (!*input) {
       // Set to empty
       // Set to empty
-      properties[outputName] = "";
+      properties[outputName].clear();
       return;
       return;
     }
     }
 
 
@@ -313,7 +313,7 @@ static void prefixItems(std::string& exportDirs)
 {
 {
   std::vector<std::string> entries;
   std::vector<std::string> entries;
   cmGeneratorExpression::Split(exportDirs, entries);
   cmGeneratorExpression::Split(exportDirs, entries);
-  exportDirs = "";
+  exportDirs.clear();
   const char* sep = "";
   const char* sep = "";
   for (std::string const& e : entries) {
   for (std::string const& e : entries) {
     exportDirs += sep;
     exportDirs += sep;
@@ -341,7 +341,7 @@ void cmExportFileGenerator::PopulateSourcesInterface(
   }
   }
 
 
   if (!*input) {
   if (!*input) {
-    properties[propName] = "";
+    properties[propName].clear();
     return;
     return;
   }
   }
 
 
@@ -394,7 +394,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
   }
   }
   if ((input && !*input) && exportDirs.empty()) {
   if ((input && !*input) && exportDirs.empty()) {
     // Set to empty
     // Set to empty
-    properties[propName] = "";
+    properties[propName].clear();
     return;
     return;
   }
   }
 
 
@@ -565,7 +565,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
   cmGeneratorExpression::Split(input, parts);
   cmGeneratorExpression::Split(input, parts);
 
 
   std::string sep;
   std::string sep;
-  input = "";
+  input.clear();
   for (std::string& li : parts) {
   for (std::string& li : parts) {
     if (cmGeneratorExpression::Find(li) == std::string::npos) {
     if (cmGeneratorExpression::Find(li) == std::string::npos) {
       this->AddTargetNamespace(li, target, missingTargets);
       this->AddTargetNamespace(li, target, missingTargets);
@@ -713,7 +713,7 @@ void cmExportFileGenerator::SetImportLinkInterface(
   }
   }
 
 
   if (!*propContent) {
   if (!*propContent) {
-    properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = "";
+    properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix].clear();
     return;
     return;
   }
   }
 
 

+ 2 - 2
Source/cmExtraEclipseCDT4Generator.cxx

@@ -222,7 +222,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
   std::string valueToUse;
   std::string valueToUse;
   if (!envVarSet && cacheValue == nullptr) {
   if (!envVarSet && cacheValue == nullptr) {
     // nothing known, do nothing
     // nothing known, do nothing
-    valueToUse = "";
+    valueToUse.clear();
   } else if (envVarSet && cacheValue == nullptr) {
   } else if (envVarSet && cacheValue == nullptr) {
     // The variable is in the env, but not in the cache. Use it and put it
     // The variable is in the env, but not in the cache. Use it and put it
     // in the cache
     // in the cache
@@ -891,7 +891,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
     std::string subdir = lgen->ConvertToRelativePath(
     std::string subdir = lgen->ConvertToRelativePath(
       this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory());
       this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory());
     if (subdir == ".") {
     if (subdir == ".") {
-      subdir = "";
+      subdir.clear();
     }
     }
 
 
     for (cmGeneratorTarget* target : targets) {
     for (cmGeneratorTarget* target : targets) {

+ 1 - 1
Source/cmExtraSublimeTextGenerator.cxx

@@ -274,7 +274,7 @@ void cmExtraSublimeTextGenerator::AppendTarget(
         if (flagRegex.end() < workString.size()) {
         if (flagRegex.end() < workString.size()) {
           workString = workString.substr(flagRegex.end());
           workString = workString.substr(flagRegex.end());
         } else {
         } else {
-          workString = "";
+          workString.clear();
         }
         }
       }
       }
     }
     }

+ 7 - 7
Source/cmFileCommand.cxx

@@ -656,7 +656,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
           c = current_str[current_str.size() - 1 - j];
           c = current_str[current_str.size() - 1 - j];
           fin.putback(static_cast<char>(c));
           fin.putback(static_cast<char>(c));
         }
         }
-        current_str = "";
+        current_str.clear();
       }
       }
     }
     }
 
 
@@ -667,14 +667,14 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
       if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
       if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
         output_size += static_cast<int>(s.size()) + 1;
         output_size += static_cast<int>(s.size()) + 1;
         if (limit_output >= 0 && output_size >= limit_output) {
         if (limit_output >= 0 && output_size >= limit_output) {
-          s = "";
+          s.clear();
           break;
           break;
         }
         }
         strings.push_back(s);
         strings.push_back(s);
       }
       }
 
 
       // Reset the string to empty.
       // Reset the string to empty.
-      s = "";
+      s.clear();
     } else if (current_str.empty()) {
     } else if (current_str.empty()) {
       // A non-string character has been found.  Check if the current
       // A non-string character has been found.  Check if the current
       // string matches the requirements.  We require that the length
       // string matches the requirements.  We require that the length
@@ -683,14 +683,14 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
           (!have_regex || regex.find(s.c_str()))) {
           (!have_regex || regex.find(s.c_str()))) {
         output_size += static_cast<int>(s.size()) + 1;
         output_size += static_cast<int>(s.size()) + 1;
         if (limit_output >= 0 && output_size >= limit_output) {
         if (limit_output >= 0 && output_size >= limit_output) {
-          s = "";
+          s.clear();
           break;
           break;
         }
         }
         strings.push_back(s);
         strings.push_back(s);
       }
       }
 
 
       // Reset the string to empty.
       // Reset the string to empty.
-      s = "";
+      s.clear();
     } else {
     } else {
       s += current_str;
       s += current_str;
     }
     }
@@ -700,12 +700,12 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
       if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
       if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
         output_size += static_cast<int>(s.size()) + 1;
         output_size += static_cast<int>(s.size()) + 1;
         if (limit_output >= 0 && output_size >= limit_output) {
         if (limit_output >= 0 && output_size >= limit_output) {
-          s = "";
+          s.clear();
           break;
           break;
         }
         }
         strings.push_back(s);
         strings.push_back(s);
       }
       }
-      s = "";
+      s.clear();
     }
     }
   }
   }
 
 

+ 1 - 1
Source/cmFileLock.cxx

@@ -42,7 +42,7 @@ cmFileLockResult cmFileLock::Lock(const std::string& filename,
   }
   }
 
 
   if (!result.IsOk()) {
   if (!result.IsOk()) {
-    this->Filename = "";
+    this->Filename.clear();
   }
   }
 
 
   return result;
   return result;

+ 1 - 1
Source/cmFindPathCommand.cxx

@@ -85,7 +85,7 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string const& file,
     // if the framework has a path in it then just use the filename
     // if the framework has a path in it then just use the filename
     if (frameWorkName.find('/') != std::string::npos) {
     if (frameWorkName.find('/') != std::string::npos) {
       fileName = file;
       fileName = file;
-      frameWorkName = "";
+      frameWorkName.clear();
     }
     }
     if (!frameWorkName.empty()) {
     if (!frameWorkName.empty()) {
       std::string fpath = dir;
       std::string fpath = dir;

+ 1 - 1
Source/cmFortranParserImpl.cxx

@@ -126,7 +126,7 @@ int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
 
 
 void cmFortranParser_StringStart(cmFortranParser* parser)
 void cmFortranParser_StringStart(cmFortranParser* parser)
 {
 {
-  parser->TokenString = "";
+  parser->TokenString.clear();
 }
 }
 
 
 const char* cmFortranParser_StringEnd(cmFortranParser* parser)
 const char* cmFortranParser_StringEnd(cmFortranParser* parser)

+ 3 - 3
Source/cmGeneratorExpression.cxx

@@ -68,7 +68,7 @@ const char* cmCompiledGeneratorExpression::EvaluateWithContext(
     return this->Input.c_str();
     return this->Input.c_str();
   }
   }
 
 
-  this->Output = "";
+  this->Output.clear();
 
 
   std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
   std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
     this->Evaluators.begin();
     this->Evaluators.begin();
@@ -81,7 +81,7 @@ const char* cmCompiledGeneratorExpression::EvaluateWithContext(
     this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(),
     this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(),
                                       context.SeenTargetProperties.end());
                                       context.SeenTargetProperties.end());
     if (context.HadError) {
     if (context.HadError) {
-      this->Output = "";
+      this->Output.clear();
       break;
       break;
     }
     }
   }
   }
@@ -296,7 +296,7 @@ void cmGeneratorExpression::Split(const std::string& input,
       std::string::size_type startPos = input.rfind(';', pos);
       std::string::size_type startPos = input.rfind(';', pos);
       if (startPos == std::string::npos) {
       if (startPos == std::string::npos) {
         preGenex = part;
         preGenex = part;
-        part = "";
+        part.clear();
       } else if (startPos != pos - 1 && startPos >= lastPos) {
       } else if (startPos != pos - 1 && startPos >= lastPos) {
         part = input.substr(lastPos, startPos - lastPos);
         part = input.substr(lastPos, startPos - lastPos);
         preGenex = input.substr(startPos + 1, pos - startPos - 1);
         preGenex = input.substr(startPos + 1, pos - startPos - 1);

+ 9 - 9
Source/cmGeneratorTarget.cxx

@@ -3023,7 +3023,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
     impName =
     impName =
       this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
       this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
   } else {
   } else {
-    impName = "";
+    impName.clear();
   }
   }
 
 
   // The program database file name.
   // The program database file name.
@@ -3126,9 +3126,9 @@ void cmGeneratorTarget::GetFullNameInternal(
       this->GetType() != cmStateEnums::SHARED_LIBRARY &&
       this->GetType() != cmStateEnums::SHARED_LIBRARY &&
       this->GetType() != cmStateEnums::MODULE_LIBRARY &&
       this->GetType() != cmStateEnums::MODULE_LIBRARY &&
       this->GetType() != cmStateEnums::EXECUTABLE) {
       this->GetType() != cmStateEnums::EXECUTABLE) {
-    outPrefix = "";
+    outPrefix.clear();
     outBase = this->GetName();
     outBase = this->GetName();
-    outSuffix = "";
+    outSuffix.clear();
     return;
     return;
   }
   }
 
 
@@ -3139,9 +3139,9 @@ void cmGeneratorTarget::GetFullNameInternal(
   // does not support import libraries.
   // does not support import libraries.
   if (isImportedLibraryArtifact &&
   if (isImportedLibraryArtifact &&
       !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
       !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
-    outPrefix = "";
-    outBase = "";
-    outSuffix = "";
+    outPrefix.clear();
+    outBase.clear();
+    outSuffix.clear();
     return;
     return;
   }
   }
 
 
@@ -4488,7 +4488,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
     out = cge->Evaluate(this->LocalGenerator, config);
     out = cge->Evaluate(this->LocalGenerator, config);
 
 
     // Skip per-configuration subdirectory.
     // Skip per-configuration subdirectory.
-    conf = "";
+    conf.clear();
   } else if (const char* outdir = this->GetProperty(propertyName)) {
   } else if (const char* outdir = this->GetProperty(propertyName)) {
     // Use the user-specified output directory.
     // Use the user-specified output directory.
     cmGeneratorExpression ge;
     cmGeneratorExpression ge;
@@ -4498,7 +4498,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
     // Skip per-configuration subdirectory if the value contained a
     // Skip per-configuration subdirectory if the value contained a
     // generator expression.
     // generator expression.
     if (out != outdir) {
     if (out != outdir) {
-      conf = "";
+      conf.clear();
     }
     }
   } else if (this->GetType() == cmStateEnums::EXECUTABLE) {
   } else if (this->GetType() == cmStateEnums::EXECUTABLE) {
     // Lookup the output path for executables.
     // Lookup the output path for executables.
@@ -4564,7 +4564,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
     out = config_outdir;
     out = config_outdir;
 
 
     // Skip per-configuration subdirectory.
     // Skip per-configuration subdirectory.
-    conf = "";
+    conf.clear();
   } else if (const char* outdir = this->GetProperty(propertyName)) {
   } else if (const char* outdir = this->GetProperty(propertyName)) {
     // Use the user-specified output directory.
     // Use the user-specified output directory.
     out = outdir;
     out = outdir;

+ 2 - 2
Source/cmGlobalVisualStudio10Generator.cxx

@@ -407,14 +407,14 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
 bool cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(
 bool cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(
   std::string& toolset) const
   std::string& toolset) const
 {
 {
-  toolset = "";
+  toolset.clear();
   return false;
   return false;
 }
 }
 
 
 bool cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(
 bool cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(
   std::string& toolset) const
   std::string& toolset) const
 {
 {
-  toolset = "";
+  toolset.clear();
   return false;
   return false;
 }
 }
 
 

+ 2 - 2
Source/cmGlobalVisualStudio7Generator.cxx

@@ -403,7 +403,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         std::string dir = lg->GetCurrentBinaryDirectory();
         std::string dir = lg->GetCurrentBinaryDirectory();
         dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
         dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
         if (dir == ".") {
         if (dir == ".") {
-          dir = ""; // msbuild cannot handle ".\" prefix
+          dir.clear(); // msbuild cannot handle ".\" prefix
         }
         }
         this->WriteProject(fout, vcprojName, dir.c_str(), target);
         this->WriteProject(fout, vcprojName, dir.c_str(), target);
         written = true;
         written = true;
@@ -418,7 +418,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         std::vector<cmsys::String> tokens =
         std::vector<cmsys::String> tokens =
           cmSystemTools::SplitString(targetFolder, '/', false);
           cmSystemTools::SplitString(targetFolder, '/', false);
 
 
-        std::string cumulativePath = "";
+        std::string cumulativePath;
 
 
         for (std::vector<cmsys::String>::iterator iter = tokens.begin();
         for (std::vector<cmsys::String>::iterator iter = tokens.begin();
              iter != tokens.end(); ++iter) {
              iter != tokens.end(); ++iter) {

+ 1 - 1
Source/cmGlobalVisualStudio8Generator.cxx

@@ -301,7 +301,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
     // file as the main dependency because it would get
     // file as the main dependency because it would get
     // overwritten by the CreateVCProjBuildRule.
     // overwritten by the CreateVCProjBuildRule.
     // (this could be avoided with per-target source files)
     // (this could be avoided with per-target source files)
-    std::string no_main_dependency = "";
+    std::string no_main_dependency;
     std::vector<std::string> no_byproducts;
     std::vector<std::string> no_byproducts;
     if (cmSourceFile* file = mf->AddCustomCommandToOutput(
     if (cmSourceFile* file = mf->AddCustomCommandToOutput(
           stamps, no_byproducts, listFiles, no_main_dependency, commandLines,
           stamps, no_byproducts, listFiles, no_main_dependency, commandLines,

+ 1 - 1
Source/cmIncludeDirectoryCommand.cxx

@@ -116,7 +116,7 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string& inc)
   if ((b != std::string::npos) && (e != std::string::npos)) {
   if ((b != std::string::npos) && (e != std::string::npos)) {
     inc.assign(inc, b, 1 + e - b); // copy the remaining substring
     inc.assign(inc, b, 1 + e - b); // copy the remaining substring
   } else {
   } else {
-    inc = "";
+    inc.clear();
     return;
     return;
   }
   }
 
 

+ 1 - 1
Source/cmInstallCommandArguments.cxx

@@ -153,7 +153,7 @@ void cmInstallCommandArguments::Parse(const std::vector<std::string>* args,
 
 
 bool cmInstallCommandArguments::CheckPermissions()
 bool cmInstallCommandArguments::CheckPermissions()
 {
 {
-  this->PermissionsString = "";
+  this->PermissionsString.clear();
   for (std::string const& perm : this->Permissions.GetVector()) {
   for (std::string const& perm : this->Permissions.GetVector()) {
     if (!this->CheckPermissions(perm, this->PermissionsString)) {
     if (!this->CheckPermissions(perm, this->PermissionsString)) {
       return false;
       return false;

+ 1 - 1
Source/cmLoadCacheCommand.cxx

@@ -124,7 +124,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
         if (i != end) {
         if (i != end) {
           // Completed a line.
           // Completed a line.
           this->CheckLine(line.c_str());
           this->CheckLine(line.c_str());
-          line = "";
+          line.clear();
 
 
           // Skip the newline character.
           // Skip the newline character.
           ++i;
           ++i;

+ 1 - 1
Source/cmLocalCommonGenerator.cxx

@@ -22,7 +22,7 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
     this->ConfigName = config;
     this->ConfigName = config;
   } else {
   } else {
     // No configuration type given.
     // No configuration type given.
-    this->ConfigName = "";
+    this->ConfigName.clear();
   }
   }
 }
 }
 
 

+ 1 - 1
Source/cmLocalNinjaGenerator.cxx

@@ -55,7 +55,7 @@ void cmLocalNinjaGenerator::Generate()
   this->HomeRelativeOutputPath = this->ConvertToRelativePath(
   this->HomeRelativeOutputPath = this->ConvertToRelativePath(
     this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
     this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
   if (this->HomeRelativeOutputPath == ".") {
   if (this->HomeRelativeOutputPath == ".") {
-    this->HomeRelativeOutputPath = "";
+    this->HomeRelativeOutputPath.clear();
   }
   }
 
 
   this->WriteProcessedMakefile(this->GetBuildFileStream());
   this->WriteProcessedMakefile(this->GetBuildFileStream());

+ 2 - 2
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -144,7 +144,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
   this->HomeRelativeOutputPath = this->MaybeConvertToRelativePath(
   this->HomeRelativeOutputPath = this->MaybeConvertToRelativePath(
     this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
     this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
   if (this->HomeRelativeOutputPath == ".") {
   if (this->HomeRelativeOutputPath == ".") {
-    this->HomeRelativeOutputPath = "";
+    this->HomeRelativeOutputPath.clear();
   }
   }
   if (!this->HomeRelativeOutputPath.empty()) {
   if (!this->HomeRelativeOutputPath.empty()) {
     this->HomeRelativeOutputPath += "/";
     this->HomeRelativeOutputPath += "/";
@@ -1163,7 +1163,7 @@ void cmLocalUnixMakefileGenerator3::AppendEcho(
       }
       }
 
 
       // Reset the line to emtpy.
       // Reset the line to emtpy.
-      line = "";
+      line.clear();
 
 
       // Progress appears only on first line.
       // Progress appears only on first line.
       progress = nullptr;
       progress = nullptr;

+ 2 - 2
Source/cmLocalVisualStudio7Generator.cxx

@@ -121,7 +121,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
       force_command.push_back(".");
       force_command.push_back(".");
       cmCustomCommandLines force_commands;
       cmCustomCommandLines force_commands;
       force_commands.push_back(force_command);
       force_commands.push_back(force_command);
-      std::string no_main_dependency = "";
+      std::string no_main_dependency;
       std::string force = this->GetCurrentBinaryDirectory();
       std::string force = this->GetCurrentBinaryDirectory();
       force += cmake::GetCMakeFilesDirectory();
       force += cmake::GetCMakeFilesDirectory();
       force += "/";
       force += "/";
@@ -2081,7 +2081,7 @@ public:
             this->GUID = atts[i + 1];
             this->GUID = atts[i + 1];
             this->GUID = this->GUID.substr(1, this->GUID.size() - 2);
             this->GUID = this->GUID.substr(1, this->GUID.size() - 2);
           } else {
           } else {
-            this->GUID = "";
+            this->GUID.clear();
           }
           }
           return;
           return;
         }
         }

+ 1 - 1
Source/cmLocalVisualStudioGenerator.cxx

@@ -135,7 +135,7 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
   std::string workingDirectory = ccg.GetWorkingDirectory();
   std::string workingDirectory = ccg.GetWorkingDirectory();
 
 
   // Avoid leading or trailing newlines.
   // Avoid leading or trailing newlines.
-  std::string newline = "";
+  std::string newline;
 
 
   // Line to check for error between commands.
   // Line to check for error between commands.
   std::string check_error = newline_text;
   std::string check_error = newline_text;

+ 4 - 4
Source/cmMakefile.cxx

@@ -1645,7 +1645,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
       nvalue = value ? value : "";
       nvalue = value ? value : "";
 
 
       cmSystemTools::ExpandListArgument(nvalue, files);
       cmSystemTools::ExpandListArgument(nvalue, files);
-      nvalue = "";
+      nvalue.clear();
       for (cc = 0; cc < files.size(); cc++) {
       for (cc = 0; cc < files.size(); cc++) {
         if (!cmSystemTools::IsOff(files[cc].c_str())) {
         if (!cmSystemTools::IsOff(files[cc].c_str())) {
           files[cc] = cmSystemTools::CollapseFullPath(files[cc]);
           files[cc] = cmSystemTools::CollapseFullPath(files[cc]);
@@ -2448,7 +2448,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
     std::string input = source;
     std::string input = source;
 
 
     // Start with empty output.
     // Start with empty output.
-    source = "";
+    source.clear();
 
 
     // Look for one @VAR@ at a time.
     // Look for one @VAR@ at a time.
     const char* in = input.c_str();
     const char* in = input.c_str();
@@ -3348,7 +3348,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
   moduleInCMakeRoot += filename;
   moduleInCMakeRoot += filename;
   cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
   cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
   if (!cmSystemTools::FileExists(moduleInCMakeRoot.c_str())) {
   if (!cmSystemTools::FileExists(moduleInCMakeRoot.c_str())) {
-    moduleInCMakeRoot = "";
+    moduleInCMakeRoot.clear();
   }
   }
 
 
   // Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
   // Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
@@ -3532,7 +3532,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
     std::string inLine;
     std::string inLine;
     std::string outLine;
     std::string outLine;
     while (cmSystemTools::GetLineFromStream(fin, inLine)) {
     while (cmSystemTools::GetLineFromStream(fin, inLine)) {
-      outLine = "";
+      outLine.clear();
       this->ConfigureString(inLine, outLine, atOnly, escapeQuotes);
       this->ConfigureString(inLine, outLine, atOnly, escapeQuotes);
       fout << outLine << newLineCharacters;
       fout << outLine << newLineCharacters;
     }
     }

+ 1 - 1
Source/cmMakefileTargetGenerator.cxx

@@ -1261,7 +1261,7 @@ public:
         (this->CurrentString.length() + 1 + this->NextObject.length() >
         (this->CurrentString.length() + 1 + this->NextObject.length() >
          this->LengthLimit)) {
          this->LengthLimit)) {
       this->Strings.push_back(this->CurrentString);
       this->Strings.push_back(this->CurrentString);
-      this->CurrentString = "";
+      this->CurrentString.clear();
       this->Space = "";
       this->Space = "";
     }
     }
 
 

+ 3 - 3
Source/cmNinjaNormalTargetGenerator.cxx

@@ -667,7 +667,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
     std::string t = vars["ARCH_FLAGS"];
     std::string t = vars["ARCH_FLAGS"];
     localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName);
     localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName);
     vars["ARCH_FLAGS"] = t;
     vars["ARCH_FLAGS"] = t;
-    t = "";
+    t.clear();
     localGen.AddLanguageFlagsForLinking(t, &genTarget, cudaLinkLanguage,
     localGen.AddLanguageFlagsForLinking(t, &genTarget, cudaLinkLanguage,
                                         cfgName);
                                         cfgName);
     vars["LANGUAGE_COMPILE_FLAGS"] = t;
     vars["LANGUAGE_COMPILE_FLAGS"] = t;
@@ -884,7 +884,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     std::string t = vars["ARCH_FLAGS"];
     std::string t = vars["ARCH_FLAGS"];
     localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName);
     localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName);
     vars["ARCH_FLAGS"] = t;
     vars["ARCH_FLAGS"] = t;
-    t = "";
+    t.clear();
     t += lwyuFlags;
     t += lwyuFlags;
     localGen.AddLanguageFlagsForLinking(t, &genTarget, TargetLinkLanguage,
     localGen.AddLanguageFlagsForLinking(t, &genTarget, TargetLinkLanguage,
                                         cfgName);
                                         cfgName);
@@ -1070,7 +1070,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
       if (targetOutputReal == soName || targetOutput == soName) {
       if (targetOutputReal == soName || targetOutput == soName) {
         symlinkVars["SONAME"] = soName;
         symlinkVars["SONAME"] = soName;
       } else {
       } else {
-        symlinkVars["SONAME"] = "";
+        symlinkVars["SONAME"].clear();
         symlinks.push_back(soName);
         symlinks.push_back(soName);
       }
       }
       symlinks.push_back(targetOutput);
       symlinks.push_back(targetOutput);

+ 1 - 1
Source/cmNinjaTargetGenerator.cxx

@@ -425,7 +425,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     // The explicit preprocessing step will handle dependency scanning.
     // The explicit preprocessing step will handle dependency scanning.
   } else if (this->NeedDepTypeMSVC(lang)) {
   } else if (this->NeedDepTypeMSVC(lang)) {
     deptype = "msvc";
     deptype = "msvc";
-    depfile = "";
+    depfile.clear();
     flags += " /showIncludes";
     flags += " /showIncludes";
   } else if (mf->IsOn("CMAKE_NINJA_CMCLDEPS_" + lang)) {
   } else if (mf->IsOn("CMAKE_NINJA_CMCLDEPS_" + lang)) {
     // For the MS resource compiler we need cmcldeps, but skip dependencies
     // For the MS resource compiler we need cmcldeps, but skip dependencies

+ 1 - 1
Source/cmOutputRequiredFilesCommand.cxx

@@ -362,7 +362,7 @@ protected:
       } else {
       } else {
         // Destroy the name of the file so that it won't be output as a
         // Destroy the name of the file so that it won't be output as a
         // dependency.
         // dependency.
-        info->FullPath = "";
+        info->FullPath.clear();
       }
       }
     }
     }
   }
   }

+ 2 - 2
Source/cmProcessTools.cxx

@@ -73,11 +73,11 @@ bool cmProcessTools::LineParser::ProcessChunk(const char* first, int length)
 
 
       // Hand this line to the subclass implementation.
       // Hand this line to the subclass implementation.
       if (!this->ProcessLine()) {
       if (!this->ProcessLine()) {
-        this->Line = "";
+        this->Line.clear();
         return false;
         return false;
       }
       }
 
 
-      this->Line = "";
+      this->Line.clear();
     } else if (*c != '\r' || !this->IgnoreCR) {
     } else if (*c != '\r' || !this->IgnoreCR) {
       // Append this character to the line under construction.
       // Append this character to the line under construction.
       this->Line.append(1, *c);
       this->Line.append(1, *c);

+ 3 - 3
Source/cmRST.cxx

@@ -86,7 +86,7 @@ void cmRST::ProcessModule(std::istream& is)
         if (line[0] != '#') {
         if (line[0] != '#') {
           this->ProcessLine(line.substr(0, pos));
           this->ProcessLine(line.substr(0, pos));
         }
         }
-        rst = "";
+        rst.clear();
         this->Reset();
         this->Reset();
         this->OutputLinePending = true;
         this->OutputLinePending = true;
       }
       }
@@ -101,7 +101,7 @@ void cmRST::ProcessModule(std::istream& is)
           this->ProcessLine(line.substr(2));
           this->ProcessLine(line.substr(2));
           continue;
           continue;
         }
         }
-        rst = "";
+        rst.clear();
         this->Reset();
         this->Reset();
         this->OutputLinePending = true;
         this->OutputLinePending = true;
       }
       }
@@ -345,7 +345,7 @@ void cmRST::ProcessDirectiveReplace()
   // Record markup lines as replacement text.
   // Record markup lines as replacement text.
   std::string& replacement = this->Replace[this->ReplaceName];
   std::string& replacement = this->Replace[this->ReplaceName];
   replacement += cmJoin(this->MarkupLines, " ");
   replacement += cmJoin(this->MarkupLines, " ");
-  this->ReplaceName = "";
+  this->ReplaceName.clear();
 }
 }
 
 
 void cmRST::ProcessDirectiveTocTree()
 void cmRST::ProcessDirectiveTocTree()

+ 1 - 1
Source/cmScriptGenerator.cxx

@@ -26,7 +26,7 @@ void cmScriptGenerator::Generate(
   this->ConfigurationName = config;
   this->ConfigurationName = config;
   this->ConfigurationTypes = &configurationTypes;
   this->ConfigurationTypes = &configurationTypes;
   this->GenerateScript(os);
   this->GenerateScript(os);
-  this->ConfigurationName = "";
+  this->ConfigurationName.clear();
   this->ConfigurationTypes = nullptr;
   this->ConfigurationTypes = nullptr;
 }
 }
 
 

+ 1 - 1
Source/cmSearchPath.cxx

@@ -172,7 +172,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths,
   } else if (this->FC->CMakePathName == "LIBRARY") {
   } else if (this->FC->CMakePathName == "LIBRARY") {
     subdir = "lib";
     subdir = "lib";
   } else if (this->FC->CMakePathName == "FRAMEWORK") {
   } else if (this->FC->CMakePathName == "FRAMEWORK") {
-    subdir = ""; // ? what to do for frameworks ?
+    subdir.clear(); // ? what to do for frameworks ?
   }
   }
 
 
   for (std::string const& path : paths) {
   for (std::string const& path : paths) {

+ 2 - 2
Source/cmStateDirectory.cxx

@@ -80,7 +80,7 @@ void cmStateDirectory::ComputeRelativePathTopBinary()
   if (result.size() < 2 || result.substr(0, 2) != "//") {
   if (result.size() < 2 || result.substr(0, 2) != "//") {
     this->DirectoryState->RelativePathTopBinary = result;
     this->DirectoryState->RelativePathTopBinary = result;
   } else {
   } else {
-    this->DirectoryState->RelativePathTopBinary = "";
+    this->DirectoryState->RelativePathTopBinary.clear();
   }
   }
 }
 }
 
 
@@ -422,7 +422,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
                                           bool chain) const
                                           bool chain) const
 {
 {
   static std::string output;
   static std::string output;
-  output = "";
+  output.clear();
   if (prop == "PARENT_DIRECTORY") {
   if (prop == "PARENT_DIRECTORY") {
     cmStateSnapshot parent = this->Snapshot_.GetBuildsystemDirectoryParent();
     cmStateSnapshot parent = this->Snapshot_.GetBuildsystemDirectoryParent();
     if (parent.IsValid()) {
     if (parent.IsValid()) {

+ 7 - 7
Source/cmSystemTools.cxx

@@ -458,7 +458,7 @@ void cmSystemTools::ParseWindowsCommandLine(const char* command,
           arg.append(1, *c);
           arg.append(1, *c);
         } else if (in_argument) {
         } else if (in_argument) {
           args.push_back(arg);
           args.push_back(arg);
-          arg = "";
+          arg.clear();
           in_argument = false;
           in_argument = false;
         }
         }
       } else {
       } else {
@@ -559,7 +559,7 @@ std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
     while (*c == ' ' || *c == '\t') {
     while (*c == ' ' || *c == '\t') {
       ++c;
       ++c;
     }
     }
-    arg = "";
+    arg.clear();
     if (*c == '"') {
     if (*c == '"') {
       // Parse a quoted argument.
       // Parse a quoted argument.
       ++c;
       ++c;
@@ -1184,7 +1184,7 @@ void cmSystemTools::ExpandListArgument(const std::string& arg,
           if (!newArg.empty() || emptyArgs) {
           if (!newArg.empty() || emptyArgs) {
             // Add the last argument if the string is not empty.
             // Add the last argument if the string is not empty.
             newargs.push_back(newArg);
             newargs.push_back(newArg);
-            newArg = "";
+            newArg.clear();
           }
           }
         }
         }
       } break;
       } break;
@@ -1771,7 +1771,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
                                double timeout, std::vector<char>& out,
                                double timeout, std::vector<char>& out,
                                std::vector<char>& err)
                                std::vector<char>& err)
 {
 {
-  line = "";
+  line.clear();
   std::vector<char>::iterator outiter = out.begin();
   std::vector<char>::iterator outiter = out.begin();
   std::vector<char>::iterator erriter = err.begin();
   std::vector<char>::iterator erriter = err.begin();
   cmProcessOutput processOutput;
   cmProcessOutput processOutput;
@@ -2111,19 +2111,19 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
   cmSystemToolsCMakeGUICommand += "/cmake-gui";
   cmSystemToolsCMakeGUICommand += "/cmake-gui";
   cmSystemToolsCMakeGUICommand += cmSystemTools::GetExecutableExtension();
   cmSystemToolsCMakeGUICommand += cmSystemTools::GetExecutableExtension();
   if (!cmSystemTools::FileExists(cmSystemToolsCMakeGUICommand.c_str())) {
   if (!cmSystemTools::FileExists(cmSystemToolsCMakeGUICommand.c_str())) {
-    cmSystemToolsCMakeGUICommand = "";
+    cmSystemToolsCMakeGUICommand.clear();
   }
   }
   cmSystemToolsCMakeCursesCommand = exe_dir;
   cmSystemToolsCMakeCursesCommand = exe_dir;
   cmSystemToolsCMakeCursesCommand += "/ccmake";
   cmSystemToolsCMakeCursesCommand += "/ccmake";
   cmSystemToolsCMakeCursesCommand += cmSystemTools::GetExecutableExtension();
   cmSystemToolsCMakeCursesCommand += cmSystemTools::GetExecutableExtension();
   if (!cmSystemTools::FileExists(cmSystemToolsCMakeCursesCommand.c_str())) {
   if (!cmSystemTools::FileExists(cmSystemToolsCMakeCursesCommand.c_str())) {
-    cmSystemToolsCMakeCursesCommand = "";
+    cmSystemToolsCMakeCursesCommand.clear();
   }
   }
   cmSystemToolsCMClDepsCommand = exe_dir;
   cmSystemToolsCMClDepsCommand = exe_dir;
   cmSystemToolsCMClDepsCommand += "/cmcldeps";
   cmSystemToolsCMClDepsCommand += "/cmcldeps";
   cmSystemToolsCMClDepsCommand += cmSystemTools::GetExecutableExtension();
   cmSystemToolsCMClDepsCommand += cmSystemTools::GetExecutableExtension();
   if (!cmSystemTools::FileExists(cmSystemToolsCMClDepsCommand.c_str())) {
   if (!cmSystemTools::FileExists(cmSystemToolsCMClDepsCommand.c_str())) {
-    cmSystemToolsCMClDepsCommand = "";
+    cmSystemToolsCMClDepsCommand.clear();
   }
   }
 
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #ifdef CMAKE_BUILD_WITH_CMAKE

+ 2 - 2
Source/cmTarget.cxx

@@ -1530,7 +1530,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
       }
       }
       // If it was found, set the suffix.
       // If it was found, set the suffix.
       if (*loc || *imp) {
       if (*loc || *imp) {
-        suffix = "";
+        suffix.clear();
       }
       }
     } else {
     } else {
       std::string mcUpper = cmSystemTools::UpperCase(*mci);
       std::string mcUpper = cmSystemTools::UpperCase(*mci);
@@ -1577,7 +1577,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
   // configurations and no exact match.
   // configurations and no exact match.
   if (!*loc && !*imp) {
   if (!*loc && !*imp) {
     // The suffix computed above is not useful.
     // The suffix computed above is not useful.
-    suffix = "";
+    suffix.clear();
 
 
     // Look for a configuration-less location.  This may be set by
     // Look for a configuration-less location.  This may be set by
     // manually-written code.
     // manually-written code.

+ 5 - 5
Source/cmTryRunCommand.cxx

@@ -33,11 +33,11 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
   // build an arg list for TryCompile and extract the runArgs,
   // build an arg list for TryCompile and extract the runArgs,
   std::vector<std::string> tryCompile;
   std::vector<std::string> tryCompile;
 
 
-  this->CompileResultVariable = "";
-  this->RunResultVariable = "";
-  this->OutputVariable = "";
-  this->RunOutputVariable = "";
-  this->CompileOutputVariable = "";
+  this->CompileResultVariable.clear();
+  this->RunResultVariable.clear();
+  this->OutputVariable.clear();
+  this->RunOutputVariable.clear();
+  this->CompileOutputVariable.clear();
 
 
   std::string runArgs;
   std::string runArgs;
   unsigned int i;
   unsigned int i;

+ 1 - 1
Source/cmVSSetupHelper.cxx

@@ -218,7 +218,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
 
 
 bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
 bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
 {
 {
-  vsInstallLocation = "";
+  vsInstallLocation.clear();
   bool isInstalled = this->EnumerateAndChooseVSInstance();
   bool isInstalled = this->EnumerateAndChooseVSInstance();
 
 
   if (isInstalled) {
   if (isInstalled) {

+ 1 - 1
Source/cmVisualStudio10TargetGenerator.cxx

@@ -1612,7 +1612,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
       std::string srcDir = this->Makefile->GetCurrentSourceDirectory();
       std::string srcDir = this->Makefile->GetCurrentSourceDirectory();
       std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
       std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
       if (fullFileName.find(binDir) != std::string::npos) {
       if (fullFileName.find(binDir) != std::string::npos) {
-        sourceLink = "";
+        sourceLink.clear();
       } else if (fullFileName.find(srcDir) != std::string::npos) {
       } else if (fullFileName.find(srcDir) != std::string::npos) {
         sourceLink = fullFileName.substr(srcDir.length() + 1);
         sourceLink = fullFileName.substr(srcDir.length() + 1);
       } else {
       } else {

+ 1 - 1
Source/cmVisualStudioSlnParser.cxx

@@ -329,7 +329,7 @@ bool cmVisualStudioSlnParser::State::Process(
     case FileStateIgnore:
     case FileStateIgnore:
       if (line.GetTag() == this->EndIgnoreTag) {
       if (line.GetTag() == this->EndIgnoreTag) {
         this->Stack.pop();
         this->Stack.pop();
-        this->EndIgnoreTag = "";
+        this->EndIgnoreTag.clear();
       }
       }
       break;
       break;
     default:
     default:

+ 4 - 4
Source/cmVisualStudioWCEPlatformParser.cxx

@@ -56,12 +56,12 @@ void cmVisualStudioWCEPlatformParser::StartElement(const std::string& name,
     return;
     return;
   }
   }
 
 
-  this->CharacterData = "";
+  this->CharacterData.clear();
 
 
   if (name == "PlatformData") {
   if (name == "PlatformData") {
-    this->PlatformName = "";
-    this->OSMajorVersion = "";
-    this->OSMinorVersion = "";
+    this->PlatformName.clear();
+    this->OSMajorVersion.clear();
+    this->OSMinorVersion.clear();
     this->Macros.clear();
     this->Macros.clear();
   }
   }
 
 

+ 2 - 2
Source/cmake.cxx

@@ -1072,10 +1072,10 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator* gg)
 
 
   // Save the environment variables CXX and CC
   // Save the environment variables CXX and CC
   if (!cmSystemTools::GetEnv("CXX", this->CXXEnvironment)) {
   if (!cmSystemTools::GetEnv("CXX", this->CXXEnvironment)) {
-    this->CXXEnvironment = "";
+    this->CXXEnvironment.clear();
   }
   }
   if (!cmSystemTools::GetEnv("CC", this->CCEnvironment)) {
   if (!cmSystemTools::GetEnv("CC", this->CCEnvironment)) {
-    this->CCEnvironment = "";
+    this->CCEnvironment.clear();
   }
   }
 }
 }
 
 

+ 2 - 2
Source/cmakemain.cxx

@@ -373,7 +373,7 @@ static int do_build(int ac, char const* const* av)
         hasTarget = true;
         hasTarget = true;
       } else {
       } else {
         std::cerr << "'--target' may not be specified more than once.\n\n";
         std::cerr << "'--target' may not be specified more than once.\n\n";
-        dir = "";
+        dir.clear();
         break;
         break;
       }
       }
     } else if (strcmp(av[i], "--config") == 0) {
     } else if (strcmp(av[i], "--config") == 0) {
@@ -401,7 +401,7 @@ static int do_build(int ac, char const* const* av)
           break;
           break;
         default:
         default:
           std::cerr << "Unknown argument " << av[i] << std::endl;
           std::cerr << "Unknown argument " << av[i] << std::endl;
-          dir = "";
+          dir.clear();
           break;
           break;
       }
       }
     }
     }