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:
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user