clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: Ic23653be3ed404980fd0e723d9ed8354e2b32579
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/include/dbus-sdr/sdrutils.hpp b/include/dbus-sdr/sdrutils.hpp
index db462db..b52351d 100644
--- a/include/dbus-sdr/sdrutils.hpp
+++ b/include/dbus-sdr/sdrutils.hpp
@@ -286,8 +286,8 @@
bool getSensorSubtree(SensorSubTree& subtree);
#ifdef FEATURE_HYBRID_SENSORS
-ipmi::sensor::IdInfoMap::const_iterator
- findStaticSensor(const std::string& path);
+ipmi::sensor::IdInfoMap::const_iterator findStaticSensor(
+ const std::string& path);
#endif
struct CmpStr
@@ -345,11 +345,11 @@
std::optional<std::map<std::string, std::vector<std::string>>>
getObjectInterfaces(const char* path);
-std::map<std::string, Value>
- getEntityManagerProperties(const char* path, const char* interface);
+std::map<std::string, Value> getEntityManagerProperties(const char* path,
+ const char* interface);
-std::optional<std::unordered_set<std::string>>&
- getIpmiDecoratorPaths(const std::optional<ipmi::Context::ptr>& ctx);
+std::optional<std::unordered_set<std::string>>& getIpmiDecoratorPaths(
+ const std::optional<ipmi::Context::ptr>& ctx);
const std::string* getSensorConfigurationInterface(
const std::map<std::string, std::vector<std::string>>&
diff --git a/include/ipmid/handler.hpp b/include/ipmid/handler.hpp
index 77f6670..4337b17 100644
--- a/include/ipmid/handler.hpp
+++ b/include/ipmid/handler.hpp
@@ -43,16 +43,16 @@
{
template <typename... Args>
-static inline message::Response::ptr
- errorResponse(message::Request::ptr request, ipmi::Cc cc, Args&&... args)
+static inline message::Response::ptr errorResponse(
+ message::Request::ptr request, ipmi::Cc cc, Args&&... args)
{
message::Response::ptr response = request->makeResponse();
response->cc = cc;
response->pack(args...);
return response;
}
-static inline message::Response::ptr
- errorResponse(message::Request::ptr request, ipmi::Cc cc)
+static inline message::Response::ptr errorResponse(
+ message::Request::ptr request, ipmi::Cc cc)
{
message::Response::ptr response = request->makeResponse();
response->cc = cc;
@@ -141,8 +141,8 @@
*
* @return a shared_ptr to a Response object
*/
- virtual message::Response::ptr
- executeCallback(message::Request::ptr request) = 0;
+ virtual message::Response::ptr executeCallback(
+ message::Request::ptr request) = 0;
};
/**
@@ -181,8 +181,8 @@
*
* @return a shared_ptr to a Response object
*/
- message::Response::ptr
- executeCallback(message::Request::ptr request) override
+ message::Response::ptr executeCallback(
+ message::Request::ptr request) override
{
message::Response::ptr response = request->makeResponse();
@@ -346,8 +346,8 @@
*
* @return a shared_ptr to a Response object
*/
- message::Response::ptr
- executeCallback(message::Request::ptr request) override
+ message::Response::ptr executeCallback(
+ message::Request::ptr request) override
{
message::Response::ptr response = request->makeResponse();
// allocate a big response buffer here
@@ -432,8 +432,8 @@
*
* @return a shared_ptr to a Response object
*/
- message::Response::ptr
- executeCallback(message::Request::ptr request) override
+ message::Response::ptr executeCallback(
+ message::Request::ptr request) override
{
message::Response::ptr response = request->makeResponse();
// allocate a big response buffer here
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index f31a532..c099da0 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -221,9 +221,9 @@
* @return boost error code
*
*/
-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);
/** @brief Gets the dbus sub tree implementing the given interface.
* @param[in] ctx - ipmi::Context::ptr
@@ -247,10 +247,10 @@
* @param[out] D-Bus object with path and service name
* @return - boost error code object
*/
-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);
// default for ROOT for subtreePath and std::string{} for match
static inline boost::system::error_code getDbusObject(
@@ -260,9 +260,9 @@
}
// default std::string{} for match
-static inline boost::system::error_code
- getDbusObject(Context::ptr ctx, const std::string& interface,
- const std::string& subtreePath, DbusObjectInfo& dbusObject)
+static inline boost::system::error_code getDbusObject(
+ Context::ptr ctx, const std::string& interface,
+ const std::string& subtreePath, DbusObjectInfo& dbusObject)
{
return getDbusObject(ctx, interface, subtreePath, {}, dbusObject);
}
@@ -278,10 +278,10 @@
* @return - boost error code object
*/
template <typename Type>
-boost::system::error_code
- getDbusProperty(Context::ptr ctx, const std::string& service,
- const std::string& objPath, const std::string& interface,
- const std::string& property, Type& propertyValue)
+boost::system::error_code getDbusProperty(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& property,
+ Type& propertyValue)
{
boost::system::error_code ec;
auto variant = ctx->bus->yield_method_call<std::variant<Type>>(
@@ -324,10 +324,10 @@
* @param[in] value - value which needs to be set.
* @return - boost error code object
*/
-boost::system::error_code
- setDbusProperty(Context::ptr ctx, const std::string& service,
- const std::string& objPath, const std::string& interface,
- const std::string& property, const Value& value);
+boost::system::error_code setDbusProperty(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& property,
+ const Value& value);
/** @brief Gets all the D-Bus objects from the given service root
* which matches the object identifier.
@@ -338,15 +338,15 @@
* @param[out] objectree - map of object path and service info.
* @return - boost error code object
*/
-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);
// default std::string{} for match
-static inline boost::system::error_code
- getAllDbusObjects(Context::ptr ctx, const std::string& serviceRoot,
- const std::string& interface, ObjectTree& objectTree)
+static inline boost::system::error_code getAllDbusObjects(
+ Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, ObjectTree& objectTree)
{
return getAllDbusObjects(ctx, serviceRoot, interface, {}, objectTree);
}
@@ -372,9 +372,9 @@
* @param[out] objects - map of name value pair.
* @return - boost error code object
*/
-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);
/** @brief Gets the ancestor objects of the given object
which implements the given interface.
@@ -384,10 +384,9 @@
* @param[out] ObjectTree - map of object path and service info.
* @return - boost error code object
*/
-boost::system::error_code
- getAllAncestors(Context::ptr ctx, const std::string& path,
- const InterfaceList& interfaces, ObjectTree& objectTree)
- __attribute__((deprecated));
+boost::system::error_code getAllAncestors(
+ Context::ptr ctx, const std::string& path, const InterfaceList& interfaces,
+ ObjectTree& objectTree) __attribute__((deprecated));
/** @brief Gets the value associated with the given object
* and the interface.
@@ -439,15 +438,15 @@
struct VariantToDoubleVisitor
{
template <typename T>
- std::enable_if_t<std::is_arithmetic<T>::value, double>
- operator()(const T& t) const
+ std::enable_if_t<std::is_arithmetic<T>::value, double> operator()(
+ const T& t) const
{
return static_cast<double>(t);
}
template <typename T>
- std::enable_if_t<!std::is_arithmetic<T>::value, double>
- operator()(const T&) const
+ std::enable_if_t<!std::is_arithmetic<T>::value, double> operator()(
+ const T&) const
{
throw std::invalid_argument("Cannot translate type to double");
}