Run clang-format and enable CI check for it (#755)

* pre-commit: Update and enable clang-format check

There is newer version from clang-format so use that. We do not yet want
18 as that is little bit too new.

* Format some thing by hand which clang-format "breaks"

Clang-format will format some things little bit off in some cases.
Format some things by hand so we get cleaner end result.

* Run clang-format with

```
pre-commit run --all-files clang-format
```

We have already in previously checked places where clang-format does not
make good format and ignored those (hopefully most of the things).

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2024-08-30 19:20:58 +03:00
committed by GitHub
parent 622a9e609e
commit f806c5829b
547 changed files with 18286 additions and 16575 deletions
+7 -4
View File
@@ -105,8 +105,9 @@ void *dl_mstp_thread(void *pArgs)
msg_data->dest.mac_len = 1;
}
dlmstp_send_pdu(&mstp_port, &(msg_data->dest),
msg_data->pdu, msg_data->pdu_len);
dlmstp_send_pdu(
&mstp_port, &(msg_data->dest), msg_data->pdu,
msg_data->pdu_len);
check_data(msg_data);
@@ -129,13 +130,15 @@ void *dl_mstp_thread(void *pArgs)
if (pdu_len > 0) {
msg_data = (MSG_DATA *)malloc(sizeof(MSG_DATA));
memmove(&(msg_data->src),
memmove(
&(msg_data->src),
(const void *)&(shared_port_data.Receive_Packet.address),
sizeof(shared_port_data.Receive_Packet.address));
msg_data->src.adr[0] = msg_data->src.mac[0];
msg_data->src.len = 1;
msg_data->pdu = (uint8_t *)malloc(pdu_len);
memmove(msg_data->pdu,
memmove(
msg_data->pdu,
(const void *)&(shared_port_data.Receive_Packet.pdu),
pdu_len);
msg_data->pdu_len = pdu_len;