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
+62 -77
View File
@@ -22,84 +22,69 @@
extern "C" {
#endif /* __cplusplus */
struct BACnet_Write_Access_Data;
typedef struct BACnet_Write_Access_Data {
BACNET_OBJECT_TYPE object_type;
uint32_t object_instance;
/* simple linked list of values */
BACNET_PROPERTY_VALUE *listOfProperties;
struct BACnet_Write_Access_Data *next;
} BACNET_WRITE_ACCESS_DATA;
struct BACnet_Write_Access_Data;
typedef struct BACnet_Write_Access_Data {
BACNET_OBJECT_TYPE object_type;
uint32_t object_instance;
/* simple linked list of values */
BACNET_PROPERTY_VALUE *listOfProperties;
struct BACnet_Write_Access_Data *next;
} BACNET_WRITE_ACCESS_DATA;
/* decode the service request only */
BACNET_STACK_EXPORT
int wpm_decode_object_id(
const uint8_t * apdu,
uint16_t apdu_len,
BACNET_WRITE_PROPERTY_DATA * wpdata);
/* decode the service request only */
BACNET_STACK_EXPORT
int wpm_decode_object_id(
const uint8_t *apdu, uint16_t apdu_len, BACNET_WRITE_PROPERTY_DATA *wpdata);
BACNET_STACK_EXPORT
int wpm_decode_object_property(
const uint8_t * apdu,
uint16_t apdu_len,
BACNET_WRITE_PROPERTY_DATA * wpdata);
BACNET_STACK_EXPORT
int wpm_decode_object_property(
const uint8_t *apdu, uint16_t apdu_len, BACNET_WRITE_PROPERTY_DATA *wpdata);
/* encode objects */
BACNET_STACK_EXPORT
int wpm_encode_apdu_init(
uint8_t * apdu,
uint8_t invoke_id);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_begin(
uint8_t * apdu,
BACNET_OBJECT_TYPE object_type,
uint32_t object_instance);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_property(
uint8_t * apdu,
const BACNET_WRITE_PROPERTY_DATA * wpdata);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_end(
uint8_t * apdu);
/* encode objects */
BACNET_STACK_EXPORT
int wpm_encode_apdu_init(uint8_t *apdu, uint8_t invoke_id);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_begin(
uint8_t *apdu, BACNET_OBJECT_TYPE object_type, uint32_t object_instance);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_property(
uint8_t *apdu, const BACNET_WRITE_PROPERTY_DATA *wpdata);
BACNET_STACK_EXPORT
int wpm_encode_apdu_object_end(uint8_t *apdu);
BACNET_STACK_EXPORT
int write_property_multiple_request_encode(uint8_t *apdu,
BACNET_WRITE_ACCESS_DATA *data);
BACNET_STACK_EXPORT
size_t write_property_multiple_request_service_encode(
uint8_t *apdu,
size_t apdu_size,
BACNET_WRITE_ACCESS_DATA *data);
BACNET_STACK_EXPORT
int write_property_multiple_request_encode(
uint8_t *apdu, BACNET_WRITE_ACCESS_DATA *data);
BACNET_STACK_EXPORT
size_t write_property_multiple_request_service_encode(
uint8_t *apdu, size_t apdu_size, BACNET_WRITE_ACCESS_DATA *data);
BACNET_STACK_EXPORT
int wpm_encode_apdu(
uint8_t * apdu,
size_t max_apdu,
uint8_t invoke_id,
BACNET_WRITE_ACCESS_DATA * write_access_data);
BACNET_STACK_EXPORT
int wpm_encode_apdu(
uint8_t *apdu,
size_t max_apdu,
uint8_t invoke_id,
BACNET_WRITE_ACCESS_DATA *write_access_data);
/* encode service */
BACNET_STACK_EXPORT
int wpm_ack_encode_apdu_init(
uint8_t * apdu,
uint8_t invoke_id);
/* encode service */
BACNET_STACK_EXPORT
int wpm_ack_encode_apdu_init(uint8_t *apdu, uint8_t invoke_id);
BACNET_STACK_EXPORT
int wpm_error_ack_encode_apdu(
uint8_t * apdu,
uint8_t invoke_id,
const BACNET_WRITE_PROPERTY_DATA * wp_data);
BACNET_STACK_EXPORT
int wpm_error_ack_encode_apdu(
uint8_t *apdu,
uint8_t invoke_id,
const BACNET_WRITE_PROPERTY_DATA *wp_data);
BACNET_STACK_EXPORT
int wpm_error_ack_decode_apdu(
const uint8_t *apdu,
uint16_t apdu_size,
BACNET_WRITE_PROPERTY_DATA * wp_data);
BACNET_STACK_EXPORT
int wpm_error_ack_decode_apdu(
const uint8_t *apdu,
uint16_t apdu_size,
BACNET_WRITE_PROPERTY_DATA *wp_data);
BACNET_STACK_EXPORT
void wpm_write_access_data_link_array(
BACNET_WRITE_ACCESS_DATA *base,
size_t size);
BACNET_STACK_EXPORT
void wpm_write_access_data_link_array(
BACNET_WRITE_ACCESS_DATA *base, size_t size);
#ifdef __cplusplus
}
@@ -112,15 +97,15 @@ extern "C" {
* This service potentially allows write access to any property of any object,
* whether a BACnet-defined object or not.
* Properties shall be modified by the WritePropertyMultiple service
* in the order specified in the 'List of Write Access Specifications' parameter,
* and execution of the service shall continue until all of the specified
* properties have been written to or a property is encountered that
* in the order specified in the 'List of Write Access Specifications'
* parameter, and execution of the service shall continue until all of the
* specified properties have been written to or a property is encountered that
* for some reason cannot be modified as requested.
* Some implementors may wish to restrict write access to certain properties
* of certain objects. In such cases, an attempt to modify a restricted property
* shall result in the return of an error of 'Error Class' PROPERTY and 'Error Code'
* WRITE_ACCESS_DENIED. Note that these restricted properties may be accessible
* through the use of Virtual Terminal services or other means at the discretion
* of the implementor.
*/
* shall result in the return of an error of 'Error Class' PROPERTY and 'Error
* Code' WRITE_ACCESS_DENIED. Note that these restricted properties may be
* accessible through the use of Virtual Terminal services or other means at the
* discretion of the implementor.
*/
#endif