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
+2 -2
View File
@@ -18,9 +18,9 @@
/* Device configuration definitions. */
#define FIRST_DEVICE_NUMBER 260001
#define VIRTUAL_DNET 2709 /* your choice of number here */
#define VIRTUAL_DNET 2709 /* your choice of number here */
#define DEV_NAME_BASE "Gateway Demo Device"
#define DEV_DESCR_GATEWAY "Gateway Device and Router"
#define DEV_DESCR_REMOTE "Routed Remote Device"
#define DEV_DESCR_REMOTE "Routed Remote Device"
#endif
+9 -8
View File
@@ -188,7 +188,8 @@ static void Init_Service_Handlers(uint32_t first_object_instance)
apdu_set_unconfirmed_handler(
SERVICE_UNCONFIRMED_COV_NOTIFICATION, handler_ucov_notification);
/* handle communication so we can shutup when asked */
apdu_set_confirmed_handler(SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
apdu_set_confirmed_handler(
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
handler_device_communication_control);
}
@@ -225,16 +226,16 @@ int main(int argc, char *argv[])
if ((first_object_instance == 0) ||
(first_object_instance > BACNET_MAX_INSTANCE)) {
printf("Error: Invalid Object Instance %s \n", argv[1]);
printf(
"Provide a number from 1 to %ul \n", BACNET_MAX_INSTANCE);
printf("Provide a number from 1 to %ul \n", BACNET_MAX_INSTANCE);
exit(1);
}
}
printf("BACnet Router Demo\n"
"BACnet Stack Version %s\n"
"BACnet Device ID: %u\n"
"Max APDU: %d\n"
"Max Devices: %d\n",
printf(
"BACnet Router Demo\n"
"BACnet Stack Version %s\n"
"BACnet Device ID: %u\n"
"Max APDU: %d\n"
"Max Devices: %d\n",
BACnet_Version, first_object_instance, MAX_APDU, MAX_NUM_DEVICES);
Init_Service_Handlers(first_object_instance);
dlenv_init();