Fix warnings: ignoring return value of 'pipe' & discarding const qualifier
This commit is contained in:
parent
24e1edd858
commit
72b10c5d9b
4 changed files with 16 additions and 6 deletions
|
@ -477,7 +477,9 @@ acr122s_scan(const nfc_context *context, nfc_connstring connstrings[], const siz
|
||||||
DRIVER_DATA(pnd)->seq = 0;
|
DRIVER_DATA(pnd)->seq = 0;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
pipe(DRIVER_DATA(pnd)->abort_fds);
|
if (pipe(DRIVER_DATA(pnd)->abort_fds) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
DRIVER_DATA(pnd)->abort_flag = false;
|
DRIVER_DATA(pnd)->abort_flag = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -124,7 +124,9 @@ arygon_scan(const nfc_context *context, nfc_connstring connstrings[], const size
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
pipe(DRIVER_DATA(pnd)->iAbortFds);
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
DRIVER_DATA(pnd)->abort_flag = false;
|
DRIVER_DATA(pnd)->abort_flag = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -101,7 +101,9 @@ pn532_uart_scan(const nfc_context *context, nfc_connstring connstrings[], const
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
pipe(DRIVER_DATA(pnd)->iAbortFds);
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
DRIVER_DATA(pnd)->abort_flag = false;
|
DRIVER_DATA(pnd)->abort_flag = false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -252,7 +254,9 @@ pn532_uart_open(const nfc_context *context, const nfc_connstring connstring)
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
pipe(DRIVER_DATA(pnd)->iAbortFds);
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
DRIVER_DATA(pnd)->abort_flag = false;
|
DRIVER_DATA(pnd)->abort_flag = false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -484,7 +488,9 @@ pn532_uart_abort_command(nfc_device *pnd)
|
||||||
if (pnd) {
|
if (pnd) {
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
close(DRIVER_DATA(pnd)->iAbortFds[0]);
|
close(DRIVER_DATA(pnd)->iAbortFds[0]);
|
||||||
pipe(DRIVER_DATA(pnd)->iAbortFds);
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
|
return NFC_ESOFT;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
DRIVER_DATA(pnd)->abort_flag = true;
|
DRIVER_DATA(pnd)->abort_flag = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -186,7 +186,7 @@ void
|
||||||
nfc_exit(nfc_context *context)
|
nfc_exit(nfc_context *context)
|
||||||
{
|
{
|
||||||
while (nfc_drivers) {
|
while (nfc_drivers) {
|
||||||
struct nfc_driver_list *pndl = nfc_drivers;
|
struct nfc_driver_list *pndl = (struct nfc_driver_list *) nfc_drivers;
|
||||||
nfc_drivers = pndl->next;
|
nfc_drivers = pndl->next;
|
||||||
free(pndl);
|
free(pndl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue