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: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp
index 842cbe6..81303e5 100644
--- a/include/obmc_console.hpp
+++ b/include/obmc_console.hpp
@@ -27,8 +27,7 @@
public:
ConsoleHandler(boost::asio::io_context& ioc,
crow::websocket::Connection& connIn) :
- hostSocket(ioc),
- conn(connIn)
+ hostSocket(ioc), conn(connIn)
{}
~ConsoleHandler() = default;
@@ -57,27 +56,28 @@
boost::asio::buffer(inputBuffer.data(), inputBuffer.size()),
[weak(weak_from_this())](const boost::beast::error_code& ec,
std::size_t bytesWritten) {
- std::shared_ptr<ConsoleHandler> self = weak.lock();
- if (self == nullptr)
- {
- return;
- }
+ std::shared_ptr<ConsoleHandler> self = weak.lock();
+ if (self == nullptr)
+ {
+ return;
+ }
- self->doingWrite = false;
- self->inputBuffer.erase(0, bytesWritten);
+ self->doingWrite = false;
+ self->inputBuffer.erase(0, bytesWritten);
- if (ec == boost::asio::error::eof)
- {
- self->conn.close("Error in reading to host port");
- return;
- }
- if (ec)
- {
- BMCWEB_LOG_ERROR("Error in host serial write {}", ec.message());
- return;
- }
- self->doWrite();
- });
+ if (ec == boost::asio::error::eof)
+ {
+ self->conn.close("Error in reading to host port");
+ return;
+ }
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR("Error in host serial write {}",
+ ec.message());
+ return;
+ }
+ self->doWrite();
+ });
}
static void afterSendEx(const std::weak_ptr<ConsoleHandler>& weak)
@@ -97,23 +97,24 @@
boost::asio::buffer(outputBuffer),
[this, weakSelf(weak_from_this())](
const boost::system::error_code& ec, std::size_t bytesRead) {
- BMCWEB_LOG_DEBUG("read done. Read {} bytes", bytesRead);
- std::shared_ptr<ConsoleHandler> self = weakSelf.lock();
- if (self == nullptr)
- {
- return;
- }
- if (ec)
- {
- BMCWEB_LOG_ERROR("Couldn't read from host serial port: {}",
- ec.message());
- conn.close("Error connecting to host port");
- return;
- }
- std::string_view payload(outputBuffer.data(), bytesRead);
- self->conn.sendEx(crow::websocket::MessageType::Binary, payload,
- std::bind_front(afterSendEx, weak_from_this()));
- });
+ BMCWEB_LOG_DEBUG("read done. Read {} bytes", bytesRead);
+ std::shared_ptr<ConsoleHandler> self = weakSelf.lock();
+ if (self == nullptr)
+ {
+ return;
+ }
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR("Couldn't read from host serial port: {}",
+ ec.message());
+ conn.close("Error connecting to host port");
+ return;
+ }
+ std::string_view payload(outputBuffer.data(), bytesRead);
+ self->conn.sendEx(
+ crow::websocket::MessageType::Binary, payload,
+ std::bind_front(afterSendEx, weak_from_this()));
+ });
}
bool connect(int fd)
@@ -214,11 +215,10 @@
}
}
-inline void
- processConsoleObject(crow::websocket::Connection& conn,
- const std::string& consoleObjPath,
- const boost::system::error_code& ec,
- const ::dbus::utility::MapperGetObject& objInfo)
+inline void processConsoleObject(
+ crow::websocket::Connection& conn, const std::string& consoleObjPath,
+ const boost::system::error_code& ec,
+ const ::dbus::utility::MapperGetObject& objInfo)
{
// Look up the handler
auto iter = getConsoleHandlerMap().find(&conn);
@@ -252,8 +252,8 @@
crow::connections::systemBus->async_method_call(
[&conn](const boost::system::error_code& ec1,
const sdbusplus::message::unix_fd& unixfd) {
- connectConsoleSocket(conn, ec1, unixfd);
- },
+ connectConsoleSocket(conn, ec1, unixfd);
+ },
consoleService, consoleObjPath, "xyz.openbmc_project.Console.Access",
"Connect");
}
@@ -304,8 +304,8 @@
consolePath, interfaces,
[&conn, consolePath](const boost::system::error_code& ec,
const ::dbus::utility::MapperGetObject& objInfo) {
- processConsoleObject(conn, consolePath, ec, objInfo);
- });
+ processConsoleObject(conn, consolePath, ec, objInfo);
+ });
}
inline void onMessage(crow::websocket::Connection& conn,