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/libipmid/utils.cpp b/libipmid/utils.cpp
index 81cc4c4..fb96ea6 100644
--- a/libipmid/utils.cpp
+++ b/libipmid/utils.cpp
@@ -39,10 +39,9 @@
// Currently mapper doesn't give the readable busname(gives busid) so we can't
// use busname to find the object,will do later once the support is there.
-DbusObjectInfo getDbusObject(sdbusplus::bus_t& bus,
- const std::string& interface,
- const std::string& serviceRoot,
- const std::string& match)
+DbusObjectInfo
+ getDbusObject(sdbusplus::bus_t& bus, const std::string& interface,
+ const std::string& serviceRoot, const std::string& match)
{
std::vector<DbusInterface> interfaces;
interfaces.emplace_back(interface);
@@ -67,10 +66,10 @@
}
// else search the match string in the object path
- auto found = std::find_if(objectTree.begin(), objectTree.end(),
- [&match](const auto& object) {
- return (object.first.find(match) != std::string::npos);
- });
+ auto found = std::find_if(
+ objectTree.begin(), objectTree.end(), [&match](const auto& object) {
+ return (object.first.find(match) != std::string::npos);
+ });
if (found == objectTree.end())
{
@@ -101,11 +100,10 @@
return value;
}
-PropertyMap getAllDbusProperties(sdbusplus::bus_t& bus,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- std::chrono::microseconds timeout)
+PropertyMap getAllDbusProperties(
+ sdbusplus::bus_t& bus, const std::string& service,
+ const std::string& objPath, const std::string& interface,
+ std::chrono::microseconds timeout)
{
PropertyMap properties;
@@ -181,9 +179,8 @@
cachedService = std::nullopt;
}
-sdbusplus::message_t ServiceCache::newMethodCall(sdbusplus::bus_t& bus,
- const char* intf,
- const char* method)
+sdbusplus::message_t ServiceCache::newMethodCall(
+ sdbusplus::bus_t& bus, const char* intf, const char* method)
{
return bus.new_method_call(getService(bus).c_str(), path.c_str(), intf,
method);
@@ -197,10 +194,10 @@
std::string getService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path)
{
- auto mapperCall = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetObject");
+ auto mapperCall =
+ bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetObject");
mapperCall.append(path);
mapperCall.append(std::vector<std::string>({intf}));
@@ -233,10 +230,9 @@
return objectTree;
}
-ipmi::ObjectTree getAllDbusObjects(sdbusplus::bus_t& bus,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match)
+ipmi::ObjectTree
+ getAllDbusObjects(sdbusplus::bus_t& bus, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match)
{
std::vector<std::string> interfaces;
interfaces.emplace_back(interface);
@@ -331,9 +327,9 @@
/********* Begin co-routine yielding alternatives ***************/
-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)
{
boost::system::error_code ec;
std::map<std::string, std::vector<std::string>> mapperResponse =
@@ -350,10 +346,9 @@
return ec;
}
-boost::system::error_code getSubTree(Context::ptr ctx,
- const InterfaceList& interfaces,
- const std::string& subtreePath,
- int32_t depth, ObjectTree& objectTree)
+boost::system::error_code getSubTree(
+ Context::ptr ctx, const InterfaceList& interfaces,
+ const std::string& subtreePath, int32_t depth, ObjectTree& objectTree)
{
boost::system::error_code ec;
objectTree = ctx->bus->yield_method_call<ObjectTree>(
@@ -363,19 +358,18 @@
return ec;
}
-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)
{
std::vector<DbusInterface> interfaces;
interfaces.emplace_back(interface);
auto depth = 0;
ObjectTree objectTree;
- boost::system::error_code ec = getSubTree(ctx, interfaces, subtreePath,
- depth, objectTree);
+ boost::system::error_code ec =
+ getSubTree(ctx, interfaces, subtreePath, depth, objectTree);
if (ec)
{
@@ -402,10 +396,10 @@
}
// else search the match string in the object path
- auto found = std::find_if(objectTree.begin(), objectTree.end(),
- [&match](const auto& object) {
- return (object.first.find(match) != std::string::npos);
- });
+ auto found = std::find_if(
+ objectTree.begin(), objectTree.end(), [&match](const auto& object) {
+ return (object.first.find(match) != std::string::npos);
+ });
if (found == objectTree.end())
{
@@ -423,11 +417,9 @@
return ec;
}
-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)
{
boost::system::error_code ec;
properties = ctx->bus->yield_method_call<PropertyMap>(
@@ -448,18 +440,17 @@
return ec;
}
-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)
{
std::vector<std::string> interfaces;
interfaces.emplace_back(interface);
auto depth = 0;
- boost::system::error_code ec = getSubTree(ctx, interfaces, serviceRoot,
- depth, objectTree);
+ boost::system::error_code ec =
+ getSubTree(ctx, interfaces, serviceRoot, depth, objectTree);
if (ec)
{
return ec;
@@ -480,10 +471,9 @@
return ec;
}
-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)
{
ObjectTree objectTree;
boost::system::error_code ec =
@@ -512,10 +502,9 @@
return ec;
}
-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)
{
boost::system::error_code ec;
objects = ctx->bus->yield_method_call<ipmi::ObjectValueTree>(
@@ -524,10 +513,9 @@
return ec;
}
-boost::system::error_code getAllAncestors(Context::ptr ctx,
- const std::string& path,
- const InterfaceList& interfaces,
- ObjectTree& objectTree)
+boost::system::error_code
+ getAllAncestors(Context::ptr ctx, const std::string& path,
+ const InterfaceList& interfaces, ObjectTree& objectTree)
{
std::string interfaceList = convertToString(interfaces);
@@ -552,11 +540,9 @@
return ec;
}
-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)
{
boost::system::error_code ec;
ctx->bus->yield_method_call(ctx->yield, ec, service, objPath, interface,