Skip to content

Commit a9009a8

Browse files
committed
[misc] Update .clang-format style
1 parent 31e1d51 commit a9009a8

File tree

12 files changed

+91
-25
lines changed

12 files changed

+91
-25
lines changed

.clang-format

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# 2024-07-30
12
Language: Cpp
23
BasedOnStyle: LLVM
34
AlignAfterOpenBracket: BlockIndent
@@ -6,6 +7,7 @@ AlignConsecutiveAssignments: true
67
AlignConsecutiveMacros: AcrossComments
78
AlignTrailingComments: true
89
AllowAllArgumentsOnNextLine: false
10+
AllowAllParametersOfDeclarationOnNextLine: false
911
AllowShortBlocksOnASingleLine: Empty
1012
AllowShortFunctionsOnASingleLine: Empty
1113
AlwaysBreakTemplateDeclarations: Yes
@@ -21,6 +23,7 @@ IndentCaseLabels: true
2123
IndentWidth: 4
2224
LambdaBodyIndentation: Signature
2325
MaxEmptyLinesToKeep: 1
26+
PenaltyReturnTypeOnItsOwnLine: 1000
2427
# PointerAlignment: Left # TODO enable this and reformat project
2528
QualifierAlignment: Left
2629
ReflowComments: true

cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
#include "WiFiPrivate.h"
44

5-
WiFiStatus
6-
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
5+
WiFiStatus WiFiClass::begin(
6+
const char *ssid,
7+
const char *passphrase,
8+
int32_t channel,
9+
const uint8_t *bssid,
10+
bool connect
11+
) {
712
if (!enableSTA(true))
813
return WL_CONNECT_FAILED;
914
if (!validate(ssid, passphrase))

cores/beken-72xx/base/wraps/BkDriverFlash.c

+12-4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ OSStatus __wrap_bk_flash_erase(bk_partition_t partition, uint32_t off_set, uint3
7070
return kNoErr;
7171
}
7272

73-
OSStatus
74-
__wrap_bk_flash_write(bk_partition_t partition, volatile uint32_t off_set, uint8_t *inBuffer, uint32_t inBufferLength) {
73+
OSStatus __wrap_bk_flash_write(
74+
bk_partition_t partition,
75+
volatile uint32_t off_set,
76+
uint8_t *inBuffer,
77+
uint32_t inBufferLength
78+
) {
7579
UINT32 status;
7680
DD_HANDLE flash_hdl;
7781
uint32_t start_addr;
@@ -98,8 +102,12 @@ __wrap_bk_flash_write(bk_partition_t partition, volatile uint32_t off_set, uint8
98102
return kNoErr;
99103
}
100104

101-
OSStatus
102-
__wrap_bk_flash_read(bk_partition_t partition, volatile uint32_t off_set, uint8_t *outBuffer, uint32_t inBufferLength) {
105+
OSStatus __wrap_bk_flash_read(
106+
bk_partition_t partition,
107+
volatile uint32_t off_set,
108+
uint8_t *outBuffer,
109+
uint32_t inBufferLength
110+
) {
103111
UINT32 status;
104112
uint32_t start_addr;
105113
DD_HANDLE flash_hdl;

cores/common/arduino/libraries/api/WiFi/WiFi.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,13 @@ class WiFiClass {
9797
const uint8_t *bssid = NULL,
9898
bool connect = true
9999
);
100-
WiFiStatus
101-
begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);
100+
WiFiStatus begin(
101+
char *ssid,
102+
char *passphrase = NULL,
103+
int32_t channel = 0,
104+
const uint8_t *bssid = NULL,
105+
bool connect = true
106+
);
102107

103108
bool config(
104109
IPAddress localIP,
@@ -178,7 +183,11 @@ class WiFiClass {
178183

179184
public: /* WiFiAP.cpp */
180185
bool softAP(
181-
const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4
186+
const char *ssid,
187+
const char *passphrase = NULL,
188+
int channel = 1,
189+
bool ssidHidden = false,
190+
int maxClients = 4
182191
);
183192
bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);
184193
bool softAPdisconnect(bool wifiOff = false);

cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
#include "WiFi.h"
44

55
bool WiFiClass::getNetworkInfo(
6-
uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel
6+
uint8_t networkItem,
7+
String &ssid,
8+
WiFiAuthMode &encType,
9+
int32_t &rssi,
10+
uint8_t *&bssid,
11+
int32_t &channel
712
) {
813
ssid = SSID(networkItem);
914
encType = encryptionType(networkItem);

cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,21 @@ int MbedTLSClient::connect(const char *host, uint16_t port, int32_t timeout) {
8686
}
8787

8888
int MbedTLSClient::connect(
89-
IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
89+
IPAddress ip,
90+
uint16_t port,
91+
const char *rootCABuf,
92+
const char *clientCert,
93+
const char *clientKey
9094
) {
9195
return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
9296
}
9397

9498
int MbedTLSClient::connect(
95-
const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
99+
const char *host,
100+
uint16_t port,
101+
const char *rootCABuf,
102+
const char *clientCert,
103+
const char *clientKey
96104
) {
97105
return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
98106
}

cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h

+16-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,22 @@
2626

2727
class IWiFiClientSecure {
2828
public:
29-
virtual int
30-
connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
31-
virtual int
32-
connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
33-
virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) = 0;
34-
virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) = 0;
29+
virtual int connect(
30+
IPAddress ip,
31+
uint16_t port,
32+
const char *rootCABuf,
33+
const char *clientCert,
34+
const char *clientKey
35+
) = 0;
36+
virtual int connect(
37+
const char *host,
38+
uint16_t port,
39+
const char *rootCABuf,
40+
const char *clientCert,
41+
const char *clientKey
42+
) = 0;
43+
virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) = 0;
44+
virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) = 0;
3545

3646
virtual int lastError(char *buf, const size_t size) = 0;
3747
virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!

cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ static bool enableMDNS(struct netif *netif) {
166166
}
167167

168168
#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
169-
static void
170-
mdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) {
169+
static void mdns_netif_ext_status_callback(
170+
struct netif *netif,
171+
netif_nsc_reason_t reason,
172+
const netif_ext_callback_args_t *args
173+
) {
171174
if (reason & LWIP_NSC_NETIF_REMOVED) {
172175
LT_DM(MDNS, "Netif removed, stopping mDNS on netif %u", netif->num);
173176
mdns_resp_remove_netif(netif);

cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,12 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcer
321321
}
322322

323323
bool HTTPClient::begin(
324-
String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key
324+
String host,
325+
uint16_t port,
326+
String uri,
327+
const char *CAcert,
328+
const char *cli_cert,
329+
const char *cli_key
325330
) {
326331
if (_client && !_tcpDeprecated) {
327332
log_d("mix up of new and deprecated api");

cores/common/arduino/libraries/ext/WebServer/WebServer.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class WebServer {
8181

8282
bool authenticate(const char *username, const char *password);
8383
void requestAuthentication(
84-
HTTPAuthMethod mode = BASIC_AUTH, const char *realm = NULL, const String &authFailMsg = String("")
84+
HTTPAuthMethod mode = BASIC_AUTH,
85+
const char *realm = NULL,
86+
const String &authFailMsg = String("")
8587
);
8688

8789
typedef std::function<void(void)> THandlerFunction;

cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ using namespace mime;
1010
class FunctionRequestHandler : public RequestHandler {
1111
public:
1212
FunctionRequestHandler(
13-
WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri &uri, HTTPMethod method
13+
WebServer::THandlerFunction fn,
14+
WebServer::THandlerFunction ufn,
15+
const Uri &uri,
16+
HTTPMethod method
1417
)
1518
: _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) {
1619
_uri->initPathArgs(pathArgs);

cores/realtek-amb/arduino/libraries/WiFi/WiFiSTA.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
#include "WiFiPrivate.h"
44

5-
WiFiStatus
6-
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
5+
WiFiStatus WiFiClass::begin(
6+
const char *ssid,
7+
const char *passphrase,
8+
int32_t channel,
9+
const uint8_t *bssid,
10+
bool connect
11+
) {
712
if (!enableSTA(true))
813
return WL_CONNECT_FAILED;
914
if (!validate(ssid, passphrase))

0 commit comments

Comments
 (0)