Re-ident examples/nfc-poll.c using "indent -br -ce --line-length120 -nut -i2 -ppi 2 " command line.

This commit is contained in:
Romuald Conty 2010-06-07 09:51:31 +00:00
parent 3c1a61349f
commit d171562002

View file

@ -41,7 +41,8 @@
static nfc_device_t *pnd; static nfc_device_t *pnd;
int main(int argc, const char* argv[]) int
main (int argc, const char *argv[])
{ {
size_t szFound; size_t szFound;
size_t i; size_t i;
@ -56,26 +57,22 @@ int main(int argc, const char* argv[])
printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion);
if (!(pnddDevices = malloc (MAX_DEVICE_COUNT * sizeof (*pnddDevices)))) if (!(pnddDevices = malloc (MAX_DEVICE_COUNT * sizeof (*pnddDevices)))) {
{
fprintf (stderr, "malloc() failed\n"); fprintf (stderr, "malloc() failed\n");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
nfc_list_devices (pnddDevices, MAX_DEVICE_COUNT, &szFound); nfc_list_devices (pnddDevices, MAX_DEVICE_COUNT, &szFound);
if (szFound == 0) if (szFound == 0) {
{
INFO ("%s", "No device found."); INFO ("%s", "No device found.");
} }
for (i = 0; i < szFound; i++) for (i = 0; i < szFound; i++) {
{
pnd = nfc_connect (&(pnddDevices[i])); pnd = nfc_connect (&(pnddDevices[i]));
if (pnd == NULL) if (pnd == NULL) {
{
ERR ("%s", "Unable to connect to NFC device."); ERR ("%s", "Unable to connect to NFC device.");
return 1; return 1;
} }
@ -121,7 +118,8 @@ int main(int argc, const char* argv[])
printf ("%ld target(s) have been found.\n", (unsigned long) szTargetFound); printf ("%ld target(s) have been found.\n", (unsigned long) szTargetFound);
for (uint8_t n = 0; n < szTargetFound; n++) { for (uint8_t n = 0; n < szTargetFound; n++) {
printf ("T%d: targetType=%02x, ", n + 1, antTargets[n].ntt); printf ("T%d: targetType=%02x, ", n + 1, antTargets[n].ntt);
printf("targetData:\n"); print_nfc_iso14443a_info(antTargets[n].nti.nai); printf ("targetData:\n");
print_nfc_iso14443a_info (antTargets[n].nti.nai);
} }
} else { } else {
ERR ("%s", "Polling failed."); ERR ("%s", "Polling failed.");
@ -133,4 +131,3 @@ int main(int argc, const char* argv[])
free (pnddDevices); free (pnddDevices);
return 0; return 0;
} }