* master: (43 commits)
Windows: workaround as libusb is not automatically detected by CMake
Add usbbus to Makefile.am EXTRA_DIST
make style
Add log_posix to Makefile.am
Split logging internals so that platforms may choose additional or alternate spew mechanisms
More explicitely ignoring return value as suggested by Ludovic
Windows: Clean up all compiler warnings and link warnings
API change
make style
pn53x-sam: fix print_nfc_target
Convert by value passing of nfc_target to pointer for str_nfc_target and nfc_initiator_target_is_present
Windows: Fix bug when compiling without libusb: skip usbbus.c
Windows: Fix compilation due to new usbbus file
Fix bug when compiling without libusb: skip usbbus.c
Fix scan-build warning: cast increases required alignment from 1 to 4
Fix cppcheck warning "Obsolete function 'usleep' called"
Avoid warning about ignoring return value of 'read'
Fix cppcheck warning "Non reentrant function 'readdir' called"
conf.h: make it more standard
uart_posix.c: remove redundant include
...
In the case of windows, allow for the OutputDebugString call in addition to logging to stderr.
Useful for the dll scenario and debugging in Visual Studio.
- Fixed the suppression of the auto-fixup for linking against MS built libs
- Fixed all the formatting warnings by shifting to inttypes.h specifiers
- shifted to %lu for DWORD printf
This becomes more consistent with all other pass by pointer of most structures.
Additionally, this should lessen stack memory usage, as building strings with str_nfc_target would push the target (283 bytes) plus then a copy of the info objects (up to 275) onto the stack as it dives into the sprintf functions.
Lastly, this makes my attempt at a .NET wrapper easier, as I can make passing by pointer work, but passing by value seems to bomb on the interop right now.
Still a few todo according to cppcheck:
[examples/pn53x-tamashell.c:165]:
(style) Found obsolete function 'usleep'. It is recommended that new applications use the 'nanosleep' or 'setitimer' function
[libnfc/buses/uart_posix.c:343]:
(portability) Found non reentrant function 'readdir'. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'
[libnfc/drivers/acr122_pcsc.c:206]:
[libnfc/drivers/acr122_pcsc.c:219]:
[libnfc/drivers/acr122s.c:412]:
[libnfc/drivers/acr122s.c:425]:
[libnfc/drivers/acr122s.c:434]:
[libnfc/drivers/arygon.c:181]:
[libnfc/drivers/arygon.c:194]:
[libnfc/drivers/arygon.c:203]:
[libnfc/drivers/pn532_uart.c:158]:
[libnfc/drivers/pn532_uart.c:171]:
[libnfc/drivers/pn532_uart.c:180]:
(portability) Found non reentrant function 'strtok'. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'
Fix following warnings:
[examples/pn53x-tamashell.c:162]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/acr122_pcsc.c:261]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/acr122s.c:441]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/arygon.c:210]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/arygon.c:522]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/pn532_uart.c:187]: (warning) scanf without field width limits can crash with huge input data
[utils/nfc-relay-picc.c:176]: (warning) scanf without field width limits can crash with huge input data
Fix the following cppcheck warnings:
[libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced
[libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced
[utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced