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: Ib7af6345a7b9e858700bd81645fe87d9d7e9d0fb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index 5f0222d..2fe295d 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -57,9 +57,8 @@
return nvmeDeviceMap;
}
-static std::optional<int>
- extractBusNumber(const std::string& path,
- const SensorBaseConfigMap& properties)
+static std::optional<int> extractBusNumber(
+ const std::string& path, const SensorBaseConfigMap& properties)
{
auto findBus = properties.find("Bus");
if (findBus == properties.end())
@@ -86,9 +85,8 @@
return std::visit(VariantToUnsignedIntVisitor(), findSlaveAddr->second);
}
-static std::optional<std::string>
- extractSensorName(const std::string& path,
- const SensorBaseConfigMap& properties)
+static std::optional<std::string> extractSensorName(
+ const std::string& path, const SensorBaseConfigMap& properties)
{
auto findSensorName = properties.find("Name");
if (findSensorName == properties.end())
@@ -132,9 +130,8 @@
return std::stoi(rootName.substr(0, dash));
}
-static std::shared_ptr<NVMeContext>
- provideRootBusContext(boost::asio::io_context& io, NVMEMap& map,
- int rootBus)
+static std::shared_ptr<NVMeContext> provideRootBusContext(
+ boost::asio::io_context& io, NVMEMap& map, int rootBus)
{
auto findRoot = map.find(rootBus);
if (findRoot != map.end())
@@ -176,10 +173,10 @@
}
const SensorBaseConfigMap& sensorConfig = sensorBase->second;
- std::optional<int> busNumber = extractBusNumber(interfacePath,
- sensorConfig);
- std::optional<std::string> sensorName = extractSensorName(interfacePath,
- sensorConfig);
+ std::optional<int> busNumber =
+ extractBusNumber(interfacePath, sensorConfig);
+ std::optional<std::string> sensorName =
+ extractSensorName(interfacePath, sensorConfig);
uint8_t slaveAddr = extractSlaveAddr(interfacePath, sensorConfig);
std::optional<int> rootBus = deriveRootBus(busNumber);
@@ -231,9 +228,9 @@
auto getter = std::make_shared<GetSensorConfiguration>(
dbusConnection, [&io, &objectServer, &dbusConnection](
const ManagedObjectType& sensorConfigurations) {
- handleSensorConfigurations(io, objectServer, dbusConnection,
- sensorConfigurations);
- });
+ handleSensorConfigurations(io, objectServer, dbusConnection,
+ sensorConfigurations);
+ });
getter->getConfiguration(std::vector<std::string>{NVMeSensor::sensorType});
}
@@ -284,24 +281,24 @@
boost::asio::steady_timer filterTimer(io);
std::function<void(sdbusplus::message_t&)> eventHandler =
[&filterTimer, &io, &objectServer, &systemBus](sdbusplus::message_t&) {
- // this implicitly cancels the timer
- filterTimer.expires_after(std::chrono::seconds(1));
+ // this implicitly cancels the timer
+ filterTimer.expires_after(std::chrono::seconds(1));
- filterTimer.async_wait([&](const boost::system::error_code& ec) {
- if (ec == boost::asio::error::operation_aborted)
- {
- return; // we're being canceled
- }
+ filterTimer.async_wait([&](const boost::system::error_code& ec) {
+ if (ec == boost::asio::error::operation_aborted)
+ {
+ return; // we're being canceled
+ }
- if (ec)
- {
- std::cerr << "Error: " << ec.message() << "\n";
- return;
- }
+ if (ec)
+ {
+ std::cerr << "Error: " << ec.message() << "\n";
+ return;
+ }
- createSensors(io, objectServer, systemBus);
- });
- };
+ createSensors(io, objectServer, systemBus);
+ });
+ };
std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches =
setupPropertiesChangedMatches(
@@ -315,8 +312,8 @@
"type='signal',member='InterfacesRemoved',arg0path='" +
std::string(inventoryPath) + "/'",
[](sdbusplus::message_t& msg) {
- interfaceRemoved(msg, nvmeDeviceMap);
- });
+ interfaceRemoved(msg, nvmeDeviceMap);
+ });
setupManufacturingModeMatch(*systemBus);
io.run();