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
@@ -208,7 +208,8 @@ uint8_t tsm_next_free_invokeID(void)
* @param apdu Pointer to the received message.
* @param apdu_len Bytes valid in the received message.
*/
void tsm_set_confirmed_unsegmented_transaction(uint8_t invokeID,
void tsm_set_confirmed_unsegmented_transaction(
uint8_t invokeID,
const BACNET_ADDRESS *dest,
const BACNET_NPDU_DATA *ndpu_data,
const uint8_t *apdu,
@@ -252,7 +253,8 @@ void tsm_set_confirmed_unsegmented_transaction(uint8_t invokeID,
* the count of bytes valid in the
* received message.
*/
bool tsm_get_transaction_pdu(uint8_t invokeID,
bool tsm_get_transaction_pdu(
uint8_t invokeID,
BACNET_ADDRESS *dest,
BACNET_NPDU_DATA *ndpu_data,
uint8_t *apdu,
@@ -311,8 +313,9 @@ void tsm_timer_milliseconds(uint16_t milliseconds)
if (plist->RetryCount < apdu_retries()) {
plist->RequestTimer = apdu_timeout();
plist->RetryCount++;
datalink_send_pdu(&plist->dest, &plist->npdu_data,
&plist->apdu[0], plist->apdu_len);
datalink_send_pdu(
&plist->dest, &plist->npdu_data, &plist->apdu[0],
plist->apdu_len);
} else {
/* note: the invoke id has not been cleared yet
and this indicates a failed message: