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:
@@ -44,7 +44,8 @@
|
||||
* the type of message.
|
||||
* @return Number of bytes sent, or <=0 if no message was sent.
|
||||
*/
|
||||
int Send_Network_Layer_Message(BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
int Send_Network_Layer_Message(
|
||||
BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
BACNET_ADDRESS *dst,
|
||||
const int *iArgs)
|
||||
{
|
||||
@@ -69,8 +70,9 @@ int Send_Network_Layer_Message(BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
if (network_message_type == NETWORK_MESSAGE_INIT_RT_TABLE) {
|
||||
data_expecting_reply = true; /* DER in this one case */
|
||||
}
|
||||
npdu_encode_npdu_network(&npdu_data, network_message_type,
|
||||
data_expecting_reply, MESSAGE_PRIORITY_NORMAL);
|
||||
npdu_encode_npdu_network(
|
||||
&npdu_data, network_message_type, data_expecting_reply,
|
||||
MESSAGE_PRIORITY_NORMAL);
|
||||
|
||||
/* We don't need src information, since a message can't originate from
|
||||
* our downstream BACnet network.
|
||||
@@ -152,16 +154,19 @@ int Send_Network_Layer_Message(BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
break;
|
||||
|
||||
default:
|
||||
debug_printf("Not sent: %s message unsupported \n",
|
||||
debug_printf(
|
||||
"Not sent: %s message unsupported \n",
|
||||
bactext_network_layer_msg_name(network_message_type));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dst != NULL) {
|
||||
debug_printf("Sending %s message to BACnet network %u \n",
|
||||
debug_printf(
|
||||
"Sending %s message to BACnet network %u \n",
|
||||
bactext_network_layer_msg_name(network_message_type), dst->net);
|
||||
} else {
|
||||
debug_printf("Sending %s message to local BACnet network \n",
|
||||
debug_printf(
|
||||
"Sending %s message to local BACnet network \n",
|
||||
bactext_network_layer_msg_name(network_message_type));
|
||||
}
|
||||
|
||||
@@ -171,7 +176,8 @@ int Send_Network_Layer_Message(BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0) {
|
||||
int wasErrno = errno; /* preserve the errno */
|
||||
debug_printf("Failed to send %s message (%s)!\n",
|
||||
debug_printf(
|
||||
"Failed to send %s message (%s)!\n",
|
||||
bactext_network_layer_msg_name(network_message_type),
|
||||
strerror(wasErrno));
|
||||
}
|
||||
@@ -252,8 +258,7 @@ void Send_Reject_Message_To_Network(
|
||||
void Send_Initialize_Routing_Table(BACNET_ADDRESS *dst, const int DNET_list[])
|
||||
{
|
||||
/* Use a NULL dst here since we want a broadcast MAC address. */
|
||||
Send_Network_Layer_Message(
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE, dst, DNET_list);
|
||||
Send_Network_Layer_Message(NETWORK_MESSAGE_INIT_RT_TABLE, dst, DNET_list);
|
||||
}
|
||||
|
||||
/** Sends our Routing Table, built from our DNET[] array, as an ACK.
|
||||
|
||||
Reference in New Issue
Block a user