- 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.
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
Fixes:
pn53x.c:523:11: warning: Value stored to 'pbtRawData' is never read
pbtRawData += szRawData - 8;
^ ~~~~~~~~~~~~~
pn53x.c:544:7: warning: Value stored to 'pbtRawData' is never read
pbtRawData += 2;
^ ~
pn53x.c:532:7: warning: Value stored to 'pbtRawData' is never read
pbtRawData += 8;
^ ~
pn53x.c:3085:3: warning: Value stored to 'buflen' is never read
buflen -= res;
^ ~~~
pn53x.c:3080:3: warning: Value stored to 'buf' is never read
buf += res;
^ ~~~
target-subr.c:466:7: warning: Value stored to 'dst' is never read
dst += sprintf(dst, "* Unknown card, sorry\n");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:480:3: warning: Value stored to 'dst' is never read
dst += sprint_hex(dst, nfi.abtSysCode, 2);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:490:3: warning: Value stored to 'dst' is never read
dst += sprint_hex(dst, nji.btId, 4);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:546:7: warning: Value stored to 'dst' is never read
dst += sprintf(dst, "\n");
^ ~~~~~~~~~~~~~~~~~~
target-subr.c:571:5: warning: Value stored to 'dst' is never read
dst += sprint_hex(dst, nii.abtAtr, nii.szAtrLen);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:580:3: warning: Value stored to 'dst' is never read
dst += sprint_hex(dst, nsi.abtUID, 8);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:593:3: warning: Value stored to 'dst' is never read
dst += sprintf(dst, " Fab Code: %02X\n", nci.btFabCode);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:608:5: warning: Value stored to 'dst' is never read
dst += sprint_hex(dst, ndi.abtGB, ndi.szGB);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix compiler warnings and potential bug
pn53x.c:1526:19: warning: The right operand of '<' is a garbage value
for (i = 0; i < sz; i++) {
^ ~~
pn53x.c:1621:19: warning: The right operand of '<' is a garbage value
for (i = 0; i < sz; i++) {
^ ~~
These settings are quite specifics and should be reset in other functions that call pn53x_reset_settings() too: i.e. nfc_initiator_init_secure_element()
- New nfc_device_get_information_about()
- Moved nfc-utils function str_nfc_baud_rate()
- New str_nfc_modulation_type()
- Add new device_get_information_about callback to nfc_driver struct
- Export new symbols
- Changed internal pn53x firmware text handling: we now store firmware text for further operations
- print_nfc_target() now uses str_nfc_* functions
- nfc-probe util now have a verbose which display information on detected devices (Fix verbose set but not used warning ;-) )