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
+21 -16
View File
@@ -18,19 +18,22 @@
/**
* @brief Callback function for iterating the results of the device discovery.
* @param device_id [in] The device ID of the data
* @param device_index [in] The index of the device in the list of discovered devices
* @param object_index [in] The index of the object in the list of discovered objects in the device
* @param property_index [in] The index of the property in the list of discovered properties in the object in the device
* @param device_index [in] The index of the device in the list of discovered
* devices
* @param object_index [in] The index of the object in the list of discovered
* objects in the device
* @param property_index [in] The index of the property in the list of
* discovered properties in the object in the device
* @param rp_data [in] The contents of the device object property
* @param context_data [in] The context data passed to the discover function
* @return true if the iteration should continue, false if it should stop
*/
typedef bool (*bacnet_discover_device_callback) (
*/
typedef bool (*bacnet_discover_device_callback)(
uint32_t device_id,
unsigned device_index,
unsigned object_index,
unsigned property_index,
BACNET_READ_PROPERTY_DATA * rp_data,
BACNET_READ_PROPERTY_DATA *rp_data,
void *context_data);
#ifdef __cplusplus
@@ -47,14 +50,12 @@ uint32_t bacnet_discover_device_instance(unsigned index);
BACNET_STACK_EXPORT
int bacnet_discover_device_object_count(uint32_t device_id);
BACNET_STACK_EXPORT
bool bacnet_discover_device_object_identifier(uint32_t device_id,
unsigned index, BACNET_OBJECT_ID *object_id);
bool bacnet_discover_device_object_identifier(
uint32_t device_id, unsigned index, BACNET_OBJECT_ID *object_id);
BACNET_STACK_EXPORT
unsigned long bacnet_discover_device_elapsed_milliseconds(
uint32_t device_id);
unsigned long bacnet_discover_device_elapsed_milliseconds(uint32_t device_id);
BACNET_STACK_EXPORT
size_t bacnet_discover_device_memory(
uint32_t device_id);
size_t bacnet_discover_device_memory(uint32_t device_id);
BACNET_STACK_EXPORT
unsigned int bacnet_discover_object_property_count(
uint32_t device_id,
@@ -68,13 +69,15 @@ bool bacnet_discover_object_property_identifier(
unsigned index,
uint32_t *property_id);
BACNET_STACK_EXPORT
bool bacnet_discover_property_value(uint32_t device_id,
bool bacnet_discover_property_value(
uint32_t device_id,
BACNET_OBJECT_TYPE object_type,
uint32_t object_instance,
BACNET_PROPERTY_ID object_property,
BACNET_APPLICATION_DATA_VALUE *value);
BACNET_STACK_EXPORT
bool bacnet_discover_property_name(uint32_t device_id,
bool bacnet_discover_property_name(
uint32_t device_id,
BACNET_OBJECT_TYPE object_type,
uint32_t object_instance,
BACNET_PROPERTY_ID object_property,
@@ -87,11 +90,13 @@ bool bacnet_discover_device_object_property_iterate(
uint32_t device_id,
BACNET_OBJECT_TYPE object_type,
uint32_t object_instance,
bacnet_discover_device_callback callback, void *context);
bacnet_discover_device_callback callback,
void *context);
BACNET_STACK_EXPORT
bool bacnet_discover_device_object_iterate(
uint32_t device_id,
bacnet_discover_device_callback callback, void *context);
bacnet_discover_device_callback callback,
void *context);
BACNET_STACK_EXPORT
bool bacnet_discover_device_iterate(
bacnet_discover_device_callback callback, void *context);