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 -5
View File
@@ -58,8 +58,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;
@@ -106,7 +106,8 @@ int main(int argc, char *argv[])
uint16_t result_code = 0;
if (argc < 2) {
printf("Usage: %s IP port <IP:port[:mask]> [<IP:port[:mask]>]\r\n",
printf(
"Usage: %s IP port <IP:port[:mask]> [<IP:port[:mask]>]\r\n",
filename_remove_path(argv[0]));
return 0;
}
@@ -153,8 +154,9 @@ int main(int argc, char *argv[])
argi = 3;
while (argc > argi) {
bdt_entry = &BBMD_Table_Entry[bdti];
c = sscanf(argv[argi], "%3u.%3u.%3u.%3u:%5u:%3u.%3u.%3u.%3u", &a[0],
&a[1], &a[2], &a[3], &p, &m[0], &m[1], &m[2], &m[3]);
c = sscanf(
argv[argi], "%3u.%3u.%3u.%3u:%5u:%3u.%3u.%3u.%3u", &a[0], &a[1],
&a[2], &a[3], &p, &m[0], &m[1], &m[2], &m[3]);
if ((c == 4) || (c == 5) || (c == 9)) {
bvlc_address_set(&bdt_entry->dest_address, a[0], a[1], a[2], a[3]);
if ((c == 5) || (c == 9)) {