Jelajahi Sumber

Merge branch 'upstream-KWSys' into update-kwsys

# By KWSys Upstream
* upstream-KWSys:
  KWSys 2023-01-19 (be3c441e)
Brad King 2 tahun lalu
induk
melakukan
dae189fb09

+ 1 - 1
Source/kwsys/CONTRIBUTING.rst

@@ -27,7 +27,7 @@ copies of KWSys within dependent projects can be updated to get the changes.
 Code Style
 Code Style
 ==========
 ==========
 
 
-We use `clang-format`_ version **6.0** to define our style for C++ code in
+We use `clang-format`_ version **15** to define our style for C++ code in
 the KWSys source tree.  See the `.clang-format`_ configuration file for
 the KWSys source tree.  See the `.clang-format`_ configuration file for
 our style settings.  Use the `clang-format.bash`_ script to format source
 our style settings.  Use the `clang-format.bash`_ script to format source
 code.  It automatically runs ``clang-format`` on the set of source files
 code.  It automatically runs ``clang-format`` on the set of source files

+ 1 - 1
Source/kwsys/CommandLineArguments.cxx

@@ -319,7 +319,7 @@ void CommandLineArguments::DeleteRemainingArguments(int argc, char*** argv)
 {
 {
   int cc;
   int cc;
   for (cc = 0; cc < argc; ++cc) {
   for (cc = 0; cc < argc; ++cc) {
-    delete[](*argv)[cc];
+    delete[] (*argv)[cc];
   }
   }
   delete[] * argv;
   delete[] * argv;
 }
 }

+ 2 - 2
Source/kwsys/Glob.cxx

@@ -390,8 +390,8 @@ bool Glob::FindFiles(const std::string& inexpr, GlobMessages* messages)
 #endif
 #endif
       // Handle drive letters on Windows
       // Handle drive letters on Windows
       if (expr[1] == ':' && expr[0] != '/') {
       if (expr[1] == ':' && expr[0] != '/') {
-      skip = 2;
-    }
+        skip = 2;
+      }
   }
   }
 
 
   if (skip > 0) {
   if (skip > 0) {

+ 3 - 2
Source/kwsys/ProcessWin32.c

@@ -2406,8 +2406,9 @@ static int kwsysProcess_List__Next_NT4(kwsysProcess_List* self)
 {
 {
   if (self->CurrentInfo) {
   if (self->CurrentInfo) {
     if (self->CurrentInfo->NextEntryDelta > 0) {
     if (self->CurrentInfo->NextEntryDelta > 0) {
-      self->CurrentInfo = ((PSYSTEM_PROCESS_INFORMATION)(
-        (char*)self->CurrentInfo + self->CurrentInfo->NextEntryDelta));
+      self->CurrentInfo =
+        ((PSYSTEM_PROCESS_INFORMATION)((char*)self->CurrentInfo +
+                                       self->CurrentInfo->NextEntryDelta));
       return 1;
       return 1;
     }
     }
     self->CurrentInfo = 0;
     self->CurrentInfo = 0;

+ 2 - 2
Source/kwsys/RegularExpression.cxx

@@ -366,9 +366,9 @@ bool RegularExpression::compile(const char* exp)
   }
   }
 
 
   // Allocate space.
   // Allocate space.
-  //#ifndef _WIN32
+  // #ifndef _WIN32
   delete[] this->program;
   delete[] this->program;
-  //#endif
+  // #endif
   this->program = new char[comp.regsize];
   this->program = new char[comp.regsize];
   this->progsize = static_cast<int>(comp.regsize);
   this->progsize = static_cast<int>(comp.regsize);
 
 

+ 4 - 4
Source/kwsys/RegularExpression.hxx.in

@@ -456,9 +456,9 @@ inline RegularExpression::RegularExpression(const std::string& s)
  */
  */
 inline RegularExpression::~RegularExpression()
 inline RegularExpression::~RegularExpression()
 {
 {
-  //#ifndef _WIN32
+  // #ifndef _WIN32
   delete[] this->program;
   delete[] this->program;
-  //#endif
+  // #endif
 }
 }
 
 
 /**
 /**
@@ -556,9 +556,9 @@ inline bool RegularExpression::is_valid() const
 
 
 inline void RegularExpression::set_invalid()
 inline void RegularExpression::set_invalid()
 {
 {
-  //#ifndef _WIN32
+  // #ifndef _WIN32
   delete[] this->program;
   delete[] this->program;
-  //#endif
+  // #endif
   this->program = nullptr;
   this->program = nullptr;
 }
 }
 
 

+ 1 - 1
Source/kwsys/kwsysPrivate.h

@@ -27,7 +27,7 @@
 */
 */
 #  define KWSYS_NAMESPACE_STRING KWSYS_NAMESPACE_STRING0(KWSYS_NAMESPACE)
 #  define KWSYS_NAMESPACE_STRING KWSYS_NAMESPACE_STRING0(KWSYS_NAMESPACE)
 #  define KWSYS_NAMESPACE_STRING0(x) KWSYS_NAMESPACE_STRING1(x)
 #  define KWSYS_NAMESPACE_STRING0(x) KWSYS_NAMESPACE_STRING1(x)
-#  define KWSYS_NAMESPACE_STRING1(x) #  x
+#  define KWSYS_NAMESPACE_STRING1(x) #x
 
 
 #else
 #else
 #  error "kwsysPrivate.h included multiple times."
 #  error "kwsysPrivate.h included multiple times."

+ 1 - 1
Source/kwsys/testConfigure.cxx

@@ -22,7 +22,7 @@ static bool testFallthrough(int n)
   return r == 2;
   return r == 2;
 }
 }
 
 
-int testConfigure(int, char* [])
+int testConfigure(int, char*[])
 {
 {
   bool res = true;
   bool res = true;
   res = testFallthrough(1) && res;
   res = testFallthrough(1) && res;

+ 1 - 1
Source/kwsys/testConsoleBuf.cxx

@@ -743,7 +743,7 @@ static int testConsole()
 
 
 #endif
 #endif
 
 
-int testConsoleBuf(int, char* [])
+int testConsoleBuf(int, char*[])
 {
 {
   int ret = 0;
   int ret = 0;
 
 

+ 5 - 6
Source/kwsys/testDirectory.cxx

@@ -19,7 +19,7 @@ file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
 
 
 #include <testSystemTools.h>
 #include <testSystemTools.h>
 
 
-static int _doLongPathTest()
+static int doLongPathTest()
 {
 {
   using namespace kwsys;
   using namespace kwsys;
   static const int LONG_PATH_THRESHOLD = 512;
   static const int LONG_PATH_THRESHOLD = 512;
@@ -77,7 +77,7 @@ static int _doLongPathTest()
   return res;
   return res;
 }
 }
 
 
-static int _nonExistentDirectoryTest()
+static int nonExistentDirectoryTest()
 {
 {
   using namespace kwsys;
   using namespace kwsys;
   int res = 0;
   int res = 0;
@@ -105,7 +105,7 @@ static int _nonExistentDirectoryTest()
   return res;
   return res;
 }
 }
 
 
-static int _copyDirectoryTest()
+static int copyDirectoryTest()
 {
 {
   using namespace kwsys;
   using namespace kwsys;
   const std::string source(TEST_SYSTEMTOOLS_BINARY_DIR
   const std::string source(TEST_SYSTEMTOOLS_BINARY_DIR
@@ -136,8 +136,7 @@ static int _copyDirectoryTest()
   return 0;
   return 0;
 }
 }
 
 
-int testDirectory(int, char* [])
+int testDirectory(int, char*[])
 {
 {
-  return _doLongPathTest() + _nonExistentDirectoryTest() +
-    _copyDirectoryTest();
+  return doLongPathTest() + nonExistentDirectoryTest() + copyDirectoryTest();
 }
 }

+ 1 - 1
Source/kwsys/testEncoding.cxx

@@ -266,7 +266,7 @@ static int testToWindowsExtendedPath()
 #endif
 #endif
 }
 }
 
 
-int testEncoding(int, char* [])
+int testEncoding(int, char*[])
 {
 {
   const char* loc = setlocale(LC_ALL, "");
   const char* loc = setlocale(LC_ALL, "");
   if (loc) {
   if (loc) {

+ 1 - 1
Source/kwsys/testFStream.cxx

@@ -136,7 +136,7 @@ static int testBOMIO()
   return 0;
   return 0;
 }
 }
 
 
-int testFStream(int, char* [])
+int testFStream(int, char*[])
 {
 {
   int ret = 0;
   int ret = 0;
 
 

+ 1 - 1
Source/kwsys/testStatus.cxx

@@ -16,7 +16,7 @@ file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
 #  include <windows.h>
 #  include <windows.h>
 #endif
 #endif
 
 
-int testStatus(int, char* [])
+int testStatus(int, char*[])
 {
 {
   bool res = true;
   bool res = true;
   {
   {

+ 1 - 1
Source/kwsys/testSystemInformation.cxx

@@ -19,7 +19,7 @@
 #define printMethod3(info, m, unit)                                           \
 #define printMethod3(info, m, unit)                                           \
   std::cout << #m << ": " << info.m << " " << unit << "\n"
   std::cout << #m << ": " << info.m << " " << unit << "\n"
 
 
-int testSystemInformation(int, char* [])
+int testSystemInformation(int, char*[])
 {
 {
   std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation
   std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation
 
 

+ 1 - 1
Source/kwsys/testSystemTools.cxx

@@ -1209,7 +1209,7 @@ static bool CheckSplitString()
   return ret;
   return ret;
 }
 }
 
 
-int testSystemTools(int, char* [])
+int testSystemTools(int, char*[])
 {
 {
   bool res = true;
   bool res = true;