Fix warnings: ignoring return value of 'pipe' & discarding const qualifier

This commit is contained in:
Philippe Teuwen 2013-02-21 23:08:19 +01:00
parent 24e1edd858
commit 72b10c5d9b
4 changed files with 16 additions and 6 deletions

View file

@ -477,7 +477,9 @@ acr122s_scan(const nfc_context *context, nfc_connstring connstrings[], const siz
DRIVER_DATA(pnd)->seq = 0;
#ifndef WIN32
pipe(DRIVER_DATA(pnd)->abort_fds);
if (pipe(DRIVER_DATA(pnd)->abort_fds) < 0) {
return 0;
}
#else
DRIVER_DATA(pnd)->abort_flag = false;
#endif

View file

@ -124,7 +124,9 @@ arygon_scan(const nfc_context *context, nfc_connstring connstrings[], const size
#ifndef WIN32
// pipe-based abort mecanism
pipe(DRIVER_DATA(pnd)->iAbortFds);
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
return 0;
}
#else
DRIVER_DATA(pnd)->abort_flag = false;
#endif

View file

@ -101,7 +101,9 @@ pn532_uart_scan(const nfc_context *context, nfc_connstring connstrings[], const
#ifndef WIN32
// pipe-based abort mecanism
pipe(DRIVER_DATA(pnd)->iAbortFds);
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
return 0;
}
#else
DRIVER_DATA(pnd)->abort_flag = false;
#endif
@ -252,7 +254,9 @@ pn532_uart_open(const nfc_context *context, const nfc_connstring connstring)
#ifndef WIN32
// pipe-based abort mecanism
pipe(DRIVER_DATA(pnd)->iAbortFds);
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
return NULL;
}
#else
DRIVER_DATA(pnd)->abort_flag = false;
#endif
@ -484,7 +488,9 @@ pn532_uart_abort_command(nfc_device *pnd)
if (pnd) {
#ifndef WIN32
close(DRIVER_DATA(pnd)->iAbortFds[0]);
pipe(DRIVER_DATA(pnd)->iAbortFds);
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
return NFC_ESOFT;
}
#else
DRIVER_DATA(pnd)->abort_flag = true;
#endif

View file

@ -186,7 +186,7 @@ void
nfc_exit(nfc_context *context)
{
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;
free(pndl);
}