clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I21d2ca8065f24fd73509229c517f5caf48934b60
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/lib/include/phosphor-logging/lg2/conversion.hpp b/lib/include/phosphor-logging/lg2/conversion.hpp
index b90790e..7138fe5 100644
--- a/lib/include/phosphor-logging/lg2/conversion.hpp
+++ b/lib/include/phosphor-logging/lg2/conversion.hpp
@@ -29,8 +29,8 @@
template <typename T>
concept string_like_type =
(std::constructible_from<std::string_view, T> ||
- std::same_as<std::filesystem::path,
- std::decay_t<T>>)&&!std::same_as<std::nullptr_t, T>;
+ std::same_as<std::filesystem::path, std::decay_t<T>>) &&
+ !std::same_as<std::nullptr_t, T>;
/** Concept to determine if an item acts like a pointer.
*
@@ -38,8 +38,9 @@
* pointer.
*/
template <typename T>
-concept pointer_type = (std::is_pointer_v<T> ||
- std::same_as<std::nullptr_t, T>)&&!string_like_type<T>;
+concept pointer_type =
+ (std::is_pointer_v<T> || std::same_as<std::nullptr_t, T>) &&
+ !string_like_type<T>;
/** Concept to determine if an item acts like an unsigned_integral.
*
@@ -47,8 +48,8 @@
* `True` and `False` strings.
*/
template <typename T>
-concept unsigned_integral_except_bool = !std::same_as<T, bool> &&
- std::unsigned_integral<T>;
+concept unsigned_integral_except_bool =
+ !std::same_as<T, bool> && std::unsigned_integral<T>;
template <typename T>
concept sdbusplus_enum = sdbusplus::message::has_convert_from_string_v<T>;
@@ -64,8 +65,8 @@
concept has_to_string = requires(T&& t) { to_string(t); };
template <typename T>
-concept is_raw_enum = std::is_enum_v<std::decay_t<T>> && !sdbusplus_enum<T> &&
- !has_to_string<T>;
+concept is_raw_enum =
+ std::is_enum_v<std::decay_t<T>> && !sdbusplus_enum<T> && !has_to_string<T>;
/** Concept listing all of the types we know how to convert into a format
* for logging.
@@ -238,8 +239,8 @@
// Cast (void*) to a hex-formatted uint64 using the target's pointer-size
// to determine field-width.
- constexpr static auto new_f = sizeof(void*) == 4 ? field32.value
- : field64.value;
+ constexpr static auto new_f =
+ sizeof(void*) == 4 ? field32.value : field64.value;
return std::make_tuple(h, new_f | (hex | unsigned_val).value,
reinterpret_cast<uint64_t>(v));
diff --git a/lib/lg2_logger.cpp b/lib/lg2_logger.cpp
index fcf129f..57fc029 100644
--- a/lib/lg2_logger.cpp
+++ b/lib/lg2_logger.cpp
@@ -209,10 +209,10 @@
// Use the cerr output method if we are on a TTY or if explicitly set via
// environment variable.
-static auto extra_output_method = (isatty(fileno(stderr)) ||
- nullptr != getenv("LG2_FORCE_STDERR"))
- ? cerr_extra_output
- : noop_extra_output;
+static auto extra_output_method =
+ (isatty(fileno(stderr)) || nullptr != getenv("LG2_FORCE_STDERR"))
+ ? cerr_extra_output
+ : noop_extra_output;
// Do_log implementation.
void do_log(level l, const std::source_location& s, const char* m, ...)