Fix cppcheck warning "Variable is assigned a value that is never used"
This commit is contained in:
parent
f152aaffa3
commit
0aa1ff309e
2 changed files with 1 additions and 4 deletions
|
@ -127,7 +127,7 @@ uart_flush_input(serial_port sp)
|
|||
}
|
||||
char *rx = malloc(available_bytes_count);
|
||||
// There is something available, read the data
|
||||
res = read(UART_DATA(sp)->fd, rx, available_bytes_count);
|
||||
read(UART_DATA(sp)->fd, rx, available_bytes_count);
|
||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%d bytes have eatten.", available_bytes_count);
|
||||
free(rx);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,6 @@ target_thread(void *arg)
|
|||
// Second pass
|
||||
res = nfc_target_receive_bytes(device, abtRx, sizeof(abtRx), 500);
|
||||
cut_assert_operator_int(res, > , 0, cut_message("Can't receive bytes from initiator: %s", nfc_strerror(device)));
|
||||
szRx = (size_t) res;
|
||||
|
||||
cut_assert_equal_memory(abtAttRx, sizeof(abtAttRx), abtRx, res, cut_message("Invalid received data"));
|
||||
if (res <= 0) { thread_res = -1; return (void *) thread_res; }
|
||||
|
@ -117,7 +116,6 @@ target_thread(void *arg)
|
|||
// Third pass
|
||||
res = nfc_target_receive_bytes(device, abtRx, sizeof(abtRx), 500);
|
||||
cut_assert_operator_int(res, > , 0, cut_message("Can't receive bytes from initiator: %s", nfc_strerror(device)));
|
||||
szRx = (size_t) res;
|
||||
|
||||
cut_assert_equal_memory(abtAttRx, sizeof(abtAttRx), abtRx, res, cut_message("Invalid received data"));
|
||||
if (res <= 0) { thread_res = -1; return (void *) thread_res; }
|
||||
|
@ -129,7 +127,6 @@ target_thread(void *arg)
|
|||
// Fourth pass
|
||||
res = nfc_target_receive_bytes(device, abtRx, sizeof(abtRx), 500);
|
||||
cut_assert_operator_int(res, > , 0, cut_message("Can't receive bytes from initiator: %s", nfc_strerror(device)));
|
||||
szRx = (size_t) res;
|
||||
|
||||
cut_assert_equal_memory(abtAttRx, sizeof(abtAttRx), abtRx, res, cut_message("Invalid received data"));
|
||||
if (res <= 0) { thread_res = -1; return (void *) thread_res; }
|
||||
|
|
Loading…
Reference in a new issue