clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I1d7d35c8035993df4c164bfb055d3be476d3ea84
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d92a3f1..d43e884 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,26 +14,30 @@
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
+BitFieldColonSpacing: None
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
+ AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
- AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
+ BeforeLambdaBody: false
+ BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
@@ -48,17 +52,16 @@
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
-DeriveLineEnding: false
DerivePointerAlignment: false
-PointerAlignment: Left
DisableFormat: false
-ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
-ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:
+ - foreach
+ - Q_FOREACH
+ - BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentExternBlock: NoIndent
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
@@ -100,12 +105,13 @@
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
ReflowComments: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: Keyword
-SortIncludes: true
+SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 8138dea..474d261 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -230,7 +230,7 @@
[](const std::string& req, std::string& propertyValue) {
propertyValue = req;
return true;
- },
+ },
// custom get
[](const std::string& property) {
auto now = std::chrono::system_clock::now();
@@ -334,7 +334,7 @@
{
std::cout << item.first << "\n";
}
- },
+ },
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree",
@@ -355,7 +355,7 @@
{
std::cerr << "async_method_call should have failed!\n";
}
- },
+ },
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree",
@@ -391,7 +391,7 @@
return;
}
std::cout << "TestYieldFunction return " << testValue << "\n";
- },
+ },
"xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
"xyz.openbmc_project.test", "TestYieldFunction", int32_t(41));
io.run();
diff --git a/example/coroutine-example.cpp b/example/coroutine-example.cpp
index c077acd..2302f47 100644
--- a/example/coroutine-example.cpp
+++ b/example/coroutine-example.cpp
@@ -50,9 +50,9 @@
{
return std::to_string(v);
}
- },
+ },
value)
- << std::endl;
+ << std::endl;
}
// Try to set the Architecture property (which won't work).
diff --git a/example/get-all-properties.cpp b/example/get-all-properties.cpp
index 711dd8b..35e9783 100644
--- a/example/get-all-properties.cpp
+++ b/example/get-all-properties.cpp
@@ -35,7 +35,7 @@
[this](const auto& newPropertyValue, const auto&) {
goodbyes_ = newPropertyValue;
return true;
- },
+ },
[this](const auto&) { return goodbyes_; });
demo_->register_property_r<uint32_t>(
@@ -84,49 +84,48 @@
const std::vector<std::pair<
std::string, std::variant<std::monostate, std::string>>>&
properties) -> void {
- if (ec)
- {
- logSystemErrorCode(ec);
- return;
- }
- {
- const std::string* greetings = nullptr;
- const std::string* goodbyes = nullptr;
- const bool success = sdbusplus::unpackPropertiesNoThrow(
- [this](const sdbusplus::UnpackErrorReason reason,
- const std::string& property) {
+ if (ec)
+ {
+ logSystemErrorCode(ec);
+ return;
+ }
+ {
+ const std::string* greetings = nullptr;
+ const std::string* goodbyes = nullptr;
+ const bool success = sdbusplus::unpackPropertiesNoThrow(
+ [this](const sdbusplus::UnpackErrorReason reason,
+ const std::string& property) {
logUnpackError(reason, property);
- },
- properties, propertyGrettingName, greetings,
- propertyGoodbyesName, goodbyes);
+ },
+ properties, propertyGrettingName, greetings,
+ propertyGoodbyesName, goodbyes);
- if (success)
- {
- std::cout << "value of greetings: " << *greetings
- << "\n";
- std::cout << "value of goodbyes: " << *goodbyes << "\n";
- }
- else
- {
- ++fatalErrors_;
- }
- }
-
- try
+ if (success)
{
- std::string value;
- sdbusplus::unpackProperties(properties, propertyValueName,
- value);
-
- std::cerr << "Error: it should fail because of "
- "not matched type\n";
+ std::cout << "value of greetings: " << *greetings << "\n";
+ std::cout << "value of goodbyes: " << *goodbyes << "\n";
+ }
+ else
+ {
++fatalErrors_;
}
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
- });
+ }
+
+ try
+ {
+ std::string value;
+ sdbusplus::unpackProperties(properties, propertyValueName,
+ value);
+
+ std::cerr << "Error: it should fail because of "
+ "not matched type\n";
+ ++fatalErrors_;
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
+ });
}
void asyncGetAllProperties()
@@ -138,60 +137,59 @@
std::string,
std::variant<std::monostate, std::string, uint32_t>>>&
properties) -> void {
- if (ec)
- {
- logSystemErrorCode(ec);
- return;
- }
- try
- {
- std::string greetings;
- std::string goodbyes;
- uint32_t value = 0u;
- sdbusplus::unpackProperties(properties,
- propertyGrettingName, greetings,
- propertyGoodbyesName, goodbyes,
- propertyValueName, value);
+ if (ec)
+ {
+ logSystemErrorCode(ec);
+ return;
+ }
+ try
+ {
+ std::string greetings;
+ std::string goodbyes;
+ uint32_t value = 0u;
+ sdbusplus::unpackProperties(properties, propertyGrettingName,
+ greetings, propertyGoodbyesName,
+ goodbyes, propertyValueName, value);
- std::cout << "value of greetings: " << greetings << "\n";
- std::cout << "value of goodbyes: " << goodbyes << "\n";
- std::cout << "value of value: " << value << "\n";
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logException(error);
- }
+ std::cout << "value of greetings: " << greetings << "\n";
+ std::cout << "value of goodbyes: " << goodbyes << "\n";
+ std::cout << "value of value: " << value << "\n";
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logException(error);
+ }
- try
- {
- std::string unknownProperty;
- sdbusplus::unpackProperties(
- properties, "UnknownPropertyName", unknownProperty);
+ try
+ {
+ std::string unknownProperty;
+ sdbusplus::unpackProperties(properties, "UnknownPropertyName",
+ unknownProperty);
- std::cerr << "Error: it should fail because of "
- "missing property\n";
- ++fatalErrors_;
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
+ std::cerr << "Error: it should fail because of "
+ "missing property\n";
+ ++fatalErrors_;
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
- try
- {
- uint32_t notMatchingType;
- sdbusplus::unpackProperties(
- properties, propertyGrettingName, notMatchingType);
+ try
+ {
+ uint32_t notMatchingType;
+ sdbusplus::unpackProperties(properties, propertyGrettingName,
+ notMatchingType);
- std::cerr << "Error: it should fail because of "
- "not matched type\n";
- ++fatalErrors_;
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
- });
+ std::cerr << "Error: it should fail because of "
+ "not matched type\n";
+ ++fatalErrors_;
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
+ });
}
private:
diff --git a/example/register-property.cpp b/example/register-property.cpp
index c22231a..e10b0f1 100644
--- a/example/register-property.cpp
+++ b/example/register-property.cpp
@@ -34,9 +34,9 @@
[this](const auto& newPropertyValue, const auto&) {
goodbyes_ = newPropertyValue;
return true;
- },
+ },
[this](const auto&) { return goodbyes_; });
- });
+ });
}
uint32_t fatalErrors() const
@@ -69,7 +69,7 @@
std::cerr << "Error: it was expected to fail getProperty due "
"to wrong type\n";
++fatalErrors_;
- });
+ });
}
void asyncReadProperties()
@@ -84,7 +84,7 @@
return;
}
std::cout << "Greetings value is: " << value << "\n";
- });
+ });
sdbusplus::asio::getProperty<std::string>(
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
@@ -96,7 +96,7 @@
return;
}
std::cout << "Goodbyes value is: " << value << "\n";
- });
+ });
}
void asyncChangeProperty()
@@ -114,7 +114,7 @@
std::cout << "Error: it was expected to fail to change greetings\n";
++fatalErrors_;
- });
+ });
sdbusplus::asio::setProperty(
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
@@ -130,7 +130,7 @@
}
std::cout << "Changed goodbyes property as expected\n";
boost::asio::post(ioc_, [this] { asyncReadProperties(); });
- });
+ });
}
void syncChangeGoodbyes(std::string_view value)
diff --git a/include/sdbusplus/asio/connection.hpp b/include/sdbusplus/asio/connection.hpp
index eed2827..62514ab 100644
--- a/include/sdbusplus/asio/connection.hpp
+++ b/include/sdbusplus/asio/connection.hpp
@@ -133,9 +133,9 @@
}();
using UnpackType = utility::strip_first_n_args_t<returnWithMsg ? 2 : 1,
FunctionTupleType>;
- auto applyHandler =
- [handler = std::forward<MessageHandler>(handler)](
- boost::system::error_code ec, message_t& r) mutable {
+ auto applyHandler = [handler = std::forward<MessageHandler>(handler)](
+ boost::system::error_code ec,
+ message_t& r) mutable {
UnpackType responseData;
if (!ec)
{
@@ -332,7 +332,7 @@
{
read_wait();
}
- });
+ });
}
void read_immediate()
{
diff --git a/include/sdbusplus/asio/property.hpp b/include/sdbusplus/asio/property.hpp
index 28e99c4..f5eebb9 100644
--- a/include/sdbusplus/asio/property.hpp
+++ b/include/sdbusplus/asio/property.hpp
@@ -67,7 +67,7 @@
handler(boost::system::errc::make_error_code(
boost::system::errc::invalid_argument),
{});
- },
+ },
service, path, "org.freedesktop.DBus.Properties", "Get", interface,
propertyName);
}
@@ -100,7 +100,7 @@
onError(boost::system::errc::make_error_code(
boost::system::errc::invalid_argument));
- },
+ },
service, path, "org.freedesktop.DBus.Properties", "Get", interface,
propertyName);
}
diff --git a/include/sdbusplus/async/proxy.hpp b/include/sdbusplus/async/proxy.hpp
index 4e00005..3bcb55c 100644
--- a/include/sdbusplus/async/proxy.hpp
+++ b/include/sdbusplus/async/proxy.hpp
@@ -133,9 +133,8 @@
// Use 'callback' to perform the operation and "then" "unpack" the
// contents.
- return callback(
- [bus = get_busp(ctx),
- msg = std::move(msg)](auto cb, auto data) mutable {
+ return callback([bus = get_busp(ctx),
+ msg = std::move(msg)](auto cb, auto data) mutable {
return sd_bus_call_async(bus, nullptr, msg.get(), cb, data, 0);
}) | execution::then([](message_t&& m) { return m.unpack<Rs...>(); });
}
diff --git a/include/sdbusplus/async/stdexec/any_sender_of.hpp b/include/sdbusplus/async/stdexec/any_sender_of.hpp
index fdadae7..391cd86 100644
--- a/include/sdbusplus/async/stdexec/any_sender_of.hpp
+++ b/include/sdbusplus/async/stdexec/any_sender_of.hpp
@@ -916,11 +916,11 @@
{
static __operation_vtable __vtable{
[](void* __object_pointer) noexcept -> void {
- STDEXEC_ASSERT(__object_pointer);
- _Op& __op = *static_cast<_Op*>(__object_pointer);
- static_assert(operation_state<_Op>);
- start(__op);
- }};
+ STDEXEC_ASSERT(__object_pointer);
+ _Op& __op = *static_cast<_Op*>(__object_pointer);
+ static_assert(operation_state<_Op>);
+ start(__op);
+ }};
return &__vtable;
}
};
@@ -1123,17 +1123,15 @@
__mtype<_Sender>{})},
[](void* __object_pointer, __receiver_ref_t __receiver)
-> __immovable_operation_storage {
- _Sender& __sender =
- *static_cast<_Sender*>(__object_pointer);
- using __op_state_t =
- connect_result_t<_Sender, __receiver_ref_t>;
- return __immovable_operation_storage{
- std::in_place_type<__op_state_t>, __conv{[&] {
- return stdexec::connect(
- (_Sender&&)__sender,
- (__receiver_ref_t&&)__receiver);
- }}};
- }};
+ _Sender& __sender = *static_cast<_Sender*>(__object_pointer);
+ using __op_state_t =
+ connect_result_t<_Sender, __receiver_ref_t>;
+ return __immovable_operation_storage{
+ std::in_place_type<__op_state_t>, __conv{[&] {
+ return stdexec::connect((_Sender&&)__sender,
+ (__receiver_ref_t&&)__receiver);
+ }}};
+ }};
return &__vtable_;
}
};
@@ -1246,20 +1244,20 @@
{*__create_vtable(__mtype<__query_vtable<_SchedulerQueries>>{},
__mtype<_Scheduler>{})},
[](void* __object_pointer) noexcept -> __sender_t {
- const _Scheduler& __scheduler =
- *static_cast<const _Scheduler*>(__object_pointer);
- return __sender_t{schedule(__scheduler)};
- },
+ const _Scheduler& __scheduler =
+ *static_cast<const _Scheduler*>(__object_pointer);
+ return __sender_t{schedule(__scheduler)};
+ },
[](const void* __self, const void* __other) noexcept -> bool {
- static_assert(noexcept(__declval<const _Scheduler&>() ==
- __declval<const _Scheduler&>()));
- STDEXEC_ASSERT(__self && __other);
- const _Scheduler& __self_scheduler =
- *static_cast<const _Scheduler*>(__self);
- const _Scheduler& __other_scheduler =
- *static_cast<const _Scheduler*>(__other);
- return __self_scheduler == __other_scheduler;
- }};
+ static_assert(noexcept(__declval<const _Scheduler&>() ==
+ __declval<const _Scheduler&>()));
+ STDEXEC_ASSERT(__self && __other);
+ const _Scheduler& __self_scheduler =
+ *static_cast<const _Scheduler*>(__self);
+ const _Scheduler& __other_scheduler =
+ *static_cast<const _Scheduler*>(__other);
+ return __self_scheduler == __other_scheduler;
+ }};
return &__vtable_;
}
};
diff --git a/include/sdbusplus/async/stdexec/async_scope.hpp b/include/sdbusplus/async/stdexec/async_scope.hpp
index 12a19db..d806fc1 100644
--- a/include/sdbusplus/async/stdexec/async_scope.hpp
+++ b/include/sdbusplus/async/stdexec/async_scope.hpp
@@ -356,10 +356,10 @@
__guard.unlock();
tag((_Receiver&&)__rcvr_, (_As&&)__as...);
__guard.lock();
- },
+ },
__tup);
}
- },
+ },
__state->__data_);
}
}
@@ -422,8 +422,8 @@
std::unique_ptr<__future_state<_Sender, _Env>> __state) :
__subscription{{},
[](__subscription* __self) noexcept -> void {
- static_cast<__future_op*>(__self)->__complete_();
- }},
+ static_cast<__future_op*>(__self)->__complete_();
+ }},
__rcvr_((_Receiver2&&)__rcvr), __state_(std::move(__state)),
__forward_consumer_(get_stop_token(get_env(__rcvr_)),
__forward_stopped{&__state_->__stop_source_})
@@ -752,9 +752,9 @@
with(get_stop_token, __scope->__stop_source_.get_token())),
[](__spawn_op_base<_EnvId>* __op) {
delete static_cast<__spawn_op*>(__op);
- }},
- __op_(stdexec::connect((_Sndr&&)__sndr,
- __spawn_receiver_t<_Env>{this, __scope}))
+ }},
+ __op_(stdexec::connect((_Sndr&&)__sndr,
+ __spawn_receiver_t<_Env>{this, __scope}))
{}
void __start_() noexcept
diff --git a/include/sdbusplus/async/stdexec/execution.hpp b/include/sdbusplus/async/stdexec/execution.hpp
index 981de5d..1a81553 100644
--- a/include/sdbusplus/async/stdexec/execution.hpp
+++ b/include/sdbusplus/async/stdexec/execution.hpp
@@ -559,7 +559,7 @@
// P2300R7.
template <class _EnvProvider>
constexpr decltype(auto)
- operator()(const _EnvProvider& __with_env) const noexcept
+ operator()(const _EnvProvider & __with_env) const noexcept
{
if constexpr (!enable_sender<_EnvProvider>)
{
@@ -1659,7 +1659,9 @@
concept tag_category = //
requires {
typename __mbool<bool{_Predicate(_Tag{})}>;
- requires bool{_Predicate(_Tag{})};
+ requires bool {
+ _Predicate(_Tag{})
+ };
};
/////////////////////////////////////////////////////////////////////////////
@@ -2497,8 +2499,8 @@
(_CvrefReceiver&&)__rcvr,
[](__operation_base<_ReceiverId>* __self) noexcept {
delete static_cast<__operation*>(__self);
- }},
- __op_state_(connect((_Sender&&)__sndr, __receiver_t<_ReceiverId>{this}))
+ }},
+ __op_state_(connect((_Sender&&)__sndr, __receiver_t<_ReceiverId>{this}))
{}
};
@@ -2679,7 +2681,7 @@
std::apply(
[&__op_state](_Ts&... __ts) {
_Tag{}((_Receiver&&)__op_state.__rcvr_, (_Ts&&)__ts...);
- },
+ },
__op_state.__vals_);
}
};
@@ -2939,7 +2941,7 @@
return std::apply(
[&__sndr, this](_As&... __as) {
return ((_Fun&&)__fun_)((_Sender&&)__sndr, (_As&&)__as...);
- },
+ },
__as_);
}
@@ -2953,7 +2955,7 @@
return std::apply(
[&__sndr, this](const _As&... __as) {
return __fun_((_Sender&&)__sndr, __as...);
- },
+ },
__as_);
}
};
@@ -3124,9 +3126,10 @@
template <same_as<set_value_t> _SetValue, class _Dp = _Derived,
class... _As>
- requires _MISSING_MEMBER(_Dp, set_value) &&
- tag_invocable<_SetValue, __base_t<_Dp>, _As...>
- STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
+ requires _MISSING_MEMBER
+ (_Dp, set_value) &&
+ tag_invocable<_SetValue, __base_t<_Dp>,
+ _As...> STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
friend void tag_invoke(_SetValue, _Derived&& __self,
_As&&... __as) noexcept
{
@@ -3149,9 +3152,10 @@
template <same_as<set_error_t> _SetError, class _Error,
class _Dp = _Derived>
- requires _MISSING_MEMBER(_Dp, set_error) &&
- tag_invocable<_SetError, __base_t<_Dp>, _Error>
- STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
+ requires _MISSING_MEMBER
+ (_Dp, set_error) &&
+ tag_invocable<_SetError, __base_t<_Dp>,
+ _Error> STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
friend void tag_invoke(_SetError, _Derived&& __self,
_Error&& __err) noexcept
{
@@ -3172,9 +3176,10 @@
}
template <same_as<set_stopped_t> _SetStopped, class _Dp = _Derived>
- requires _MISSING_MEMBER(_Dp, set_stopped) &&
- tag_invocable<_SetStopped, __base_t<_Dp>>
- STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
+ requires _MISSING_MEMBER
+ (_Dp, set_stopped) &&
+ tag_invocable<_SetStopped,
+ __base_t<_Dp>> STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
friend void tag_invoke(_SetStopped, _Derived&& __self) noexcept
{
stdexec::set_stopped(__get_base((_Derived&&)__self));
@@ -3192,8 +3197,8 @@
}
template <same_as<get_env_t> _GetEnv, class _Dp = _Derived>
- requires _MISSING_MEMBER(_Dp, get_env)
- STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
+ requires _MISSING_MEMBER
+ (_Dp, get_env) STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
friend auto tag_invoke(_GetEnv, const _Derived& __self) noexcept
-> env_of_t<__base_t<const _Dp&>>
{
@@ -3356,8 +3361,8 @@
__t(_Sender&& __sndr, _Receiver __rcvr, _Fun __fun) //
noexcept(__nothrow_decay_copyable<_Receiver> //
- && __nothrow_decay_copyable<_Fun> //
- && __nothrow_connectable<_Sender, __receiver_t>) :
+ && __nothrow_decay_copyable<_Fun> //
+ && __nothrow_connectable<_Sender, __receiver_t>) :
__data_{(_Receiver&&)__rcvr, (_Fun&&)__fun},
__op_(connect((_Sender&&)__sndr, __receiver_t{&__data_}))
{}
@@ -4158,13 +4163,12 @@
std::visit(
[&](const auto& __tupl) noexcept -> void {
- std::apply(
- [&](auto __tag,
- const auto&... __args) noexcept -> void {
- __tag((_Receiver&&)__op->__rcvr_, __args...);
- },
- __tupl);
+ std::apply(
+ [&](auto __tag, const auto&... __args) noexcept -> void {
+ __tag((_Receiver&&)__op->__rcvr_, __args...);
},
+ __tupl);
+ },
__op->__shared_state_->__data_);
}
@@ -4529,13 +4533,12 @@
std::visit(
[&](auto& __tupl) noexcept -> void {
- std::apply(
- [&](auto __tag, auto&... __args) noexcept -> void {
- __tag((_Receiver&&)__op->__rcvr_,
- std::move(__args)...);
- },
- __tupl);
+ std::apply(
+ [&](auto __tag, auto&... __args) noexcept -> void {
+ __tag((_Receiver&&)__op->__rcvr_, std::move(__args)...);
},
+ __tupl);
+ },
__op->__shared_state_->__data_);
}
@@ -4835,13 +4838,12 @@
__self.__op_state_->__args_.template emplace<__tuple_t>(
(_As&&)__as...);
auto& __op = __self.__op_state_->__op_state3_
- .template emplace<__op_state_t>(__conv{
- [&] {
+ .template emplace<__op_state_t>(__conv{[&] {
return connect(
std::apply(std::move(__self.__op_state_->__fun_),
__args),
std::move(__self.__op_state_->__rcvr_));
- }});
+ }});
start(__op);
}
catch (...)
@@ -5198,7 +5200,7 @@
[__err2 = (_Error&&)__err]() mutable //
noexcept(std::is_nothrow_move_constructible_v<_Error>) {
return just_error((_Error&&)__err2);
- });
+ });
}
template <__movable_value _Error>
@@ -5639,21 +5641,21 @@
STDEXEC_ASSERT(!__data_.valueless_by_exception());
std::visit(
[&]<class _Tup>(_Tup& __tupl) -> void {
- if constexpr (same_as<_Tup, std::monostate>)
- {
- std::terminate(); // reaching this indicates a bug in
- // schedule_from
- }
- else
- {
- std::apply(
- [&]<class... _Args>(auto __tag,
- _Args&... __args) -> void {
- __tag((_Receiver&&)__rcvr_, (_Args&&)__args...);
- },
- __tupl);
- }
- },
+ if constexpr (same_as<_Tup, std::monostate>)
+ {
+ std::terminate(); // reaching this indicates a bug in
+ // schedule_from
+ }
+ else
+ {
+ std::apply(
+ [&]<class... _Args>(auto __tag,
+ _Args&... __args) -> void {
+ __tag((_Receiver&&)__rcvr_, (_Args&&)__args...);
+ },
+ __tupl);
+ }
+ },
__data_);
}
};
@@ -5916,9 +5918,9 @@
// This line will invalidate *this:
start(__op_state->__data_.template emplace<1>(
__conv{[__op_state] {
- return connect((_Sender&&)__op_state->__sndr_,
- __receiver_ref_t{{}, __op_state});
- }}));
+ return connect((_Sender&&)__op_state->__sndr_,
+ __receiver_ref_t{{}, __op_state});
+ }}));
}
catch (...)
{
@@ -5953,10 +5955,9 @@
__t(_Scheduler __sched, _Sender2&& __sndr, _Receiver2&& __rcvr) :
__scheduler_((_Scheduler&&)__sched), __sndr_((_Sender2&&)__sndr),
__rcvr_((_Receiver2&&)__rcvr),
- __data_{std::in_place_index<0>, __conv{
- [this] {
+ __data_{std::in_place_index<0>, __conv{[this] {
return connect(schedule(__scheduler_), __receiver_t{{}, this});
- }}}
+ }}}
{}
STDEXEC_IMMOVABLE(__t);
@@ -6256,8 +6257,8 @@
auto __make_env(_Env&& __env, in_place_stop_source& __stop_source) noexcept
{
return __env::__join_env(__env::__env_fn{[&](get_stop_token_t) noexcept {
- return __stop_source.get_token();
- }},
+ return __stop_source.get_token();
+ }},
(_Env&&)__env);
}
@@ -6355,9 +6356,9 @@
{
std::apply(
[&](auto&... __opt_vals) noexcept -> void {
- std::apply(__complete_fn{set_value, __rcvr},
- std::tuple_cat(std::apply(__tie_fn{}, *__opt_vals)...));
- },
+ std::apply(__complete_fn{set_value, __rcvr},
+ std::tuple_cat(std::apply(__tie_fn{}, *__opt_vals)...));
+ },
__values);
}
@@ -6632,9 +6633,9 @@
std::index_sequence<_Is...>) :
__operation_base_t{{}, (_Receiver&&)__rcvr, {sizeof...(_Is)}},
__op_states_{__conv{[&__sndrs, this]() {
- return stdexec::connect(std::get<_Is>((_SendersTuple&&)__sndrs),
- __receiver_t<_Is>{this});
- }}...}
+ return stdexec::connect(std::get<_Is>((_SendersTuple&&)__sndrs),
+ __receiver_t<_Is>{this});
+ }}...}
{}
template <class _SendersTuple>
@@ -6658,8 +6659,8 @@
{
std::apply(
[](auto&... __child_ops) noexcept -> void {
- (stdexec::start(__child_ops), ...);
- },
+ (stdexec::start(__child_ops), ...);
+ },
__self.__op_states_);
if constexpr (sizeof...(_SenderIds) == 0)
{
diff --git a/include/sdbusplus/async/stdexec/task.hpp b/include/sdbusplus/async/stdexec/task.hpp
index 9f0606d..c2da093 100644
--- a/include/sdbusplus/async/stdexec/task.hpp
+++ b/include/sdbusplus/async/stdexec/task.hpp
@@ -549,7 +549,7 @@
}
// Make this task generally awaitable:
- friend __task_awaitable<> operator co_await(basic_task&& __self) noexcept
+ friend __task_awaitable<> operator co_await(basic_task && __self) noexcept
requires __valid<awaiter_context_t, __promise>
{
return __task_awaitable<>{std::exchange(__self.__coro_, {})};
diff --git a/include/sdbusplus/timer.hpp b/include/sdbusplus/timer.hpp
index 2401763..c9777c6 100644
--- a/include/sdbusplus/timer.hpp
+++ b/include/sdbusplus/timer.hpp
@@ -180,7 +180,7 @@
void* userData) {
auto timer = static_cast<Timer*>(userData);
return timer->timeoutHandler();
- }, // Callback handler on timeout
+ }, // Callback handler on timeout
this); // User data
if (r < 0)
{
diff --git a/include/sdbusplus/unpack_properties.hpp b/include/sdbusplus/unpack_properties.hpp
index f232130..2183ace 100644
--- a/include/sdbusplus/unpack_properties.hpp
+++ b/include/sdbusplus/unpack_properties.hpp
@@ -23,10 +23,9 @@
const std::vector<std::pair<std::string, VariantType>>& container,
const std::string& key) noexcept
{
- return std::find_if(container.begin(), container.end(),
- [&key](const auto& keyValue) {
- return keyValue.first == key;
- });
+ return std::find_if(
+ container.begin(), container.end(),
+ [&key](const auto& keyValue) { return keyValue.first == key; });
}
template <typename OnErrorCallback, typename VariantType, typename ValueType>
@@ -147,7 +146,7 @@
details::unpackPropertiesCommon(
[](const UnpackErrorReason reason, const std::string& property) {
throw exception::UnpackPropertyError(property, reason);
- },
+ },
input, std::forward<Args>(args)...);
}
diff --git a/src/async/match.cpp b/src/async/match.cpp
index 7dceba4..9ac3cd0 100644
--- a/src/async/match.cpp
+++ b/src/async/match.cpp
@@ -6,8 +6,8 @@
slot_t match::makeMatch(context& ctx, const std::string_view& pattern)
{
// C-style callback to redirect into this::handle_match.
- static auto match_cb =
- [](message::msgp_t msg, void* ctx, sd_bus_error*) noexcept {
+ static auto match_cb = [](message::msgp_t msg, void* ctx,
+ sd_bus_error*) noexcept {
static_cast<match*>(ctx)->handle_match(message_t{msg});
return 0;
};
diff --git a/test/bus/match.cpp b/test/bus/match.cpp
index d925c7a..049e033 100644
--- a/test/bus/match.cpp
+++ b/test/bus/match.cpp
@@ -29,8 +29,8 @@
TEST_F(Match, FunctorIs_sd_bus_message_handler_t)
{
bool triggered = false;
- auto trigger =
- [](sd_bus_message* /*m*/, void* context, sd_bus_error* /*e*/) {
+ auto trigger = [](sd_bus_message* /*m*/, void* context,
+ sd_bus_error* /*e*/) {
*static_cast<bool*>(context) = true;
return 0;
};
diff --git a/test/message/call.cpp b/test/message/call.cpp
index 69c8d43..586677f 100644
--- a/test/message/call.cpp
+++ b/test/message/call.cpp
@@ -94,7 +94,7 @@
[&](message&&) { throw std::runtime_error("testerror"); });
b.wait(1s);
b.process_discard();
- }(),
+ }(),
"testerror");
}
diff --git a/test/unpack_properties.cpp b/test/unpack_properties.cpp
index 3ed04ca..5ba9b46 100644
--- a/test/unpack_properties.cpp
+++ b/test/unpack_properties.cpp
@@ -35,7 +35,7 @@
[&error](sdbusplus::UnpackErrorReason reason,
const std::string& property) {
error.emplace(reason, property);
- },
+ },
std::forward<Args>(args)...);
return error;
}
diff --git a/test/vtable/vtable.cpp b/test/vtable/vtable.cpp
index abb27d6..092f5cf 100644
--- a/test/vtable/vtable.cpp
+++ b/test/vtable/vtable.cpp
@@ -4,17 +4,16 @@
extern "C"
{
- int test_handler(sd_bus_message* m, void* userdata,
- sd_bus_error* ret_error);
- int test_get(sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* userdata,
- sd_bus_error* ret_error);
- int test_set(sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* userdata,
- sd_bus_error* ret_error);
+int test_handler(sd_bus_message* m, void* userdata, sd_bus_error* ret_error);
+int test_get(sd_bus* bus, const char* path, const char* interface,
+ const char* property, sd_bus_message* reply, void* userdata,
+ sd_bus_error* ret_error);
+int test_set(sd_bus* bus, const char* path, const char* interface,
+ const char* property, sd_bus_message* value, void* userdata,
+ sd_bus_error* ret_error);
- extern const sd_bus_vtable example2[];
- extern const size_t example2_size;
+extern const sd_bus_vtable example2[];
+extern const size_t example2_size;
}
static const sdbusplus::vtable_t example[] = {