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
+5 -5
View File
@@ -757,7 +757,7 @@ int bacnet_tag_number_and_value_decode(
}
/**
* @brief Determine the data length from the application tag number
* @brief Determine the data length from the application tag number
* @param tag_number application tag number to be evaluated.
* @param len_value_type Length of the data in bytes.
* @return datalength for the given tag, or INT_MAX if out of range.
@@ -801,7 +801,7 @@ int bacnet_application_data_length(
* @param apdu Pointer to the APDU buffer
* @param apdu_size Bytes valid in the buffer
* @param property ID of the property to get the length for.
* @return length of data between an opening tag and a closing tag 0..N,
* @return length of data between an opening tag and a closing tag 0..N,
* or BACNET_STATUS_ERROR.
*/
int bacnet_enclosed_data_length(
@@ -862,7 +862,7 @@ int bacnet_enclosed_data_length(
return BACNET_STATUS_ERROR;
}
/* application tagged data */
len += bacnet_application_data_length(tag.number,
len += bacnet_application_data_length(tag.number,
tag.len_value_type);
total_len_enable = true;
}
@@ -946,7 +946,7 @@ bool decode_is_context_tag_with_length(
* @return true on a match, false otherwise.
*/
bool bacnet_is_context_tag_number(
uint8_t *apdu, uint32_t apdu_size, uint8_t tag_number, int *tag_length,
uint8_t *apdu, uint32_t apdu_size, uint8_t tag_number, int *tag_length,
uint32_t *len_value_type)
{
bool match = false;
@@ -2751,7 +2751,7 @@ int bacnet_unsigned_context_decode(uint8_t *apdu,
/**
* @brief Encode an application tagged BACnet Unsigned value
* From clause 20.2.4 Encoding of an Unsigned Integer Value
* From clause 20.2.4 Encoding of an Unsigned Integer Value
* and 20.2.1 General Rules for Encoding BACnet Tags
*
* @param apdu - buffer to hold the data to be encoded, or NULL for length