clang-format: re-format for clang-19
clang-format-19 isn't compatible with the clang-format-18 output, so we
need to reformat the code with the latest version. A few parameters
in clang-tidy have been deprecated, so adjust the style file
accordingly.
See Ie2f6eb3b043f2d655c9df806815afd7971fd0947 for updated style.
See I88192b41ab7a95599a90915013579608af7bc56f for clang-19 enablement.
Change-Id: I143ed8acc77de34cab0d51ae908999ed0aec4ee6
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 28e3328..a75a2c2 100644
--- a/.clang-format
+++ b/.clang-format
@@ -17,9 +17,7 @@
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: None
@@ -43,12 +41,14 @@
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterAttributes: Never
+BreakAfterReturnType: Automatic
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
+BreakTemplateDeclarations: Yes
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
diff --git a/gpioMonMain.cpp b/gpioMonMain.cpp
index 2a29d1f..03d50c9 100644
--- a/gpioMonMain.cpp
+++ b/gpioMonMain.cpp
@@ -86,10 +86,8 @@
gpiod_line* line = nullptr;
/* GPIO line configuration, default to monitor both edge */
- struct gpiod_line_request_config config
- {
- "gpio_monitor", GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES, 0
- };
+ struct gpiod_line_request_config config{
+ "gpio_monitor", GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES, 0};
/* flag to monitor */
bool flag = false;
diff --git a/monitor.cpp b/monitor.cpp
index e8b844b..cbc0c1c 100644
--- a/monitor.cpp
+++ b/monitor.cpp
@@ -44,8 +44,7 @@
void Monitor::analyzeEvent()
{
// Data returned
- struct input_event ev
- {};
+ struct input_event ev{};
int rc = 0;
// While testing, observed that not having a loop here was leading
diff --git a/multi-presence/main.cpp b/multi-presence/main.cpp
index 858ac7c..b7fba2e 100644
--- a/multi-presence/main.cpp
+++ b/multi-presence/main.cpp
@@ -87,10 +87,8 @@
gpiod_line* line = nullptr;
/* GPIO line configuration, default to monitor both edge */
- struct gpiod_line_request_config config
- {
- "gpio_monitor", GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES, 0
- };
+ struct gpiod_line_request_config config{
+ "gpio_monitor", GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES, 0};
/* Pretty name of the inventory object */
std::string name;
diff --git a/presence/gpio_presence.cpp b/presence/gpio_presence.cpp
index ce27d4c..b009d3f 100644
--- a/presence/gpio_presence.cpp
+++ b/presence/gpio_presence.cpp
@@ -88,8 +88,7 @@
void Presence::analyzeEvent()
{
// Data returned
- struct input_event ev
- {};
+ struct input_event ev{};
int rc = 0;
// While testing, observed that not having a loop here was leading