From b8630c42306f5261ac02bc946797fa2e386c6eef Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Fri, 9 Apr 2010 22:03:52 +0000 Subject: [PATCH] Fix various warnings: - format '%d' expects type 'int', but argument 2 has type 'long unsigned int'; - format '%d' expects type 'int', but argument 2 has type 'size_t'; - unused variable 'nti'; - unused parameter 'argc'. --- examples/nfc-poll.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/nfc-poll.c b/examples/nfc-poll.c index 75a270a..29542b4 100644 --- a/examples/nfc-poll.c +++ b/examples/nfc-poll.c @@ -26,6 +26,7 @@ #include "config.h" #endif // HAVE_CONFIG_H +#include #include #include #include @@ -45,11 +46,15 @@ int main(int argc, const char* argv[]) { size_t szFound; size_t i; - nfc_target_info_t nti; nfc_device_desc_t *pnddDevices; // Display libnfc version const char* acLibnfcVersion = nfc_version(); + + if (argc > 1) { + errx (1, "usage: %s", argv[0]); + } + printf("%s use libnfc %s\n", argv[0], acLibnfcVersion); if (!(pnddDevices = malloc (MAX_DEVICE_COUNT * sizeof (*pnddDevices)))) @@ -106,10 +111,10 @@ int main(int argc, const char* argv[]) nfc_target_t antTargets[2]; size_t szTargetFound; - printf("PN53x will poll during %d ms\n", btPollNr * szTargetTypes * btPeriod * 150); + printf("PN53x will poll during %ld ms\n", btPollNr * szTargetTypes * btPeriod * 150); bool res = nfc_initiator_poll_targets(pnd, &nttMifare, 1, btPollNr, btPeriod, antTargets, &szTargetFound); if( res ) { - printf("%d target(s) have been found.\n", szTargetFound); + printf("%ld target(s) have been found.\n", szTargetFound); for(uint8_t n=0; n