From 0b9f51a1e5ab7ac8792173e068f59a64be7ed2a5 Mon Sep 17 00:00:00 2001
From: Marian Klymov <nekto1989@gmail.com>
Date: Sat, 9 Jun 2018 12:12:45 +0300
Subject: [PATCH] Remove redundant calls to c_str

---
 SystemInformation.cxx | 2 +-
 SystemTools.cxx       | 4 ++--
 testSystemTools.cxx   | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index cfe62b4b..e9a04bef 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -3495,7 +3495,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
 
   // Chip Model Name
   this->ChipID.ModelName =
-    this->ExtractValueFromCpuInfoFile(buffer, "model name").c_str();
+    this->ExtractValueFromCpuInfoFile(buffer, "model name");
 
   // L1 Cache size
   // Different architectures may show different names for the caches.
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 0079da28..e7c3bc2f 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -686,7 +686,7 @@ public:
     for (iterator i = this->begin(); i != this->end(); ++i) {
 #  if defined(_WIN32)
       const std::string s = Encoding::ToNarrow(*i);
-      kwsysUnPutEnv(s.c_str());
+      kwsysUnPutEnv(s);
 #  else
       kwsysUnPutEnv(*i);
 #  endif
@@ -3140,7 +3140,7 @@ void SystemTools::AddTranslationPath(const std::string& a,
 void SystemTools::AddKeepPath(const std::string& dir)
 {
   std::string cdir;
-  Realpath(SystemTools::CollapseFullPath(dir).c_str(), cdir);
+  Realpath(SystemTools::CollapseFullPath(dir), cdir);
   SystemTools::AddTranslationPath(cdir, dir);
 }
 
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index e6f9701c..0477d593 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -206,7 +206,7 @@ static bool CheckFileOperations()
     res = false;
   }
 
-  if (!kwsys::SystemTools::Touch(testNewFile.c_str(), true)) {
+  if (!kwsys::SystemTools::Touch(testNewFile, true)) {
     std::cerr << "Problem with Touch for: " << testNewFile << std::endl;
     res = false;
   }
@@ -415,7 +415,7 @@ static bool CheckFileOperations()
     res = false;
   }
 
-  kwsys::SystemTools::Touch(testNewFile.c_str(), true);
+  kwsys::SystemTools::Touch(testNewFile, true);
   if (!kwsys::SystemTools::RemoveADirectory(testNewDir)) {
     std::cerr << "Problem with RemoveADirectory for: " << testNewDir
               << std::endl;
@@ -806,7 +806,7 @@ static bool CheckFind()
   const std::string testFindFile(TEST_SYSTEMTOOLS_BINARY_DIR "/" +
                                  testFindFileName);
 
-  if (!kwsys::SystemTools::Touch(testFindFile.c_str(), true)) {
+  if (!kwsys::SystemTools::Touch(testFindFile, true)) {
     std::cerr << "Problem with Touch for: " << testFindFile << std::endl;
     // abort here as the existence of the file only makes the test meaningful
     return false;
-- 
GitLab