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
@@ -227,13 +227,13 @@ bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
* functions.
*
* @param dest [in] The BACNET_ADDRESS of the message's destination.
* If the Length of the mac_adress[] field is 0, then this is a
* If the Length of the mac_adress[] field is 0, then this is a
* MAC broadcast. Otherwise, size is determined by the DLL type (eg, 6 for BIP
* and 2 for MSTP).
* @param DNET_list [in] List of our reachable downstream BACnet Network
* numbers. Normally just one valid entry; terminated with a -1 value.
* @param cursor [in,out] The concept of the cursor is that it is a starting
* "hint" for the search; on return, it is updated to provide
* "hint" for the search; on return, it is updated to provide
* the cursor value to use with a subsequent GetNext call, or it equals -1 if
* there are no further matches. Set it to 0 on entry to access the main,
* gateway Device entry, or to start looping through the routed devices.
@@ -241,7 +241,7 @@ bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
* calling function should not alter or interpret it.
*
* @return True if the MAC addresses match (or if BACNET_BROADCAST_NETWORK and
* the dest->len is 0, meaning MAC bcast, so it's an automatic
* the dest->len is 0, meaning MAC bcast, so it's an automatic
* match). Else False if no match or invalid idx is given; the cursor will be
* returned as -1 in these cases.
*/
@@ -307,12 +307,12 @@ bool Routed_Device_GetNext(BACNET_ADDRESS *dest, int *DNET_list, int *cursor)
* or local or else broadcast.
*
* @param dest_net [in] The BACnet network number of a message's destination.
* Success if it is our virtual network number, or 0 (local for
* Success if it is our virtual network number, or 0 (local for
* the gateway, or 0xFFFF for a broadcast network number.
* @param DNET_list [in] List of our reachable downstream BACnet Network
* numbers. Normally just one valid entry; terminated with a -1 value.
* @return True if matches our virtual network, or is for the local network
* Device (the gateway), or is BACNET_BROADCAST_NETWORK,
* Device (the gateway), or is BACNET_BROADCAST_NETWORK,
* which is an automatic match. Else False if not a reachable network.
*/
bool Routed_Device_Is_Valid_Network(uint16_t dest_net, int *DNET_list)