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: I9338e3aa3377d6e02a786b858a40e95c62fd35a0
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/tools/pci.hpp b/tools/pci.hpp
index 9f72e78..e734fa0 100644
--- a/tools/pci.hpp
+++ b/tools/pci.hpp
@@ -101,10 +101,8 @@
static constexpr std::uint32_t vid = 0x1050;
static constexpr std::uint32_t did = NUVOTON_PCI_DID;
static constexpr int bar = 0;
- static constexpr struct pci_id_match match
- {
- vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
- };
+ static constexpr struct pci_id_match match{
+ vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0};
static constexpr pciaddr_t bridge = 0x04;
static constexpr std::uint8_t bridgeEnabled = 0x02;
@@ -141,10 +139,8 @@
static constexpr std::uint32_t vid = 0x1a03;
static constexpr std::uint32_t did = 0x2000;
static constexpr int bar = 1;
- static constexpr struct pci_id_match match
- {
- vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
- };
+ static constexpr struct pci_id_match match{
+ vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0};
static constexpr std::size_t config = 0x0f000;
static constexpr std::size_t bridge = 0x0f004;
diff --git a/tools/test/tools_pci_unittest.cpp b/tools/test/tools_pci_unittest.cpp
index c3ce610..785b8da 100644
--- a/tools/test/tools_pci_unittest.cpp
+++ b/tools/test/tools_pci_unittest.cpp
@@ -138,10 +138,8 @@
static constexpr std::uint8_t bridgeEnabled = 0x02;
private:
- static constexpr struct pci_id_match match
- {
- 0x1050, 0x0750, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
- };
+ static constexpr struct pci_id_match match{
+ 0x1050, 0x0750, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0};
};
class AspeedDevice : public Device
@@ -185,10 +183,8 @@
static constexpr int bridge = 0x0f004;
private:
- static constexpr struct pci_id_match match
- {
- 0x1a03, 0x2000, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
- };
+ static constexpr struct pci_id_match match{
+ 0x1a03, 0x2000, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0};
};
NuvotonDevice nuvotonDevice;