Bump clang-format

This patch contains a bump of the configured clang-format version from
17.0.3 to 18.1.8 and automatically generated C++ source updates. The
main difference we are seeing from this is fixes for previously
incomplete reformats.
This commit is contained in:
Benjamin Bannier 2024-09-02 16:46:59 +02:00
parent c27e18631c
commit db42b2cfe5
12 changed files with 32 additions and 35 deletions

View file

@ -1645,36 +1645,34 @@ FILE* open_file(const string& path, const string& mode) {
return rval;
}
TEST_CASE("util path ops"){
TEST_CASE("util path ops") {
#ifdef _MSC_VER
// TODO: adapt these tests to Windows paths
#else
SUBCASE("SafeDirname"){SafeDirname d("/this/is/a/path", false);
CHECK(d.result == "/this/is/a");
SUBCASE("SafeDirname") {
SafeDirname d("/this/is/a/path", false);
CHECK(d.result == "/this/is/a");
SafeDirname d2("invalid", false);
CHECK(d2.result == ".");
SafeDirname d2("invalid", false);
CHECK(d2.result == ".");
SafeDirname d3("./filename", false);
CHECK(d2.result == ".");
}
SafeDirname d3("./filename", false);
CHECK(d2.result == ".");
}
SUBCASE("SafeBasename") {
SafeBasename b("/this/is/a/path", false);
CHECK(b.result == "path");
CHECK(! b.error);
SUBCASE("SafeBasename") {
SafeBasename b("/this/is/a/path", false);
CHECK(b.result == "path");
CHECK(! b.error);
SafeBasename b2("justafile", false);
CHECK(b2.result == "justafile");
CHECK(! b2.error);
}
SafeBasename b2("justafile", false);
CHECK(b2.result == "justafile");
CHECK(! b2.error);
}
#endif
}
SafeDirname::SafeDirname(const char* path, bool error_aborts)
: SafePathOp() {
DoFunc(path ? path : "", error_aborts);
}
SafeDirname::SafeDirname(const char* path, bool error_aborts) : SafePathOp() { DoFunc(path ? path : "", error_aborts); }
SafeDirname::SafeDirname(const string& path, bool error_aborts) : SafePathOp() { DoFunc(path, error_aborts); }
@ -2303,8 +2301,7 @@ static void strerror_r_helper(char* result, char* buf, size_t buflen) {
buf[buflen - 1] = 0;
}
static void strerror_r_helper(int result, char* buf, size_t buflen) { /* XSI flavor of strerror_r, no-op. */
}
static void strerror_r_helper(int result, char* buf, size_t buflen) { /* XSI flavor of strerror_r, no-op. */ }
void zeek_strerror_r(int zeek_errno, char* buf, size_t buflen) {
#ifdef _MSC_VER