clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I44441096113929ce96eb1439e2932e6ff3c87f27
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/include/dbus-sdr/sdrutils.hpp b/include/dbus-sdr/sdrutils.hpp
index c129876..7a001a6 100644
--- a/include/dbus-sdr/sdrutils.hpp
+++ b/include/dbus-sdr/sdrutils.hpp
@@ -17,16 +17,17 @@
#include <boost/algorithm/string.hpp>
#include <boost/bimap.hpp>
#include <boost/container/flat_map.hpp>
+#include <ipmid/api.hpp>
+#include <ipmid/types.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/bus/match.hpp>
+
#include <cstdio>
#include <cstring>
#include <exception>
#include <filesystem>
-#include <ipmid/api.hpp>
-#include <ipmid/types.hpp>
#include <map>
#include <optional>
-#include <phosphor-logging/log.hpp>
-#include <sdbusplus/bus/match.hpp>
#include <string>
#include <unordered_set>
#include <vector>
diff --git a/include/dbus-sdr/sensorcommands.hpp b/include/dbus-sdr/sensorcommands.hpp
index 4689acb..1e342d7 100644
--- a/include/dbus-sdr/sensorcommands.hpp
+++ b/include/dbus-sdr/sensorcommands.hpp
@@ -15,9 +15,10 @@
*/
#pragma once
-#include <cstdint>
#include <dbus-sdr/sdrutils.hpp>
+#include <cstdint>
+
#pragma pack(push, 1)
struct SensorThresholdResp
diff --git a/include/ipmid-host/cmd.hpp b/include/ipmid-host/cmd.hpp
index ca73bd2..e844e8f 100644
--- a/include/ipmid-host/cmd.hpp
+++ b/include/ipmid-host/cmd.hpp
@@ -1,7 +1,8 @@
#include <ipmid-host/cmd-utils.hpp>
-#include <memory>
#include <sdbusplus/asio/connection.hpp>
+#include <memory>
+
// Global Host Bound Command manager
extern void ipmid_send_cmd_to_host(phosphor::host::command::CommandHandler&&);
extern std::unique_ptr<sdbusplus::asio::connection>&
diff --git a/include/ipmid/api-types.hpp b/include/ipmid/api-types.hpp
index 518db03..92432e0 100644
--- a/include/ipmid/api-types.hpp
+++ b/include/ipmid/api-types.hpp
@@ -15,8 +15,9 @@
*
*/
#pragma once
-#include <cstdint>
#include <ipmid/iana.hpp>
+
+#include <cstdint>
#include <optional>
#include <tuple>
diff --git a/include/ipmid/filter.hpp b/include/ipmid/filter.hpp
index 8b3a652..d57b838 100644
--- a/include/ipmid/filter.hpp
+++ b/include/ipmid/filter.hpp
@@ -14,11 +14,12 @@
* limitations under the License.
*/
#pragma once
-#include <algorithm>
#include <boost/callable_traits.hpp>
-#include <cstdint>
#include <ipmid/api-types.hpp>
#include <ipmid/message.hpp>
+
+#include <algorithm>
+#include <cstdint>
#include <memory>
#include <tuple>
#include <utility>
@@ -62,9 +63,7 @@
class IpmiFilter : public FilterBase
{
public:
- IpmiFilter(Filter&& filter) : filter_(std::move(filter))
- {
- }
+ IpmiFilter(Filter&& filter) : filter_(std::move(filter)) {}
ipmi::Cc call(message::Request::ptr request) override
{
diff --git a/include/ipmid/handler.hpp b/include/ipmid/handler.hpp
index 229b0cf..0359ee3 100644
--- a/include/ipmid/handler.hpp
+++ b/include/ipmid/handler.hpp
@@ -16,19 +16,20 @@
#pragma once
#include <cxxabi.h>
-#include <algorithm>
#include <boost/asio/spawn.hpp>
#include <boost/callable_traits.hpp>
-#include <cstdint>
-#include <exception>
#include <ipmid/api-types.hpp>
#include <ipmid/message.hpp>
+#include <phosphor-logging/log.hpp>
+#include <user_channel/channel_layer.hpp>
+
+#include <algorithm>
+#include <cstdint>
+#include <exception>
#include <memory>
#include <optional>
-#include <phosphor-logging/log.hpp>
#include <stdexcept>
#include <tuple>
-#include <user_channel/channel_layer.hpp>
#include <utility>
#ifdef ALLOW_DEPRECATED_API
@@ -61,9 +62,7 @@
class HandlerCompletion
{
public:
- HandlerCompletion(Cc cc) noexcept : cc(cc)
- {
- }
+ HandlerCompletion(Cc cc) noexcept : cc(cc) {}
Cc code() const noexcept
{
@@ -81,12 +80,10 @@
public:
HandlerException(Cc cc, const char* what) :
HandlerCompletion(cc), std::runtime_error(what)
- {
- }
+ {}
HandlerException(Cc cc, const std::string& what) :
HandlerException(cc, what.c_str())
- {
- }
+ {}
};
static inline const char* currentExceptionType()
@@ -161,8 +158,7 @@
public:
explicit IpmiHandler(Handler&& handler) :
handler_(std::forward<Handler>(handler))
- {
- }
+ {}
private:
Handler handler_;
@@ -331,8 +327,7 @@
public:
explicit IpmiHandler(const ipmid_callback_t& handler, void* ctx = nullptr) :
handler_(handler), handlerCtx(ctx)
- {
- }
+ {}
private:
ipmid_callback_t handler_;
@@ -423,9 +418,7 @@
class IpmiHandler<oem::Handler> final : public HandlerBase
{
public:
- explicit IpmiHandler(const oem::Handler& handler) : handler_(handler)
- {
- }
+ explicit IpmiHandler(const oem::Handler& handler) : handler_(handler) {}
private:
oem::Handler handler_;
diff --git a/include/ipmid/message.hpp b/include/ipmid/message.hpp
index 8cb9192..64f7777 100644
--- a/include/ipmid/message.hpp
+++ b/include/ipmid/message.hpp
@@ -15,16 +15,17 @@
*/
#pragma once
-#include <algorithm>
#include <boost/asio/spawn.hpp>
-#include <cstdint>
-#include <exception>
#include <ipmid/api-types.hpp>
#include <ipmid/message/types.hpp>
#include <ipmid/types.hpp>
-#include <memory>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/asio/connection.hpp>
+
+#include <algorithm>
+#include <cstdint>
+#include <exception>
+#include <memory>
#include <tuple>
#include <utility>
#include <vector>
@@ -50,8 +51,7 @@
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;
// normal IPMI context (what call is this, from whence it came...)
@@ -116,9 +116,7 @@
Payload(Payload&&) = default;
Payload& operator=(Payload&&) = default;
- explicit Payload(SecureBuffer&& data) : raw(std::move(data))
- {
- }
+ explicit Payload(SecureBuffer&& data) : raw(std::move(data)) {}
~Payload()
{
@@ -258,8 +256,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;
@@ -466,8 +464,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;
@@ -515,8 +513,7 @@
explicit Response(Context::ptr& context) :
payload(), ctx(context), cc(ccSuccess)
- {
- }
+ {}
/**
* @brief pack arbitrary values (of any supported type) into the payload
@@ -597,8 +594,7 @@
explicit Request(Context::ptr context, SecureBuffer&& d) :
payload(std::forward<SecureBuffer>(d)), ctx(context)
- {
- }
+ {}
/**
* @brief unpack arbitrary values (of any supported type) from the payload
diff --git a/include/ipmid/message/pack.hpp b/include/ipmid/message/pack.hpp
index 86a12be..30baa59 100644
--- a/include/ipmid/message/pack.hpp
+++ b/include/ipmid/message/pack.hpp
@@ -15,11 +15,12 @@
*/
#pragma once
-#include <array>
#include <ipmid/message/types.hpp>
+#include <phosphor-logging/log.hpp>
+
+#include <array>
#include <memory>
#include <optional>
-#include <phosphor-logging/log.hpp>
#include <string_view>
#include <tuple>
#include <utility>
@@ -292,7 +293,7 @@
{
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/message/types.hpp b/include/ipmid/message/types.hpp
index 1da2574..c53529b 100644
--- a/include/ipmid/message/types.hpp
+++ b/include/ipmid/message/types.hpp
@@ -15,10 +15,11 @@
*/
#pragma once
-#include <bitset>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/version.hpp>
#include <ipmid/utility.hpp>
+
+#include <bitset>
#include <tuple>
#if BOOST_VERSION < 107900
diff --git a/include/ipmid/message/unpack.hpp b/include/ipmid/message/unpack.hpp
index 3a80c3f..afa17e3 100644
--- a/include/ipmid/message/unpack.hpp
+++ b/include/ipmid/message/unpack.hpp
@@ -15,8 +15,9 @@
*/
#pragma once
-#include <array>
#include <ipmid/message/types.hpp>
+
+#include <array>
#include <optional>
#include <string>
#include <tuple>
diff --git a/include/ipmid/oemrouter.hpp b/include/ipmid/oemrouter.hpp
index ef0e697..2e4ea23 100644
--- a/include/ipmid/oemrouter.hpp
+++ b/include/ipmid/oemrouter.hpp
@@ -2,11 +2,12 @@
#include <ipmid/api.h>
+#include <ipmid/iana.hpp>
+
#include <array>
#include <cstddef>
#include <cstdint>
#include <functional>
-#include <ipmid/iana.hpp>
#include <vector>
namespace oem
@@ -29,9 +30,7 @@
class Router
{
public:
- virtual ~Router()
- {
- }
+ virtual ~Router() {}
/// Enable message routing to begin.
virtual void activate() = 0;
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index a36d612..98d0288 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -3,8 +3,9 @@
#include <openssl/crypto.h>
#include <stdint.h>
-#include <map>
#include <sdbusplus/server.hpp>
+
+#include <map>
#include <string>
#include <variant>
diff --git a/include/ipmid/utility.hpp b/include/ipmid/utility.hpp
index 0c39e92..a3f306f 100644
--- a/include/ipmid/utility.hpp
+++ b/include/ipmid/utility.hpp
@@ -16,6 +16,7 @@
#pragma once
#include <boost/asio/spawn.hpp>
#include <boost/callable_traits.hpp>
+
#include <cstdint>
#include <map>
#include <memory>
@@ -46,10 +47,9 @@
struct StripFirstArgs;
template <std::size_t N, typename FirstArg, typename... Rest>
-struct StripFirstArgs<N, std::tuple<FirstArg, Rest...>>
- : StripFirstArgs<N - 1, std::tuple<Rest...>>
-{
-};
+struct StripFirstArgs<N, std::tuple<FirstArg, Rest...>> :
+ StripFirstArgs<N - 1, std::tuple<Rest...>>
+{};
template <typename FirstArg, typename... Rest>
struct StripFirstArgs<0, std::tuple<FirstArg, Rest...>>
@@ -206,20 +206,17 @@
*/
template <typename>
struct is_tuple : std::false_type
-{
-};
+{};
template <typename... T>
struct is_tuple<std::tuple<T...>> : std::true_type
-{
-};
+{};
/** @brief used for static_assert in a constexpr-if else statement
*/
template <typename T>
struct dependent_false : std::false_type
-{
-};
+{};
} // namespace utility
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index ebd97e0..20f9847 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -1,13 +1,14 @@
#pragma once
#include <boost/system/error_code.hpp>
-#include <chrono>
#include <ipmid/api-types.hpp>
#include <ipmid/message.hpp>
#include <ipmid/types.hpp>
-#include <optional>
#include <sdbusplus/server.hpp>
+#include <chrono>
+#include <optional>
+
namespace ipmi
{