clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I8000f29e7e567f47b61325ebd6241d4d70d624b5
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index a75a2c2..e5530e6 100644
--- a/.clang-format
+++ b/.clang-format
@@ -104,7 +104,7 @@
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyReturnTypeOnItsOwnLine: 150
PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index 4f42cc9..cf8b7ef 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -852,16 +852,16 @@
}
}
- std::shared_ptr<dbus_interface>
- add_interface(const std::string& path, const std::string& name)
+ std::shared_ptr<dbus_interface> add_interface(const std::string& path,
+ const std::string& name)
{
auto dbusIface = std::make_shared<dbus_interface>(conn_, path, name);
interfaces_.emplace_back(dbusIface);
return dbusIface;
}
- std::unique_ptr<dbus_interface>
- add_unique_interface(const std::string& path, const std::string& name)
+ std::unique_ptr<dbus_interface> add_unique_interface(
+ const std::string& path, const std::string& name)
{
return std::make_unique<dbus_interface>(conn_, path, name);
}
@@ -875,9 +875,9 @@
@return an unique_ptr to initialized dbus_interface
*/
template <class Initializer>
- std::unique_ptr<dbus_interface>
- add_unique_interface(const std::string& path, const std::string& name,
- Initializer&& initializer)
+ std::unique_ptr<dbus_interface> add_unique_interface(
+ const std::string& path, const std::string& name,
+ Initializer&& initializer)
{
auto dbusIface = std::make_unique<dbus_interface>(conn_, path, name);
initializer(*dbusIface);
diff --git a/include/sdbusplus/asio/property.hpp b/include/sdbusplus/asio/property.hpp
index 68773ae..d99bc39 100644
--- a/include/sdbusplus/asio/property.hpp
+++ b/include/sdbusplus/asio/property.hpp
@@ -104,11 +104,11 @@
}
template <typename PropertyType, typename Handler>
-inline void
- setProperty(sdbusplus::asio::connection& bus, const std::string& service,
- const std::string& path, const std::string& interface,
- const std::string& propertyName, PropertyType&& propertyValue,
- Handler&& handler)
+inline void setProperty(sdbusplus::asio::connection& bus,
+ const std::string& service, const std::string& path,
+ const std::string& interface,
+ const std::string& propertyName,
+ PropertyType&& propertyValue, Handler&& handler)
{
bus.async_method_call(
std::forward<Handler>(handler), service, path,
diff --git a/include/sdbusplus/async/stdexec/__detail/__let.hpp b/include/sdbusplus/async/stdexec/__detail/__let.hpp
index a2ff7b4..8df4522 100644
--- a/include/sdbusplus/async/stdexec/__detail/__let.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__let.hpp
@@ -51,8 +51,8 @@
return true;
}
- constexpr auto
- query(get_completion_scheduler_t<set_value_t>) const noexcept
+ constexpr auto query(
+ get_completion_scheduler_t<set_value_t>) const noexcept
{
return __unknown_scheduler{};
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__meta.hpp b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
index 0497011..3433996 100644
--- a/include/sdbusplus/async/stdexec/__detail/__meta.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
@@ -262,9 +262,8 @@
#endif
template <std::size_t _OtherLen>
- constexpr auto
- operator<=>(const __mstring<_OtherLen>& __other) const noexcept
- -> std::strong_ordering
+ constexpr auto operator<=>(const __mstring<_OtherLen>& __other)
+ const noexcept -> std::strong_ordering
{
constexpr std::size_t __len = _Len < _OtherLen ? _Len : _OtherLen;
for (std::size_t __i = 0; __i < __len; ++__i)
diff --git a/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp b/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
index 90c13f6..bb0c4aa 100644
--- a/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
@@ -109,8 +109,8 @@
template <class _Env>
requires tag_invocable<get_delegation_scheduler_t, const _Env&>
-inline auto
- get_delegation_scheduler_t::operator()(const _Env& __env) const noexcept
+inline auto get_delegation_scheduler_t::operator()(
+ const _Env& __env) const noexcept
-> tag_invoke_result_t<get_delegation_scheduler_t, const _Env&>
{
static_assert(
diff --git a/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp b/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
index 1124e60..5f879a1 100644
--- a/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
@@ -59,8 +59,8 @@
requires __callable<_T0, _Sender> &&
__callable<_T1, __call_result_t<_T0, _Sender>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_T1, __call_result_t<_T0, _Sender>>
- operator()(_Sender&& __sndr) &&
+ __call_result_t<_T1, __call_result_t<_T0, _Sender>> operator()(
+ _Sender&& __sndr) &&
{
return static_cast<_T1&&>(__t1_)(
static_cast<_T0&&>(__t0_)(static_cast<_Sender&&>(__sndr)));
@@ -70,8 +70,8 @@
requires __callable<const _T0&, _Sender> &&
__callable<const _T1&, __call_result_t<const _T0&, _Sender>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_T1, __call_result_t<_T0, _Sender>>
- operator()(_Sender&& __sndr) const&
+ __call_result_t<_T1, __call_result_t<_T0, _Sender>> operator()(
+ _Sender&& __sndr) const&
{
return __t1_(__t0_(static_cast<_Sender&&>(__sndr)));
}
@@ -83,8 +83,8 @@
template <sender _Sender, __sender_adaptor_closure_for<_Sender> _Closure>
STDEXEC_ATTRIBUTE((always_inline))
-__call_result_t<_Closure, _Sender>
- operator|(_Sender&& __sndr, _Closure&& __clsur)
+__call_result_t<_Closure, _Sender> operator|(_Sender&& __sndr,
+ _Closure&& __clsur)
{
return static_cast<_Closure&&>(__clsur)(static_cast<_Sender&&>(__sndr));
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp b/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
index d0b7750..db1dbe3 100644
--- a/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
@@ -155,8 +155,8 @@
// requested domain.
template <class _Domain, sender_expr _Sender, class _Env>
requires same_as<__early_domain_of_t<_Sender>, dependent_domain>
- /*constexpr*/ auto
- operator()(_Domain __dom, _Sender&& __sndr, const _Env& __env) const
+ /*constexpr*/ auto operator()(_Domain __dom, _Sender&& __sndr,
+ const _Env& __env) const
noexcept(noexcept(__transform_sender()(
__dom,
dependent_domain().transform_sender(static_cast<_Sender&&>(__sndr),
diff --git a/include/sdbusplus/async/stdexec/__detail/__utility.hpp b/include/sdbusplus/async/stdexec/__detail/__utility.hpp
index 3af21b7..acbb9ad 100644
--- a/include/sdbusplus/async/stdexec/__detail/__utility.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__utility.hpp
@@ -85,8 +85,8 @@
auto operator=(const __move_only&) -> __move_only& = delete;
};
-inline constexpr std::size_t
- __umax(std::initializer_list<std::size_t> __il) noexcept
+inline constexpr std::size_t __umax(
+ std::initializer_list<std::size_t> __il) noexcept
{
std::size_t __m = 0;
for (std::size_t __i : __il)
diff --git a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
index c31f257..6da8bd5 100644
--- a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
+++ b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
@@ -194,8 +194,8 @@
return false;
}
- static auto
- await_suspend(__coro::coroutine_handle<__promise> __h) noexcept
+ static auto await_suspend(
+ __coro::coroutine_handle<__promise> __h) noexcept
-> __coro::coroutine_handle<>
{
__promise& __p = __h.promise();
diff --git a/include/sdbusplus/async/stdexec/coroutine.hpp b/include/sdbusplus/async/stdexec/coroutine.hpp
index e9d3439..2835332 100644
--- a/include/sdbusplus/async/stdexec/coroutine.hpp
+++ b/include/sdbusplus/async/stdexec/coroutine.hpp
@@ -82,8 +82,8 @@
return false;
}
- __coro::coroutine_handle<>
- await_suspend(__coro::coroutine_handle<>) noexcept
+ __coro::coroutine_handle<> await_suspend(
+ __coro::coroutine_handle<>) noexcept
{
return __continue_;
}
diff --git a/include/sdbusplus/async/stdexec/functional.hpp b/include/sdbusplus/async/stdexec/functional.hpp
index 6018ffe..b39bbaa 100644
--- a/include/sdbusplus/async/stdexec/functional.hpp
+++ b/include/sdbusplus/async/stdexec/functional.hpp
@@ -39,8 +39,8 @@
requires __callable<_Fun1, _Ts...> &&
__callable<_Fun0, __call_result_t<_Fun1, _Ts...>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
- operator()(_Ts&&... __ts) &&
+ __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>> operator()(
+ _Ts&&... __ts) &&
{
return static_cast<_Fun0&&>(__t0_)(
static_cast<_Fun1&&>(__t1_)(static_cast<_Ts&&>(__ts)...));
@@ -50,8 +50,8 @@
requires __callable<const _Fun1&, _Ts...> &&
__callable<const _Fun0&, __call_result_t<const _Fun1&, _Ts...>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
- operator()(_Ts&&... __ts) const&
+ __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>> operator()(
+ _Ts&&... __ts) const&
{
return __t0_(__t1_(static_cast<_Ts&&>(__ts)...));
}
diff --git a/include/sdbusplus/async/stdexec/stop_token.hpp b/include/sdbusplus/async/stdexec/stop_token.hpp
index 015e2ad..5f22a94 100644
--- a/include/sdbusplus/async/stdexec/stop_token.hpp
+++ b/include/sdbusplus/async/stdexec/stop_token.hpp
@@ -241,8 +241,8 @@
}
private:
- static void
- __execute_impl_(__stok::__inplace_stop_callback_base* cb) noexcept
+ static void __execute_impl_(
+ __stok::__inplace_stop_callback_base* cb) noexcept
{
std::move(static_cast<inplace_stop_callback*>(cb)->__fun_)();
}
diff --git a/include/sdbusplus/async/stdexec/task.hpp b/include/sdbusplus/async/stdexec/task.hpp
index 74ee1f6..472d57a 100644
--- a/include/sdbusplus/async/stdexec/task.hpp
+++ b/include/sdbusplus/async/stdexec/task.hpp
@@ -369,8 +369,8 @@
return false;
}
- static auto
- await_suspend(__coro::coroutine_handle<__promise> __h) noexcept
+ static auto await_suspend(
+ __coro::coroutine_handle<__promise> __h) noexcept
-> __coro::coroutine_handle<>
{
return __h.promise().continuation().handle();
diff --git a/include/sdbusplus/message.hpp b/include/sdbusplus/message.hpp
index fa3f690..1c9ad4a 100644
--- a/include/sdbusplus/message.hpp
+++ b/include/sdbusplus/message.hpp
@@ -449,8 +449,8 @@
* @return The slot handle that manages the lifetime of the call object.
*/
template <typename Cb>
- [[nodiscard]] slot_t
- call_async(Cb&& cb, std::optional<SdBusDuration> timeout = std::nullopt)
+ [[nodiscard]] slot_t call_async(
+ Cb&& cb, std::optional<SdBusDuration> timeout = std::nullopt)
{
sd_bus_slot* slot;
auto timeout_us = timeout ? timeout->count() : 0;
diff --git a/include/sdbusplus/message/append.hpp b/include/sdbusplus/message/append.hpp
index 1f34b94..46bc581 100644
--- a/include/sdbusplus/message/append.hpp
+++ b/include/sdbusplus/message/append.hpp
@@ -390,8 +390,8 @@
* sd_bus_message_append.
*/
template <typename Tuple>
-std::enable_if_t<2 <= std::tuple_size_v<Tuple>>
- append_tuple(sdbusplus::SdBusInterface* intf, sd_bus_message* m, Tuple&& t)
+std::enable_if_t<2 <= std::tuple_size_v<Tuple>> append_tuple(
+ sdbusplus::SdBusInterface* intf, sd_bus_message* m, Tuple&& t)
{
// This was called because the tuple had at least 2 items in it.
AppendHelper<std::tuple_size_v<Tuple>>::op(intf, m, std::move(t));
@@ -408,8 +408,8 @@
* can_append_multiple_v == false.
*/
template <typename Tuple>
-std::enable_if_t<1 == std::tuple_size_v<Tuple>>
- append_tuple(sdbusplus::SdBusInterface* intf, sd_bus_message* m, Tuple&& t)
+std::enable_if_t<1 == std::tuple_size_v<Tuple>> append_tuple(
+ sdbusplus::SdBusInterface* intf, sd_bus_message* m, Tuple&& t)
{
using itemType = decltype(std::get<0>(t));
append_single_t<itemType>::op(intf, m,
diff --git a/include/sdbusplus/sdbus.hpp b/include/sdbusplus/sdbus.hpp
index 7663ddc..be582a6 100644
--- a/include/sdbusplus/sdbus.hpp
+++ b/include/sdbusplus/sdbus.hpp
@@ -26,9 +26,9 @@
sd_bus* bus, sd_bus_slot** slot, const char* path,
const char* interface, const sd_bus_vtable* vtable, void* userdata) = 0;
- virtual int
- sd_bus_add_match(sd_bus* bus, sd_bus_slot** slot, const char* path,
- sd_bus_message_handler_t callback, void* userdata) = 0;
+ virtual int sd_bus_add_match(
+ sd_bus* bus, sd_bus_slot** slot, const char* path,
+ sd_bus_message_handler_t callback, void* userdata) = 0;
virtual int sd_bus_attach_event(sd_bus* bus, sd_event* e, int priority) = 0;
@@ -97,8 +97,8 @@
virtual const char* sd_bus_message_get_member(sd_bus_message* m) = 0;
virtual const char* sd_bus_message_get_path(sd_bus_message* m) = 0;
virtual const char* sd_bus_message_get_sender(sd_bus_message* m) = 0;
- virtual const char*
- sd_bus_message_get_signature(sd_bus_message* m, int complete) = 0;
+ virtual const char* sd_bus_message_get_signature(sd_bus_message* m,
+ int complete) = 0;
virtual int sd_bus_message_get_errno(sd_bus_message* m) = 0;
virtual const sd_bus_error* sd_bus_message_get_error(sd_bus_message* m) = 0;
diff --git a/include/sdbusplus/server/transaction.hpp b/include/sdbusplus/server/transaction.hpp
index af56b33..8e3559c 100644
--- a/include/sdbusplus/server/transaction.hpp
+++ b/include/sdbusplus/server/transaction.hpp
@@ -66,8 +66,8 @@
template <>
struct hash<sdbusplus::server::transaction::Transaction>
{
- size_t
- operator()(const sdbusplus::server::transaction::Transaction& t) const;
+ size_t operator()(
+ const sdbusplus::server::transaction::Transaction& t) const;
};
/** @ brief Overload of std::hash for details::Transaction */
diff --git a/include/sdbusplus/utility/type_traits.hpp b/include/sdbusplus/utility/type_traits.hpp
index 1f859af..b91fa20 100644
--- a/include/sdbusplus/utility/type_traits.hpp
+++ b/include/sdbusplus/utility/type_traits.hpp
@@ -93,8 +93,8 @@
// Small helper class for stripping off the first + last character of a char
// array
template <std::size_t N, std::size_t... Is>
-constexpr std::array<char, N - 2>
- strip_ends(const std::array<char, N>& s, std::index_sequence<Is...>)
+constexpr std::array<char, N - 2> strip_ends(const std::array<char, N>& s,
+ std::index_sequence<Is...>)
{
return {(s[1 + Is])..., static_cast<char>(0)};
}
diff --git a/include/sdbusplus/vtable.hpp b/include/sdbusplus/vtable.hpp
index 57af3eb..851aa8c 100644
--- a/include/sdbusplus/vtable.hpp
+++ b/include/sdbusplus/vtable.hpp
@@ -95,10 +95,10 @@
* @param[in] offset - Offset within object for property.
* @param[in] flags - optional sdbusplus::vtable::property_ value.
*/
-constexpr vtable_t
- property_o(const char* member, const char* signature,
- sd_bus_property_get_t get, sd_bus_property_set_t set,
- size_t offset, decltype(vtable_t::flags) flags = 0);
+constexpr vtable_t property_o(const char* member, const char* signature,
+ sd_bus_property_get_t get,
+ sd_bus_property_set_t set, size_t offset,
+ decltype(vtable_t::flags) flags = 0);
namespace common_
{