diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml index 7b8768a5e8..8250d01266 100644 --- a/.github/workflows/style-check.yml +++ b/.github/workflows/style-check.yml @@ -27,7 +27,7 @@ jobs: run: | sudo apt update python ./tests/test_restyle.py --quiet - env CLANG_FORMAT="clang-format-18" bash ./tests/ci/style_check.sh + env CLANG_FORMAT="clang-format-22" bash ./tests/ci/style_check.sh # Validate orthography diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp index dc7ced4db3..f8f114bc6b 100644 --- a/cores/esp8266/core_esp8266_si2c.cpp +++ b/cores/esp8266/core_esp8266_si2c.cpp @@ -78,8 +78,7 @@ class Twi TWIPM_IDLE, TWIPM_ADDRESSED, TWIPM_WAIT - } twip_mode - = TWIPM_IDLE; + } twip_mode = TWIPM_IDLE; volatile enum { TWIP_UNKNOWN = 0, TWIP_IDLE, @@ -97,8 +96,7 @@ class Twi TWIP_RWAIT_ACK, TWIP_WRITE, TWIP_BUS_ERR - } twip_state - = TWIP_IDLE; + } twip_state = TWIP_IDLE; volatile int twip_status = TW_NO_INFO; volatile int bitCount = 0; diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp index 5ecc497a60..0223395089 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp @@ -269,7 +269,7 @@ namespace MDNSImplementation bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService) { stcMDNSService* pService = 0; - bool bResult = (((pService = _findService(p_hService))) + bool bResult = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService))); DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n")); @@ -979,7 +979,7 @@ namespace MDNSImplementation { stcMDNSServiceQuery* pServiceQuery = 0; bool bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) - && (_removeServiceQuery(pServiceQuery))); + && (_removeServiceQuery(pServiceQuery))); DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n")); }); diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h index 0ea2b13914..4a42a15d3e 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS.h @@ -509,7 +509,7 @@ namespace MDNSImplementation { MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) : - p_pMDNSResponder(p_pM), p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {}; + p_pMDNSResponder(p_pM), p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) { }; struct CompareKey { bool operator()(char const* a, char const* b) const diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp index 2d12f9042e..913bf53a2f 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp @@ -76,7 +76,7 @@ namespace MDNSImplementation char acIndexBuffer[16]; sprintf(acIndexBuffer, "%lu", (++ulIndex)); size_t stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) - + strlen(acIndexBuffer) + 1); + + strlen(acIndexBuffer) + 1); char* pNewHostname = new char[stLength]; if (pNewHostname) { @@ -105,9 +105,9 @@ namespace MDNSImplementation if (!pFoundDivider) // not yet extended (or failed to increment extension) -> start // indexing { - size_t stLength = strlen(p_rpcDomain) - + (strlen(pcDivider) + 1 + 1); // Name + Divider + '2' + '\0' - char* pNewHostname = new char[stLength]; + size_t stLength = strlen(p_rpcDomain) + + (strlen(pcDivider) + 1 + 1); // Name + Divider + '2' + '\0' + char* pNewHostname = new char[stLength]; if (pNewHostname) { sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider); diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp index ed58f1b86f..25a53bbf7d 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp @@ -605,8 +605,8 @@ namespace MDNSImplementation { uint32_t u32IP4Address; bool bResult = ((MDNS_IP4_SIZE == p_u16RDLength) - && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) - && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address)))); + && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) + && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address)))); DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n"));); return bResult; @@ -1358,11 +1358,11 @@ namespace MDNSImplementation uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode)); bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) - && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) - && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) - && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) - && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) - && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter))); + && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) + && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) + && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) + && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) + && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter))); DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n")); diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h index bbf5b61d64..306e6c727c 100644 --- a/libraries/Netdump/src/PacketType.h +++ b/libraries/Netdump/src/PacketType.h @@ -38,7 +38,7 @@ class PacketType }; PacketType(); - PacketType(PType pt) : ptype(pt) {}; + PacketType(PType pt) : ptype(pt) { }; operator PType() const { diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino index e77b35ef66..381d8e0039 100644 --- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino +++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino @@ -6,7 +6,7 @@ using namespace experimental::CBListImplentation; class exampleClass { public: - exampleClass(){}; + exampleClass() {}; using exCallBack = std::function; using exHandler = CallBackList::CallBackHandler; diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h index 9ed1e4cdab..872618e109 100644 --- a/libraries/lwIP_w5100/src/utility/w5100.h +++ b/libraries/lwIP_w5100/src/utility/w5100.h @@ -138,8 +138,8 @@ class Wiznet5100 << 10; /* Length of Tx buffer in bytes */ static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */ - static const uint16_t TxBufferMask = TxBufferLength - 1; - static const uint16_t RxBufferMask = RxBufferLength - 1; + static const uint16_t TxBufferMask = TxBufferLength - 1; + static const uint16_t RxBufferMask = RxBufferLength - 1; SPIClass& _spi; int8_t _cs; diff --git a/tests/clang-format-core.yaml b/tests/clang-format-core.yaml index 0df633d245..333dc40cc1 100644 --- a/tests/clang-format-core.yaml +++ b/tests/clang-format-core.yaml @@ -5,6 +5,7 @@ ColumnLimit: 100 KeepEmptyLinesAtTheStartOfBlocks: false SpaceAfterTemplateKeyword: false SpaceBeforeInheritanceColon: false +SpaceInEmptyBraces: Block SpacesBeforeTrailingComments: 2 AllowShortBlocksOnASingleLine: Empty AllowShortFunctionsOnASingleLine: Empty diff --git a/tests/host/common/strl.cpp b/tests/host/common/strl.cpp index b01f6652a8..6e908e264b 100644 --- a/tests/host/common/strl.cpp +++ b/tests/host/common/strl.cpp @@ -9,10 +9,10 @@ extern "C" #ifdef STRLCAT_MISSING // '_cups_strlcat()' - Safely concatenate two strings. - size_t /* O - Length of string */ - strlcat(char* dst, /* O - Destination string */ - const char* src, /* I - Source string */ - size_t size) /* I - Size of destination string buffer */ + size_t /* O - Length of string */ + strlcat(char* dst, /* O - Destination string */ + const char* src, /* I - Source string */ + size_t size) /* I - Size of destination string buffer */ { size_t srclen; /* Length of source string */ size_t dstlen; /* Length of destination string */ @@ -48,10 +48,10 @@ extern "C" #ifdef STRLCPY_MISSING // '_cups_strlcpy()' - Safely copy two strings. - size_t /* O - Length of string */ - strlcpy(char* dst, /* O - Destination string */ - const char* src, /* I - Source string */ - size_t size) /* I - Size of destination string buffer */ + size_t /* O - Length of string */ + strlcpy(char* dst, /* O - Destination string */ + const char* src, /* I - Source string */ + size_t size) /* I - Size of destination string buffer */ { size_t srclen; /* Length of source string */