mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-18 13:33:48 +00:00
fixd compiler warnings
This commit is contained in:
@@ -176,7 +176,7 @@ uart_receive(serial_port sp, uint8_t *pbtRx, const size_t szRx, void *abort_p, i
|
|||||||
timeouts.WriteTotalTimeoutConstant = timeout_ms;
|
timeouts.WriteTotalTimeoutConstant = timeout_ms;
|
||||||
|
|
||||||
if (!SetCommTimeouts(((struct serial_port_windows *) sp)->hPort, &timeouts)) {
|
if (!SetCommTimeouts(((struct serial_port_windows *) sp)->hPort, &timeouts)) {
|
||||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_ERROR, "Unable to apply new timeout settings.");
|
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_ERROR, "%s", "Unable to apply new timeout settings.");
|
||||||
return NFC_EIO;
|
return NFC_EIO;
|
||||||
}
|
}
|
||||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Timeouts are set to %lu ms", timeout_ms);
|
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Timeouts are set to %lu ms", timeout_ms);
|
||||||
@@ -185,7 +185,7 @@ uart_receive(serial_port sp, uint8_t *pbtRx, const size_t szRx, void *abort_p, i
|
|||||||
// - According to MSDN, it could be better to implement nfc_abort_command() mecanism using Cancello()
|
// - According to MSDN, it could be better to implement nfc_abort_command() mecanism using Cancello()
|
||||||
volatile bool *abort_flag_p = (volatile bool *)abort_p;
|
volatile bool *abort_flag_p = (volatile bool *)abort_p;
|
||||||
do {
|
do {
|
||||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "ReadFile");
|
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%s", "ReadFile");
|
||||||
res = ReadFile(((struct serial_port_windows *) sp)->hPort, pbtRx + dwTotalBytesReceived,
|
res = ReadFile(((struct serial_port_windows *) sp)->hPort, pbtRx + dwTotalBytesReceived,
|
||||||
dwBytesToGet,
|
dwBytesToGet,
|
||||||
&dwBytesReceived, NULL);
|
&dwBytesReceived, NULL);
|
||||||
@@ -226,7 +226,7 @@ uart_send(serial_port sp, const uint8_t *pbtTx, const size_t szTx, int timeout)
|
|||||||
timeouts.WriteTotalTimeoutConstant = timeout;
|
timeouts.WriteTotalTimeoutConstant = timeout;
|
||||||
|
|
||||||
if (!SetCommTimeouts(((struct serial_port_windows *) sp)->hPort, &timeouts)) {
|
if (!SetCommTimeouts(((struct serial_port_windows *) sp)->hPort, &timeouts)) {
|
||||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_ERROR, "Unable to apply new timeout settings.");
|
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_ERROR, "%s", "Unable to apply new timeout settings.");
|
||||||
return NFC_EIO;
|
return NFC_EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,11 +198,12 @@ acr122s_send_frame(nfc_device *pnd, uint8_t *frame, int timeout)
|
|||||||
uint8_t positive_ack[4] = { STX, 0, 0, ETX };
|
uint8_t positive_ack[4] = { STX, 0, 0, ETX };
|
||||||
serial_port port = DRIVER_DATA(pnd)->port;
|
serial_port port = DRIVER_DATA(pnd)->port;
|
||||||
int ret;
|
int ret;
|
||||||
void *abort_p;
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
void *abort_p;
|
||||||
abort_p = &(DRIVER_DATA(pnd)->abort_fds[1]);
|
abort_p = &(DRIVER_DATA(pnd)->abort_fds[1]);
|
||||||
#else
|
#else
|
||||||
|
volatile void *abort_p;
|
||||||
abort_p = &(DRIVER_DATA(pnd)->abort_flag);
|
abort_p = &(DRIVER_DATA(pnd)->abort_flag);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user