Skip to content

Commit 7b7a628

Browse files
authored
Merge branch 'master' into bearssl/stack-thunk-yield
2 parents bd243ab + be3035c commit 7b7a628

File tree

14 files changed

+40
-63
lines changed

14 files changed

+40
-63
lines changed

.github/workflows/style-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
sudo apt update
2929
python ./tests/test_restyle.py --quiet
30-
bash ./tests/ci/style_check.sh
30+
env CLANG_FORMAT="clang-format-18" bash ./tests/ci/style_check.sh
3131
3232
# Validate orthography
3333

libraries/ESP8266WebServer/examples/WebServer/WebServer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public:
153153
// Close the file
154154
if (_fsUploadFile) { _fsUploadFile.close(); }
155155
} // if
156-
} // upload()
156+
} // upload()
157157

158158
protected:
159159
File _fsUploadFile;

libraries/ESP8266mDNS/src/LEAmDNS.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,7 @@ namespace MDNSImplementation
492492
{
493493
MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS,
494494
uint32_t p_u32A) :
495-
p_pMDNSResponder(p_pM),
496-
p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {};
495+
p_pMDNSResponder(p_pM), p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {};
497496
struct CompareKey
498497
{
499498
bool operator()(char const* a, char const* b) const

libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ namespace MDNSImplementation
631631
}
632632
}
633633
} // service tiebreak possibility
634-
} // for services
635-
} // ANY answers
634+
} // for services
635+
} // ANY answers
636636
}
637637
else
638638
{
@@ -955,7 +955,7 @@ namespace MDNSImplementation
955955
}
956956

957957
pRRAnswer = pRRAnswer->m_pNext; // Next collected answer
958-
} // while (answers)
958+
} // while (answers)
959959
} while ((bFoundNewKeyAnswer) && (bResult));
960960
} // else: No answers provided
961961
DEBUG_EX_ERR(if (!bResult) {
@@ -1110,7 +1110,7 @@ namespace MDNSImplementation
11101110
}
11111111
pServiceQuery = pServiceQuery->m_pNext;
11121112
} // while(service query)
1113-
} // else: No p_pSRVAnswer
1113+
} // else: No p_pSRVAnswer
11141114
DEBUG_EX_ERR(if (!bResult) {
11151115
DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
11161116
});
@@ -1173,7 +1173,7 @@ namespace MDNSImplementation
11731173
}
11741174
pServiceQuery = pServiceQuery->m_pNext;
11751175
} // while(service query)
1176-
} // else: No p_pTXTAnswer
1176+
} // else: No p_pTXTAnswer
11771177
DEBUG_EX_ERR(if (!bResult) {
11781178
DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
11791179
});
@@ -1261,7 +1261,7 @@ namespace MDNSImplementation
12611261
}
12621262
pServiceQuery = pServiceQuery->m_pNext;
12631263
} // while(service query)
1264-
} // else: No p_pAAnswer
1264+
} // else: No p_pAAnswer
12651265
DEBUG_EX_ERR(if (!bResult) {
12661266
DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
12671267
});
@@ -1349,7 +1349,7 @@ namespace MDNSImplementation
13491349
}
13501350
pServiceQuery = pServiceQuery->m_pNext;
13511351
} // while(service query)
1352-
} // else: No p_pAAAAAnswer
1352+
} // else: No p_pAAAAAnswer
13531353

13541354
return bResult;
13551355
}
@@ -2121,7 +2121,7 @@ namespace MDNSImplementation
21212121
} // IP4 flagged
21222122

21232123
pIP4Address = pNextIP4Address; // Next
2124-
} // while
2124+
} // while
21252125
#endif
21262126
#ifdef MDNS_IP6_SUPPORT
21272127
// IP6Address (from AAAA)
@@ -2185,7 +2185,7 @@ namespace MDNSImplementation
21852185
} // IP6 flagged
21862186

21872187
pIP6Address = pNextIP6Address; // Next
2188-
} // while
2188+
} // while
21892189
#endif
21902190
pSQAnswer = pNextSQAnswer;
21912191
}

libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp

+14-25
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ namespace MDNSImplementation
5555
MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
5656
const char* p_pcValue /*= 0*/,
5757
bool p_bTemp /*= false*/) :
58-
m_pNext(0),
59-
m_pcKey(0), m_pcValue(0), m_bTemp(p_bTemp)
58+
m_pNext(0), m_pcKey(0), m_pcValue(0), m_bTemp(p_bTemp)
6059
{
6160
setKey(p_pcKey);
6261
setValue(p_pcValue);
@@ -67,8 +66,7 @@ namespace MDNSImplementation
6766
*/
6867
MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(
6968
const MDNSResponder::stcMDNSServiceTxt& p_Other) :
70-
m_pNext(0),
71-
m_pcKey(0), m_pcValue(0), m_bTemp(false)
69+
m_pNext(0), m_pcKey(0), m_pcValue(0), m_bTemp(false)
7270
{
7371
operator=(p_Other);
7472
}
@@ -614,9 +612,8 @@ namespace MDNSImplementation
614612
bool p_bRA /*= false*/, unsigned char p_ucRCode /*= 0*/, uint16_t p_u16QDCount /*= 0*/,
615613
uint16_t p_u16ANCount /*= 0*/, uint16_t p_u16NSCount /*= 0*/,
616614
uint16_t p_u16ARCount /*= 0*/) :
617-
m_u16ID(p_u16ID),
618-
m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
619-
m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode), m_u16QDCount(p_u16QDCount),
615+
m_u16ID(p_u16ID), m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC),
616+
m_1bRD(p_bRD), m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode), m_u16QDCount(p_u16QDCount),
620617
m_u16ANCount(p_u16ANCount), m_u16NSCount(p_u16NSCount), m_u16ARCount(p_u16ARCount)
621618
{
622619
}
@@ -813,8 +810,7 @@ namespace MDNSImplementation
813810
*/
814811
MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(
815812
uint16_t p_u16Type /*= 0*/, uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
816-
m_u16Type(p_u16Type),
817-
m_u16Class(p_u16Class)
813+
m_u16Type(p_u16Type), m_u16Class(p_u16Class)
818814
{
819815
}
820816

@@ -910,8 +906,7 @@ namespace MDNSImplementation
910906
MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(
911907
enuAnswerType p_AnswerType, const MDNSResponder::stcMDNS_RRHeader& p_Header,
912908
uint32_t p_u32TTL) :
913-
m_pNext(0),
914-
m_AnswerType(p_AnswerType), m_Header(p_Header), m_u32TTL(p_u32TTL)
909+
m_pNext(0), m_AnswerType(p_AnswerType), m_Header(p_Header), m_u32TTL(p_u32TTL)
915910
{
916911
// Extract 'cache flush'-bit
917912
m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
@@ -955,8 +950,7 @@ namespace MDNSImplementation
955950
*/
956951
MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(
957952
const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
958-
stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
959-
m_IPAddress(0, 0, 0, 0)
953+
stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL), m_IPAddress(0, 0, 0, 0)
960954
{
961955
}
962956

@@ -1094,8 +1088,8 @@ namespace MDNSImplementation
10941088
*/
10951089
MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(
10961090
const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
1097-
stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
1098-
m_u16Priority(0), m_u16Weight(0), m_u16Port(0)
1091+
stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL), m_u16Priority(0), m_u16Weight(0),
1092+
m_u16Port(0)
10991093
{
11001094
}
11011095

@@ -1132,8 +1126,7 @@ namespace MDNSImplementation
11321126
*/
11331127
MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(
11341128
const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
1135-
stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
1136-
m_u16RDLength(0), m_pu8RDData(0)
1129+
stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL), m_u16RDLength(0), m_pu8RDData(0)
11371130
{
11381131
}
11391132

@@ -1212,8 +1205,7 @@ namespace MDNSImplementation
12121205
MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
12131206
const char* p_pcService /*= 0*/,
12141207
const char* p_pcProtocol /*= 0*/) :
1215-
m_pNext(0),
1216-
m_pcName(0), m_bAutoName(false), m_pcService(0), m_pcProtocol(0), m_u16Port(0),
1208+
m_pNext(0), m_pcName(0), m_bAutoName(false), m_pcService(0), m_pcProtocol(0), m_u16Port(0),
12171209
m_u8ReplyMask(0), m_fnTxtCallback(0)
12181210
{
12191211
setName(p_pcName);
@@ -1538,9 +1530,7 @@ namespace MDNSImplementation
15381530
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
15391531
*/
15401532
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(
1541-
IPAddress p_IPAddress, uint32_t p_u32TTL /*= 0*/) :
1542-
m_pNext(0),
1543-
m_IPAddress(p_IPAddress)
1533+
IPAddress p_IPAddress, uint32_t p_u32TTL /*= 0*/) : m_pNext(0), m_IPAddress(p_IPAddress)
15441534
{
15451535
m_TTL.set(p_u32TTL);
15461536
}
@@ -2172,9 +2162,8 @@ namespace MDNSImplementation
21722162
*/
21732163
MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(
21742164
const void* p_pHostnameOrService, bool p_bAdditionalData, uint32_t p_u16Offset) :
2175-
m_pNext(0),
2176-
m_pHostnameOrService(p_pHostnameOrService), m_bAdditionalData(p_bAdditionalData),
2177-
m_u16Offset(p_u16Offset)
2165+
m_pNext(0), m_pHostnameOrService(p_pHostnameOrService),
2166+
m_bAdditionalData(p_bAdditionalData), m_u16Offset(p_u16Offset)
21782167
{
21792168
}
21802169

libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ void setup() {
2121
// start I2S at 8 kHz with 24-bits per sample
2222
if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) {
2323
Serial.println("Failed to initialize I2S!");
24-
while (1)
25-
; // do nothing
24+
while (1); // do nothing
2625
}
2726
}
2827

libraries/I2S/examples/SimpleTone/SimpleTone.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ void setup() {
2626
// start I2S at the sample rate with 16-bits per sample
2727
if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
2828
Serial.println("Failed to initialize I2S!");
29-
while (1)
30-
; // do nothing
29+
while (1); // do nothing
3130
}
3231
}
3332

libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino

+2-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ void setup() {
5555

5656
if (!SD.begin(PIN_SD_CS)) {
5757
Serial.println("failed!");
58-
while (1)
59-
; // init fail, die here
58+
while (1); // init fail, die here
6059
}
6160

6261
Serial.println("SD OK!");
@@ -69,8 +68,7 @@ void loop() {
6968
bmpFile = SD.open(__Gsbmp_files[i]);
7069
if (!bmpFile) {
7170
Serial.println("didn't find image");
72-
while (1)
73-
;
71+
while (1);
7472
}
7573

7674
if (!bmpReadHeader(bmpFile)) {

libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino

+3-6
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ void setup() {
9999

100100
if (!SD.begin(PIN_SD_CS)) {
101101
Serial.println("failed!");
102-
while (1)
103-
; // init fail, die here
102+
while (1); // init fail, die here
104103
}
105104

106105
Serial.println("SD OK!");
@@ -141,8 +140,7 @@ void loop() {
141140

142141
if (!bmpFile) {
143142
Serial.println("didn't find image");
144-
while (1)
145-
;
143+
while (1);
146144
}
147145

148146
if (!bmpReadHeader(bmpFile)) {
@@ -153,8 +151,7 @@ void loop() {
153151
bmpdraw(bmpFile, 0, 0, 1);
154152
bmpFile.close();
155153

156-
while (1)
157-
;
154+
while (1);
158155
}
159156

160157
/*********************************************/

libraries/esp8266/examples/SerialStress/SerialStress.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ void setup() {
8181
// bind RX and TX
8282
USC0(0) |= (1 << UCLBE);
8383

84-
while (Serial.read() == -1)
85-
;
84+
while (Serial.read() == -1);
8685
if (Serial.hasOverrun()) { logger->print("overrun?\n"); }
8786

8887
timeout = (start_ms = last_ms = millis()) + TIMEOUT;

tests/clang-format-core.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ BreakBeforeBraces: Allman
2727
IndentWidth: 4
2828
IndentCaseLabels: false
2929
ReflowComments: false
30+
SkipMacroDefinitionBody: true

tests/device/libraries/BSTest/src/BSTest.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class TestCase
2727
public:
2828
TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name,
2929
const char* desc) :
30-
m_func(func),
31-
m_file(file), m_line(line), m_name(name), m_desc(desc)
30+
m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
3231
{
3332
if (prev)
3433
{

tests/host/common/queue.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
struct name \
185185
{ \
186186
struct type* stqh_first; /* first element */ \
187-
struct type** stqh_last; /* addr of last next element */ \
187+
struct type** stqh_last; /* addr of last next element */ \
188188
}
189189

190190
#define STAILQ_HEAD_INITIALIZER(head) \
@@ -371,7 +371,7 @@
371371
struct name \
372372
{ \
373373
struct type* tqh_first; /* first element */ \
374-
struct type** tqh_last; /* addr of last next element */ \
374+
struct type** tqh_last; /* addr of last next element */ \
375375
}
376376

377377
#define TAILQ_HEAD_INITIALIZER(head) \

tests/restyle.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ test -d ${root}/cores/esp8266
88
test -d ${root}/libraries
99

1010
# allow `env CLANG_FORMAT=clang-format-N`, or some other version
11-
# default to v15, latest stable version from ubuntu-latest Github Actions image
12-
CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15}
11+
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
1312

1413
cd $root
1514
python $root/tests/restyle.py format --clang-format=$CLANG_FORMAT preset --include core --include arduino
1615

17-
if [ $CI = "true" ] ; then
18-
echo foo
16+
if [ "$CI" = "true" ] ; then
1917
python $root/tests/restyle.py assert --with-summary --with-errors
2018
else
21-
echo bar
2219
python $root/tests/restyle.py assert --with-diff
2320
fi

0 commit comments

Comments
 (0)