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
+14 -12
View File
@@ -46,8 +46,8 @@ static void MyAbortHandler(
Error_Detected = true;
}
static void MyRejectHandler(
BACNET_ADDRESS *src, uint8_t invoke_id, uint8_t reject_reason)
static void
MyRejectHandler(BACNET_ADDRESS *src, uint8_t invoke_id, uint8_t reject_reason)
{
/* FIXME: verify src and invoke id */
(void)src;
@@ -83,15 +83,16 @@ static void print_usage(const char *filename)
static void print_help(const char *filename)
{
printf("Send BACnet I-Am-Router-To-Network message for \n"
"one or more networks.\n"
"\nDNET:\n"
"BACnet destination network number 0-65534\n"
"To send a I-Am-Router-To-Network message for DNET 86:\n"
"%s 86\n"
"To send a I-Am-Router-To-Network message for multiple DNETs\n"
"use the following command:\n"
"%s 86 42 24 14\n",
printf(
"Send BACnet I-Am-Router-To-Network message for \n"
"one or more networks.\n"
"\nDNET:\n"
"BACnet destination network number 0-65534\n"
"To send a I-Am-Router-To-Network message for DNET 86:\n"
"%s 86\n"
"To send a I-Am-Router-To-Network message for multiple DNETs\n"
"use the following command:\n"
"%s 86 42 24 14\n",
filename, filename);
}
@@ -136,7 +137,8 @@ int main(int argc, char *argv[])
Target_Router_Networks[arg_count] = -1;
/* invalid DNET? */
if (Target_Router_Networks[arg_count - 1] >= 65535) {
fprintf(stderr, "DNET=%u - it must be less than %u\n",
fprintf(
stderr, "DNET=%u - it must be less than %u\n",
Target_Router_Networks[arg_count - 1], 65535);
return 1;
}