Strip tabs and trailing white spaces, and fix end of files (#748)

* format: Strip trailing whitespaces

We want to get rid of trailing whitespaces completly as they make just git
noice. Much better to start using automated tools to get rid of them once and
not getting them back again. This way git history will be cleaner and review
easier.

Commit was generated with:

    pre-commit run --all-files trailing-whitespace

* format: Files should have exactly one new line end of them

It is good practice that every file has one new line. It is not now days so
mandatory but it also is not nice if file has lot of newlines end of it. We will
use pre-commit which takes automatically care about this so let's fix all.

Commit was generated with:

    pre-commit run --all-files end-of-file-fixer

* format: Convert tabs to spaces

Project mostly use spaces over tabs. When mixing tabs and spaces this usually
makes formatting issues and also when changing those in commits it will make lot
of git noise. We will force spaces most of the time and use pre-commit to fix.

Commit was generated with:

    pre-commit run --all-files remove-tabs

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2024-08-25 22:13:57 +03:00
committed by GitHub
parent 9e0657424e
commit 369da70f2a
455 changed files with 7147 additions and 7249 deletions
+10 -10
View File
@@ -188,7 +188,7 @@ int wpm_decode_object_property(
return len;
}
/**
/**
* @brief Init the APDU for encoding.
* @param apdu [in] The APDU buffer, or NULL for length
* @param invoke_id [in] The ID of the saervice invoked.
@@ -206,7 +206,7 @@ int wpm_encode_apdu_init(uint8_t *apdu, uint8_t invoke_id)
return 4;
}
/**
/**
* @brief Decode the very begin of an object in the APDU.
* @param apdu [in] The APDU buffer, or NULL for length
* @param object_type [in] The object type to decode.
@@ -231,7 +231,7 @@ int wpm_encode_apdu_object_begin(
return apdu_len;
}
/**
/**
* @brief Encode the very end of an object in the APDU.
* @param apdu [in] The APDU buffer, or NULL for length
* @return number of bytes encoded
@@ -241,7 +241,7 @@ int wpm_encode_apdu_object_end(uint8_t *apdu)
return encode_closing_tag(apdu, 1);
}
/**
/**
* @brief Encode the object property into the APDU.
* @param apdu [in] The APDU buffer, or NULL for length
* @param wpdata [in] Pointer to the property data.
@@ -300,14 +300,14 @@ int wpm_encode_apdu_object_property(
* @brief Encode APDU for WritePropertyMultiple-Request
*
* WritePropertyMultiple-Request ::= SEQUENCE {
*
*
* }
*
* @param apdu Pointer to the buffer, or NULL for length
* @param data Pointer to the data to encode.
* @return number of bytes encoded, or zero on error.
*/
int write_property_multiple_request_encode(uint8_t *apdu,
int write_property_multiple_request_encode(uint8_t *apdu,
BACNET_WRITE_ACCESS_DATA *data)
{
int len = 0; /* length of each encoding */
@@ -332,7 +332,7 @@ int write_property_multiple_request_encode(uint8_t *apdu,
/* check length for fitting */
wpdata.application_data_len = bacapp_encode_data(
NULL, &wpm_property->value);
if (wpdata.application_data_len >
if (wpdata.application_data_len >
sizeof(wpdata.application_data)) {
/* too big for buffer */
return 0;
@@ -362,7 +362,7 @@ int write_property_multiple_request_encode(uint8_t *apdu,
* @param apdu Pointer to the buffer for encoding into
* @param apdu_size number of bytes available in the buffer
* @param data Pointer to the service data used for encoding values
* @return number of bytes encoded, or zero if unable to encode or
* @return number of bytes encoded, or zero if unable to encode or
* too big for buffer
*/
size_t write_property_multiple_request_service_encode(
@@ -381,13 +381,13 @@ size_t write_property_multiple_request_service_encode(
return apdu_len;
}
/**
/**
* @brief Encode the WritePropertyMultiple-Request into the APDU.
* @param apdu [in] The APDU buffer
* @param apdu_size [in] Maximum space in the buffer.
* @param invoke_id [in] Invoked service ID.
* @param data [in] BACnetWriteAccessData
* @return number of bytes encoded, or zero if unable to encode or
* @return number of bytes encoded, or zero if unable to encode or
* too big for buffer
*/
int wpm_encode_apdu(uint8_t *apdu,