Bugfix/clang tidy applied 2022 (#232)

* clang-tidy applied fixes to src folder
* clang-tidy applied fixes to apps folder

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2022-02-27 19:14:17 -06:00
committed by GitHub
parent 5e70eeecfc
commit d0fe77c030
33 changed files with 211 additions and 123 deletions
+8 -4
View File
@@ -60,8 +60,9 @@ static void DecodeBlock(char cBlockNum, uint8_t *pData)
tag_len =
decode_tag_number_and_value(&pData[iLen], &tag_number, &len_value_type);
iLen += tag_len;
if (tag_number != BACNET_APPLICATION_TAG_UNSIGNED_INT)
if (tag_number != BACNET_APPLICATION_TAG_UNSIGNED_INT) {
return;
}
iLen += decode_unsigned(&pData[iLen], len_value_type, &ulTemp);
Response.cMyByte1 = (char)ulTemp;
@@ -69,8 +70,9 @@ static void DecodeBlock(char cBlockNum, uint8_t *pData)
tag_len =
decode_tag_number_and_value(&pData[iLen], &tag_number, &len_value_type);
iLen += tag_len;
if (tag_number != BACNET_APPLICATION_TAG_UNSIGNED_INT)
if (tag_number != BACNET_APPLICATION_TAG_UNSIGNED_INT) {
return;
}
iLen += decode_unsigned(&pData[iLen], len_value_type, &ulTemp);
Response.cMyByte2 = (char)ulTemp;
@@ -78,16 +80,18 @@ static void DecodeBlock(char cBlockNum, uint8_t *pData)
tag_len =
decode_tag_number_and_value(&pData[iLen], &tag_number, &len_value_type);
iLen += tag_len;
if (tag_number != BACNET_APPLICATION_TAG_REAL)
if (tag_number != BACNET_APPLICATION_TAG_REAL) {
return;
}
iLen += decode_real(&pData[iLen], &Response.fMyReal);
tag_len =
decode_tag_number_and_value(&pData[iLen], &tag_number, &len_value_type);
iLen += tag_len;
if (tag_number != BACNET_APPLICATION_TAG_CHARACTER_STRING)
if (tag_number != BACNET_APPLICATION_TAG_CHARACTER_STRING) {
return;
}
iLen += decode_character_string(&pData[iLen], len_value_type, &bsName);
strncpy(
+6 -3
View File
@@ -299,12 +299,14 @@ int main(int argc, char *argv[])
tsm_timer_milliseconds(
((current_seconds - last_seconds) * 1000));
}
if (Error_Detected)
if (Error_Detected) {
break;
}
/* wait until the device is bound, or timeout and quit */
if (!found)
if (!found) {
found = address_bind_request(
Target_Device_Object_Instance, &max_apdu, &Target_Address);
}
if (found) {
if (invoke_id == 0) { /* Safe to send a new request */
switch (iType) {
@@ -394,7 +396,8 @@ int main(int argc, char *argv[])
last_seconds = current_seconds;
}
}
if (Error_Detected)
if (Error_Detected) {
return 1;
}
return 0;
}
+2 -1
View File
@@ -70,8 +70,9 @@ uint8_t Send_Private_Transfer_Request(uint32_t device_id,
/* is the device bound? */
status = address_get_by_device(device_id, &max_apdu, &dest);
/* is there a tsm available? */
if (status)
if (status) {
invoke_id = tsm_next_free_invokeID();
}
if (invoke_id) {
/* encode the NPDU portion of the packet */
datalink_get_my_address(&my_address);