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: I01547e98d27910919e09ebf7907c86292a6c825d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/include/ipmid/message.hpp b/include/ipmid/message.hpp
index 64f7777..5264112 100644
--- a/include/ipmid/message.hpp
+++ b/include/ipmid/message.hpp
@@ -47,10 +47,9 @@
uint8_t lun, Cmd cmd, int channel, int userId, uint32_t sessionId,
Privilege priv, int rqSA, int hostIdx,
boost::asio::yield_context& yield) :
- bus(bus),
- netFn(netFn), lun(lun), cmd(cmd), channel(channel), userId(userId),
- sessionId(sessionId), priv(priv), rqSA(rqSA), hostIdx(hostIdx),
- yield(yield)
+ bus(bus), netFn(netFn), lun(lun), cmd(cmd), channel(channel),
+ userId(userId), sessionId(sessionId), priv(priv), rqSA(rqSA),
+ hostIdx(hostIdx), yield(yield)
{}
std::shared_ptr<sdbusplus::asio::connection> bus;
@@ -256,8 +255,8 @@
template <typename Arg, typename... Args>
int pack(Arg&& arg, Args&&... args)
{
- int packRet = details::PackSingle_t<Arg>::op(*this,
- std::forward<Arg>(arg));
+ int packRet =
+ details::PackSingle_t<Arg>::op(*this, std::forward<Arg>(arg));
if (packRet)
{
return packRet;
@@ -464,8 +463,8 @@
size_t priorIndex = rawIndex;
fixed_uint_t<details::bitStreamSize> priorBits = bitStream;
- int ret = std::apply([this](Types&... args) { return unpack(args...); },
- t);
+ int ret =
+ std::apply([this](Types&... args) { return unpack(args...); }, t);
if (ret)
{
bitCount = priorBitCount;
diff --git a/include/ipmid/message/pack.hpp b/include/ipmid/message/pack.hpp
index 00fcf46..5ca94b6 100644
--- a/include/ipmid/message/pack.hpp
+++ b/include/ipmid/message/pack.hpp
@@ -310,8 +310,8 @@
{
return std::visit(
[&p](const auto& arg) {
- return PackSingle<std::decay_t<decltype(arg)>>::op(p, arg);
- },
+ return PackSingle<std::decay_t<decltype(arg)>>::op(p, arg);
+ },
v);
}
};
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 7b26b6f..aacfb18 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -147,14 +147,14 @@
inline Mutability operator|(Mutability lhs, Mutability rhs)
{
- return static_cast<Mutability>(static_cast<uint8_t>(lhs) |
- static_cast<uint8_t>(rhs));
+ return static_cast<Mutability>(
+ static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
}
inline Mutability operator&(Mutability lhs, Mutability rhs)
{
- return static_cast<Mutability>(static_cast<uint8_t>(lhs) &
- static_cast<uint8_t>(rhs));
+ return static_cast<Mutability>(
+ static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
}
struct Info
@@ -289,7 +289,7 @@
{
public:
using SecureStringBase::basic_string;
- SecureString(const SecureStringBase& other) : SecureStringBase(other){};
+ SecureString(const SecureStringBase& other) : SecureStringBase(other) {};
SecureString(SecureString&) = default;
SecureString(const SecureString&) = default;
SecureString(SecureString&&) = default;
@@ -308,7 +308,7 @@
{
public:
using SecureBufferBase::vector;
- SecureBuffer(const SecureBufferBase& other) : SecureBufferBase(other){};
+ SecureBuffer(const SecureBufferBase& other) : SecureBufferBase(other) {};
SecureBuffer(SecureBuffer&) = default;
SecureBuffer(const SecureBuffer&) = default;
SecureBuffer(SecureBuffer&&) = default;
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index dd1eaa0..f31a532 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -120,10 +120,9 @@
* @param[in] match - identifier for object.
* @return On success returns the object having objectpath and servicename.
*/
-DbusObjectInfo getDbusObject(sdbusplus::bus_t& bus,
- const std::string& interface,
- const std::string& subtreePath = ROOT,
- const std::string& match = {});
+DbusObjectInfo getDbusObject(
+ sdbusplus::bus_t& bus, const std::string& interface,
+ const std::string& subtreePath = ROOT, const std::string& match = {});
/** @brief Gets the value associated with the given object
* and the interface.
@@ -147,11 +146,10 @@
* @param[in] interface - Dbus interface.
* @return On success returns the map of name value pair.
*/
-PropertyMap
- getAllDbusProperties(sdbusplus::bus_t& bus, const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
+PropertyMap getAllDbusProperties(
+ sdbusplus::bus_t& bus, const std::string& service,
+ const std::string& objPath, const std::string& interface,
+ std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
/** @brief Gets all managed objects associated with the given object
* path and service.
@@ -185,10 +183,9 @@
* @param[in] match - Identifier for a path.
* @returns map of object path and service info.
*/
-ObjectTree getAllDbusObjects(sdbusplus::bus_t& bus,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match = {});
+ObjectTree getAllDbusObjects(
+ sdbusplus::bus_t& bus, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match = {});
/** @brief Deletes all the dbus objects from the given service root
which matches the object identifier.
@@ -224,9 +221,9 @@
* @return boost error code
*
*/
-boost::system::error_code getService(Context::ptr ctx, const std::string& intf,
- const std::string& path,
- std::string& service);
+boost::system::error_code
+ getService(Context::ptr ctx, const std::string& intf,
+ const std::string& path, std::string& service);
/** @brief Gets the dbus sub tree implementing the given interface.
* @param[in] ctx - ipmi::Context::ptr
@@ -237,10 +234,9 @@
* @param[out] objectTree - map of object path and service info.
* @return map of object path and service info.
*/
-boost::system::error_code getSubTree(Context::ptr ctx,
- const InterfaceList& interface,
- const std::string& subtreePath,
- int32_t depth, ObjectTree& objectTree);
+boost::system::error_code getSubTree(
+ Context::ptr ctx, const InterfaceList& interface,
+ const std::string& subtreePath, int32_t depth, ObjectTree& objectTree);
/** @brief Gets the D-Bus object info implementing the given interface
* from the given subtree.
@@ -251,16 +247,14 @@
* @param[out] D-Bus object with path and service name
* @return - boost error code object
*/
-boost::system::error_code getDbusObject(Context::ptr ctx,
- const std::string& interface,
- const std::string& subtreePath,
- const std::string& match,
- DbusObjectInfo& dbusObject);
+boost::system::error_code
+ getDbusObject(Context::ptr ctx, const std::string& interface,
+ const std::string& subtreePath, const std::string& match,
+ DbusObjectInfo& dbusObject);
// default for ROOT for subtreePath and std::string{} for match
-static inline boost::system::error_code
- getDbusObject(Context::ptr ctx, const std::string& interface,
- DbusObjectInfo& dbusObject)
+static inline boost::system::error_code getDbusObject(
+ Context::ptr ctx, const std::string& interface, DbusObjectInfo& dbusObject)
{
return getDbusObject(ctx, interface, ROOT, {}, dbusObject);
}
@@ -317,11 +311,9 @@
* @param[out] properties - map of name value pair.
* @return - boost error code object
*/
-boost::system::error_code getAllDbusProperties(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- PropertyMap& properties);
+boost::system::error_code getAllDbusProperties(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, PropertyMap& properties);
/** @brief Sets the property value of the given object.
* @param[in] ctx - ipmi::Context::ptr
@@ -346,11 +338,10 @@
* @param[out] objectree - map of object path and service info.
* @return - boost error code object
*/
-boost::system::error_code getAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match,
- ObjectTree& objectTree);
+boost::system::error_code
+ getAllDbusObjects(Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match,
+ ObjectTree& objectTree);
// default std::string{} for match
static inline boost::system::error_code
@@ -368,10 +359,9 @@
* @param[in] interface - D-Bus interface.
* @param[in] match - Identifier for object.
*/
-boost::system::error_code deleteAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match = {})
+boost::system::error_code deleteAllDbusObjects(
+ Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match = {})
__attribute__((deprecated));
/** @brief Gets all managed objects associated with the given object
@@ -382,10 +372,9 @@
* @param[out] objects - map of name value pair.
* @return - boost error code object
*/
-boost::system::error_code getManagedObjects(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- ObjectValueTree& objects);
+boost::system::error_code
+ getManagedObjects(Context::ptr ctx, const std::string& service,
+ const std::string& objPath, ObjectValueTree& objects);
/** @brief Gets the ancestor objects of the given object
which implements the given interface.
@@ -410,11 +399,9 @@
* @return - boost error code object
*/
-boost::system::error_code callDbusMethod(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- const std::string& method);
+boost::system::error_code callDbusMethod(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& method);
/********* End co-routine yielding alternatives ***************/