clang-format: update with latest
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I461b17ee197528f125239f3cb8678dca45eaa634
diff --git a/.clang-format b/.clang-format
index ef6f54e..ba9f48d 100644
--- a/.clang-format
+++ b/.clang-format
@@ -9,9 +9,9 @@
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
@@ -41,7 +41,7 @@
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
-BreakStringLiterals: true
+BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
@@ -49,6 +49,7 @@
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
+DeriveLineEnding: false
DerivePointerAlignment: false
PointerAlignment: Left
DisableFormat: false
@@ -76,7 +77,7 @@
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -108,8 +109,9 @@
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Cpp11
+Standard: Latest
TabWidth: 4
+UseCRLF: false
UseTab: Never
...
diff --git a/include/sdbusplus/asio/detail/async_send_handler.hpp b/include/sdbusplus/asio/detail/async_send_handler.hpp
index 13d23e4..144a56a 100644
--- a/include/sdbusplus/asio/detail/async_send_handler.hpp
+++ b/include/sdbusplus/asio/detail/async_send_handler.hpp
@@ -31,10 +31,8 @@
struct async_send_handler
{
Handler handler_;
- async_send_handler(Handler&& handler) : handler_(std::move(handler))
- {}
- async_send_handler(Handler& handler) : handler_(handler)
- {}
+ async_send_handler(Handler&& handler) : handler_(std::move(handler)) {}
+ async_send_handler(Handler& handler) : handler_(handler) {}
void operator()(sd_bus* conn, message_t& mesg, uint64_t timeout)
{
async_send_handler* context = new async_send_handler(std::move(*this));
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index d34c96a..181c26d 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -113,8 +113,7 @@
class callback_method_instance : public callback
{
public:
- callback_method_instance(CallbackType&& func) : func_(std::move(func))
- {}
+ callback_method_instance(CallbackType&& func) : func_(std::move(func)) {}
int call(message_t& m) override
{
return expandCall(m);
diff --git a/include/sdbusplus/bus.hpp b/include/sdbusplus/bus.hpp
index 874c364..ab80e85 100644
--- a/include/sdbusplus/bus.hpp
+++ b/include/sdbusplus/bus.hpp
@@ -42,8 +42,7 @@
struct BusDeleter
{
BusDeleter() = delete;
- explicit BusDeleter(SdBusInterface* interface) : m_interface(interface)
- {}
+ explicit BusDeleter(SdBusInterface* interface) : m_interface(interface) {}
void operator()(sd_bus* ptr) const
{
diff --git a/include/sdbusplus/message.hpp b/include/sdbusplus/message.hpp
index ea9869c..f807450 100644
--- a/include/sdbusplus/message.hpp
+++ b/include/sdbusplus/message.hpp
@@ -89,8 +89,7 @@
* Takes increment ref-count of the msg-pointer and release when
* destructed.
*/
- explicit message(msgp_t m = nullptr) : message(m, &sdbus_impl)
- {}
+ explicit message(msgp_t m = nullptr) : message(m, &sdbus_impl) {}
message(msgp_t m, sdbusplus::SdBusInterface* intf, std::false_type) :
_intf(intf), _msg(m)
@@ -100,8 +99,7 @@
*
* Takes ownership of the msg-pointer and releases it when done.
*/
- message(msgp_t m, std::false_type) : _intf(&sdbus_impl), _msg(m)
- {}
+ message(msgp_t m, std::false_type) : _intf(&sdbus_impl), _msg(m) {}
/** @brief Copy constructor for 'message'.
*
diff --git a/include/sdbusplus/message/native_types.hpp b/include/sdbusplus/message/native_types.hpp
index d3ef8dc..ce3fbe5 100644
--- a/include/sdbusplus/message/native_types.hpp
+++ b/include/sdbusplus/message/native_types.hpp
@@ -27,10 +27,8 @@
string_wrapper& operator=(string_wrapper&&) = default;
~string_wrapper() = default;
- string_wrapper(const std::string& str) : str(str)
- {}
- string_wrapper(std::string&& str) : str(std::move(str))
- {}
+ string_wrapper(const std::string& str) : str(str) {}
+ string_wrapper(std::string&& str) : str(std::move(str)) {}
operator const std::string&() const volatile&
{
@@ -93,10 +91,8 @@
string_path_wrapper& operator=(string_path_wrapper&&) = default;
~string_path_wrapper() = default;
- string_path_wrapper(const std::string& str) : str(str)
- {}
- string_path_wrapper(std::string&& str) : str(std::move(str))
- {}
+ string_path_wrapper(const std::string& str) : str(str) {}
+ string_path_wrapper(std::string&& str) : str(std::move(str)) {}
operator const std::string&() const volatile&
{
@@ -160,8 +156,7 @@
int fd;
unix_fd_type() = default;
- unix_fd_type(int f) : fd(f)
- {}
+ unix_fd_type(int f) : fd(f) {}
operator int() const
{
diff --git a/include/sdbusplus/message/read.hpp b/include/sdbusplus/message/read.hpp
index 2e6a30d..ff287f2 100644
--- a/include/sdbusplus/message/read.hpp
+++ b/include/sdbusplus/message/read.hpp
@@ -24,8 +24,7 @@
* (This is an empty no-op function that is useful in some cases for
* variadic template reasons.)
*/
-inline void read(sdbusplus::SdBusInterface* /*intf*/, sd_bus_message* /*m*/)
-{}
+inline void read(sdbusplus::SdBusInterface* /*intf*/, sd_bus_message* /*m*/) {}
/** @brief Read data from an sdbus message.
*
* @param[in] msg - The message to read from.
diff --git a/include/sdbusplus/message/types.hpp b/include/sdbusplus/message/types.hpp
index 3744d15..60c87cc 100644
--- a/include/sdbusplus/message/types.hpp
+++ b/include/sdbusplus/message/types.hpp
@@ -126,7 +126,6 @@
template <char C1, char... C>
struct tuple_type_id
{
-
/* This version check is required because a fix for auto is in 5.2+.
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66421
*/
diff --git a/include/sdbusplus/server/object.hpp b/include/sdbusplus/server/object.hpp
index 581365d..6fb5aab 100644
--- a/include/sdbusplus/server/object.hpp
+++ b/include/sdbusplus/server/object.hpp
@@ -119,8 +119,7 @@
template <class... Args>
struct compose : compose_impl<Args...>
{
- compose(bus_t& bus, const char* path) : compose_impl<Args...>(bus, path)
- {}
+ compose(bus_t& bus, const char* path) : compose_impl<Args...>(bus, path) {}
friend struct compose_inherit<object<Args...>>;
@@ -135,8 +134,7 @@
template <>
struct compose<>
{
- compose(bus_t& /*bus*/, const char* /*path*/)
- {}
+ compose(bus_t& /*bus*/, const char* /*path*/) {}
protected:
void maybe_emit_iface_added(){};
diff --git a/src/exception.cpp b/src/exception.cpp
index 05edf92..1407147 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -14,8 +14,7 @@
namespace exception
{
-void exception::unused() const noexcept
-{}
+void exception::unused() const noexcept {}
int generated_exception::get_errno() const noexcept
{
diff --git a/test/bus/match.cpp b/test/bus/match.cpp
index 2d95cf9..049e033 100644
--- a/test/bus/match.cpp
+++ b/test/bus/match.cpp
@@ -68,7 +68,6 @@
TEST_F(Match, FunctorIs_MemberFunctionTakingMessage)
{
-
class BoolHolder
{
public:
diff --git a/test/utility/type_traits.cpp b/test/utility/type_traits.cpp
index e5197d2..b5cc3d9 100644
--- a/test/utility/type_traits.cpp
+++ b/test/utility/type_traits.cpp
@@ -14,7 +14,6 @@
TEST(TypeTraits, Basic)
{
-
static_assert(is_same_v<char, array_to_ptr_t<char, char>>,
"array_to_ptr_t<char, char> != char");
@@ -41,8 +40,7 @@
{
using value_type = std::pair<int, int>;
- void find(std::tuple_element_t<0, value_type>)
- {}
+ void find(std::tuple_element_t<0, value_type>) {}
};
struct Bar
@@ -70,8 +68,7 @@
{
using value_type = std::pair<int, int>;
- void contains(std::tuple_element_t<0, value_type>)
- {}
+ void contains(std::tuple_element_t<0, value_type>) {}
};
struct Bar