[Cmake-commits] CMake branch, master, updated. v3.14.4-1080-ga4faf77

Kitware Robot kwrobot at kitware.com
Thu May 23 09:13:03 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  a4faf7788cc40b17c48a9393cd15425ee65abfd9 (commit)
       via  e884b1b69365e9dc15fff572a6ff2237c1bb7644 (commit)
      from  22df62b58d8e2b9af5e754f4ed413d90088eb79e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4faf7788cc40b17c48a9393cd15425ee65abfd9
commit a4faf7788cc40b17c48a9393cd15425ee65abfd9
Merge: 22df62b e884b1b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 23 12:54:16 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu May 23 09:05:47 2019 -0400

    Merge topic 'string-error'
    
    e884b1b693 cmSystemTools::Error(): remove const char* overload
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3360


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e884b1b69365e9dc15fff572a6ff2237c1bb7644
commit e884b1b69365e9dc15fff572a6ff2237c1bb7644
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Wed May 22 09:16:42 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed May 22 10:51:06 2019 -0400

    cmSystemTools::Error(): remove const char* overload

diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 43cfe16..a739f44 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -447,7 +447,8 @@ int cmCTestScriptHandler::ExtractVariables()
     if (updateVal) {
       if (this->UpdateCmd.empty()) {
         cmSystemTools::Error(
-          updateVar, " specified without specifying CTEST_CVS_COMMAND.");
+          std::string(updateVar) +
+          " specified without specifying CTEST_CVS_COMMAND.");
         return 12;
       }
       this->ExtraUpdates.emplace_back(updateVal);
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index e7ed097..c1dd591 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -83,7 +83,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
       break;
     }
     case cmStateEnums::UNINITIALIZED:
-      cmSystemTools::Error("Found an undefined variable: ", key.c_str());
+      cmSystemTools::Error("Found an undefined variable: " + key);
       break;
     default:
       // TODO : put warning message here
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 5efc784..255a8e6 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -167,8 +167,8 @@ void CCONV cmAddLinkDirectoryForTarget(void* arg, const char* tgt,
   cmTarget* t = mf->FindLocalNonAliasTarget(tgt);
   if (!t) {
     cmSystemTools::Error(
-      "Attempt to add link directories to non-existent target: ", tgt,
-      " for directory ", d);
+      "Attempt to add link directories to non-existent target: " +
+      std::string(tgt) + " for directory " + std::string(d));
     return;
   }
   t->InsertLinkDirectory(d, mf->GetBacktrace());
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 6116de0..358f095 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -308,8 +308,7 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
     if (!ce.Initialized) {
       /*
         // This should be added in, but is not for now.
-      cmSystemTools::Error("Cache entry \"", (*i).first.c_str(),
-                           "\" is uninitialized");
+      cmSystemTools::Error("Cache entry \"" + i.first + "\" is uninitialized");
       */
     } else if (t != cmStateEnums::INTERNAL) {
       // Format is key:type=value
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b08dd1c..3495f2a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1798,10 +1798,10 @@ int cmGlobalGenerator::Build(
   output += "\n";
   if (workdir.Failed()) {
     cmSystemTools::SetRunCommandHideConsole(hideconsole);
-    cmSystemTools::Error("Failed to change directory: ",
-                         std::strerror(workdir.GetLastResult()));
-    output += "Failed to change directory: ";
-    output += std::strerror(workdir.GetLastResult());
+    std::string err = "Failed to change directory: ";
+    err += std::strerror(workdir.GetLastResult());
+    cmSystemTools::Error(err);
+    output += err;
     output += "\n";
     return 1;
   }
diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx
index 7de3dd4..55d3685 100644
--- a/Source/cmInstallExportAndroidMKGenerator.cxx
+++ b/Source/cmInstallExportAndroidMKGenerator.cxx
@@ -44,7 +44,7 @@ void cmInstallExportAndroidMKGenerator::GenerateScript(std::ostream& os)
     std::ostringstream e;
     e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName()
       << "\"";
-    cmSystemTools::Error(e.str().c_str());
+    cmSystemTools::Error(e.str());
     return;
   }
 
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 6a08840..04e3d12 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -501,8 +501,11 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
 {
   // Make sure there is a target.
   if (target.empty()) {
-    cmSystemTools::Error("No target for WriteMakeRule! called with comment: ",
-                         comment);
+    std::string err("No target for WriteMakeRule! called with comment: ");
+    if (comment) {
+      err += comment;
+    }
+    cmSystemTools::Error(err);
     return;
   }
 
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 545e6c5..6890165 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -249,26 +249,6 @@ std::string cmSystemTools::TrimWhitespace(const std::string& s)
   return std::string(start, stop + 1);
 }
 
-void cmSystemTools::Error(const char* m1, const char* m2, const char* m3,
-                          const char* m4)
-{
-  std::string message = "CMake Error: ";
-  if (m1) {
-    message += m1;
-  }
-  if (m2) {
-    message += m2;
-  }
-  if (m3) {
-    message += m3;
-  }
-  if (m4) {
-    message += m4;
-  }
-  cmSystemTools::s_ErrorOccured = true;
-  cmSystemTools::Message(message, "Error");
-}
-
 void cmSystemTools::Error(const std::string& m)
 {
   std::string message = "CMake Error: " + m;
@@ -1746,6 +1726,16 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
   fflush(out);
 }
 
+void ArchiveError(const char* m1, struct archive* a)
+{
+  std::string message(m1);
+  const char* m2 = archive_error_string(a);
+  if (m2) {
+    message += m2;
+  }
+  cmSystemTools::Error(message);
+}
+
 bool la_diagnostic(struct archive* ar, __LA_SSIZE_T r)
 {
   // See archive.h definition of ARCHIVE_OK for return values.
@@ -1815,8 +1805,7 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
   struct archive_entry* entry;
   int r = cm_archive_read_open_file(a, outFileName, 10240);
   if (r) {
-    cmSystemTools::Error("Problem with archive_read_open_file(): ",
-                         archive_error_string(a));
+    ArchiveError("Problem with archive_read_open_file(): ", a);
     archive_write_free(ext);
     archive_read_close(a);
     return false;
@@ -1827,8 +1816,7 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
       break;
     }
     if (r != ARCHIVE_OK) {
-      cmSystemTools::Error("Problem with archive_read_next_header(): ",
-                           archive_error_string(a));
+      ArchiveError("Problem with archive_read_next_header(): ", a);
       break;
     }
     if (verbose) {
@@ -1846,8 +1834,7 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
     if (extract) {
       r = archive_write_disk_set_options(ext, ARCHIVE_EXTRACT_TIME);
       if (r != ARCHIVE_OK) {
-        cmSystemTools::Error("Problem with archive_write_disk_set_options(): ",
-                             archive_error_string(ext));
+        ArchiveError("Problem with archive_write_disk_set_options(): ", ext);
         break;
       }
 
@@ -1858,8 +1845,7 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
         }
         r = archive_write_finish_entry(ext);
         if (r != ARCHIVE_OK) {
-          cmSystemTools::Error("Problem with archive_write_finish_entry(): ",
-                               archive_error_string(ext));
+          ArchiveError("Problem with archive_write_finish_entry(): ", ext);
           break;
         }
       }
@@ -1871,8 +1857,7 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
       }
 #  endif
       else {
-        cmSystemTools::Error("Problem with archive_write_header(): ",
-                             archive_error_string(ext));
+        ArchiveError("Problem with archive_write_header(): ", ext);
         cmSystemTools::Error("Current file: " +
                              cm_archive_entry_pathname(entry));
         break;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d145d47..0b65060 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -100,8 +100,6 @@ public:
   /**
    * Display an error message.
    */
-  static void Error(const char* m, const char* m2 = nullptr,
-                    const char* m3 = nullptr, const char* m4 = nullptr);
   static void Error(const std::string& m);
 
   /**

-----------------------------------------------------------------------

Summary of changes:
 Source/CTest/cmCTestScriptHandler.cxx              |  3 +-
 .../CursesDialog/cmCursesCacheEntryComposite.cxx   |  2 +-
 Source/cmCPluginAPI.cxx                            |  4 +-
 Source/cmCacheManager.cxx                          |  3 +-
 Source/cmGlobalGenerator.cxx                       |  8 ++--
 Source/cmInstallExportAndroidMKGenerator.cxx       |  2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx           |  7 +++-
 Source/cmSystemTools.cxx                           | 45 ++++++++--------------
 Source/cmSystemTools.h                             |  2 -
 9 files changed, 31 insertions(+), 45 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list