diff --git a/examples/nfc-list.c b/examples/nfc-list.c index 2a75b3f..79469e9 100644 --- a/examples/nfc-list.c +++ b/examples/nfc-list.c @@ -33,6 +33,7 @@ #endif #endif +#include #include #include #include @@ -54,6 +55,10 @@ int main(int argc, const char* argv[]) nfc_target_info_t nti; nfc_device_desc_t *pnddDevices; + if (argc > 1) { + errx (1, "usage: %s", argv[0]); + } + // Display libnfc version const char* acLibnfcVersion = nfc_version(); printf("%s use libnfc %s\n", argv[0], acLibnfcVersion); diff --git a/examples/nfc-mfclassic.c b/examples/nfc-mfclassic.c index c164c6e..68285c8 100644 --- a/examples/nfc-mfclassic.c +++ b/examples/nfc-mfclassic.c @@ -47,7 +47,7 @@ static mifare_tag mtKeys; static mifare_tag mtDump; static bool bUseKeyA; static bool bUseKeyFile; -static uint32_t uiBlocks; +static uint8_t uiBlocks; static byte_t keys[] = { 0xff,0xff,0xff,0xff,0xff,0xff, 0xd3,0xf7,0xd3,0xf7,0xd3,0xf7, diff --git a/examples/nfcip-initiator.c b/examples/nfcip-initiator.c index 0df1bc4..5c931de 100644 --- a/examples/nfcip-initiator.c +++ b/examples/nfcip-initiator.c @@ -26,6 +26,7 @@ #include "config.h" #endif // HAVE_CONFIG_H +#include #include #include #include @@ -40,6 +41,10 @@ int main(int argc, const char *argv[]) size_t szRecvBits; byte_t send[] = "Hello World!"; + if (argc > 1) { + errx (1, "usage: %s", argv[0]); + } + pnd = nfc_connect(NULL); if (!pnd || !nfc_initiator_init(pnd) || !nfc_initiator_select_dep_target(pnd, NM_PASSIVE_DEP, NULL, 0, diff --git a/examples/nfcip-target.c b/examples/nfcip-target.c index b245e88..a235972 100644 --- a/examples/nfcip-target.c +++ b/examples/nfcip-target.c @@ -27,6 +27,7 @@ #include "config.h" #endif // HAVE_CONFIG_H +#include #include #include @@ -39,6 +40,10 @@ int main(int argc, const char *argv[]) byte_t send[] = "Hello Mars!"; nfc_device_t *pnd = nfc_connect(NULL); + if (argc > 1) { + errx (1, "usage: %s", argv[0]); + } + if (!pnd || !nfc_target_init(pnd, abtRecv, &szRecvBits)) { printf("unable to connect or initialize\n"); return 1; diff --git a/libnfc/bitutils.c b/libnfc/bitutils.c index 0da202f..f841251 100644 --- a/libnfc/bitutils.c +++ b/libnfc/bitutils.c @@ -30,7 +30,7 @@ #include "bitutils.h" -const static byte_t OddParity[256] = { +static const byte_t OddParity[256] = { 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, @@ -49,7 +49,7 @@ const static byte_t OddParity[256] = { 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1 }; -const static byte_t ByteMirror[256] = { +static const byte_t ByteMirror[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, diff --git a/libnfc/drivers.h b/libnfc/drivers.h index f3ae3e3..22653c4 100644 --- a/libnfc/drivers.h +++ b/libnfc/drivers.h @@ -43,7 +43,7 @@ #define DRIVERS_MAX_DEVICES 16 #define MAX_FRAME_LEN 264 -const static struct driver_callbacks drivers_callbacks_list[] = { +static const struct driver_callbacks drivers_callbacks_list[] = { // Driver Name Pick Device List Devices Connect Transceive Disconnect #ifdef HAVE_PCSC_LITE { ACR122_DRIVER_NAME, acr122_pick_device, acr122_list_devices, acr122_connect, acr122_transceive, acr122_disconnect }, diff --git a/libnfc/drivers/acr122.c b/libnfc/drivers/acr122.c index 9b16b5f..e9a7f70 100644 --- a/libnfc/drivers/acr122.c +++ b/libnfc/drivers/acr122.c @@ -348,6 +348,7 @@ char* acr122_firmware(const nfc_device_spec_t nds) bool acr122_led_red(const nfc_device_spec_t nds, bool bOn) { + (void)bOn; byte_t abtLed[9] = { 0xFF,0x00,0x40,0x05,0x04,0x00,0x00,0x00,0x00 }; acr122_spec_t* pas = (acr122_spec_t*)nds; byte_t abtBuf[2]; diff --git a/libnfc/drivers/pn532_uart.c b/libnfc/drivers/pn532_uart.c index 4e1ccaa..c45cd4d 100644 --- a/libnfc/drivers/pn532_uart.c +++ b/libnfc/drivers/pn532_uart.c @@ -91,6 +91,8 @@ pn532_uart_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_ * sending some PN53x commands. But using this way to probe devices, we can * have serious problem with other device on this bus */ #ifndef SERIAL_AUTOPROBE_ENABLED + (void)pnddDevices; + (void)szDevices; *pszDeviceFound = 0; DBG("%s", "Serial auto-probing have been disabled at compile time. Skipping autoprobe."); return false;