1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

KWSys 2023-01-19 (be3c441e)

Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit be3c441e46e091a7606565221bb5ae7c9a9b684f (master).

Upstream Shortlog
-----------------

Brad King (4):
      6c66ba9e clang-format.bash: Use generic clang-format attribute
      82ae3f28 clang-format.bash: update to clang-format-15
      a61d0ad6 Empty commit at end of history preceding clang-format-15 style transition
      3cb35bf3 CONTRIBUTING: Update documented clang-format version to 15

Kitware Robot (1):
      f685d817 Revise C++ coding style using clang-format-15

Sean McBride (1):
      d6c6fd82 testDirectory: Rename functions to fix -Wreserved-identifier warnings
This commit is contained in:
KWSys Upstream
2023-01-19 09:11:15 -05:00
committed by Brad King
parent a9c659b1b6
commit 4ac17cff42
15 changed files with 26 additions and 26 deletions

View File

@@ -27,7 +27,7 @@ copies of KWSys within dependent projects can be updated to get the changes.
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
our style settings. Use the `clang-format.bash`_ script to format source
code. It automatically runs ``clang-format`` on the set of source files

View File

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

View File

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

View File

@@ -2406,8 +2406,9 @@ static int kwsysProcess_List__Next_NT4(kwsysProcess_List* self)
{
if (self->CurrentInfo) {
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;
}
self->CurrentInfo = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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