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: I8d0072c279e4de87dc001190845d0ca6da233345
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/sessions_manager.cpp b/sessions_manager.cpp
index 9aa452c..79bf9de 100644
--- a/sessions_manager.cpp
+++ b/sessions_manager.cpp
@@ -74,11 +74,10 @@
scheduleSessionCleaner(std::chrono::microseconds(3 * 1000 * 1000));
}
-std::shared_ptr<Session>
- Manager::startSession(SessionID remoteConsoleSessID, Privilege priv,
- cipher::rakp_auth::Algorithms authAlgo,
- cipher::integrity::Algorithms intAlgo,
- cipher::crypt::Algorithms cryptAlgo)
+std::shared_ptr<Session> Manager::startSession(
+ SessionID remoteConsoleSessID, Privilege priv,
+ cipher::rakp_auth::Algorithms authAlgo,
+ cipher::integrity::Algorithms intAlgo, cipher::crypt::Algorithms cryptAlgo)
{
std::shared_ptr<Session> session = nullptr;
SessionID bmcSessionID = 0;
@@ -189,8 +188,8 @@
}
}
-std::shared_ptr<Session> Manager::getSession(SessionID sessionID,
- RetrieveOption option)
+std::shared_ptr<Session>
+ Manager::getSession(SessionID sessionID, RetrieveOption option)
{
switch (option)
{
@@ -210,8 +209,8 @@
[sessionID](
const std::pair<const uint32_t, std::shared_ptr<Session>>&
in) -> bool {
- return sessionID == in.second->getRCSessionID();
- });
+ return sessionID == in.second->getRCSessionID();
+ });
if (iter != sessionsMap.end())
{
@@ -232,8 +231,8 @@
// active idle time in seconds = 60 / overflow^3
constexpr int baseIdleMicros = 60 * 1000 * 1000;
// no +1 for the zero session here because this is just active sessions
- int sessionDivisor = getActiveSessionCount() -
- session::maxSessionCountPerChannel;
+ int sessionDivisor =
+ getActiveSessionCount() - session::maxSessionCountPerChannel;
sessionDivisor = std::max(0, sessionDivisor) + 1;
sessionDivisor = sessionDivisor * sessionDivisor * sessionDivisor;
int activeMicros = baseIdleMicros / sessionDivisor;
@@ -242,8 +241,8 @@
// setup idle time in seconds = max(3, 60 / overflow^3)
// +1 for the zero session here because size() counts that too
- int setupDivisor = sessionsMap.size() -
- (session::maxSessionCountPerChannel + 1);
+ int setupDivisor =
+ sessionsMap.size() - (session::maxSessionCountPerChannel + 1);
setupDivisor = std::max(0, setupDivisor) + 1;
setupDivisor = setupDivisor * setupDivisor * setupDivisor;
constexpr int maxSetupMicros = 3 * 1000 * 1000;
@@ -327,9 +326,9 @@
sessionsMap.begin(), sessionsMap.end(),
[](const std::pair<const uint32_t, std::shared_ptr<Session>>& in)
-> bool {
- return in.second->state() ==
- static_cast<uint8_t>(session::State::active);
- }));
+ return in.second->state() ==
+ static_cast<uint8_t>(session::State::active);
+ }));
}
void Manager::scheduleSessionCleaner(const std::chrono::microseconds& when)