Romuald Conty
2be00e7615
Move log implementation for Windows in dedicated directory
2013-03-18 23:53:01 +01:00
Romuald Conty
cb3452db7b
Move UART implementation for Windows in dedicated directory
2013-03-18 23:46:14 +01:00
Romuald Conty
a422ae2211
CMake: only compile usbbus.c when (at least) one USB driver is enabled
2013-03-18 23:32:07 +01:00
Romuald Conty
b6b356b948
CMake: only include UART related files when (at least) one UART driver is enabled
2013-03-18 23:27:23 +01:00
Romuald Conty
699e9123ea
Only include UART related files when (at least) one UART driver is enabled
2013-03-18 23:07:19 +01:00
Romuald Conty
e898e5f73b
Remove unsed code section in log.c (was commented)
2013-03-18 15:25:07 +01:00
Philippe Teuwen
890f028b0c
pn53x_current_target_new() now returns null ptr upon malloc() error
2013-03-18 01:00:41 +01:00
Philippe Teuwen
69c435f348
fix missing tests on malloc() return
2013-03-18 00:46:31 +01:00
Philippe Teuwen
06d5b54308
pn53x_data_new() now returns null ptr upon malloc() error
2013-03-18 00:21:08 +01:00
Philippe Teuwen
af57df532b
uart drivers: missing pn53x_data_free() on some error handling branches
2013-03-18 00:21:03 +01:00
Philippe Teuwen
5f70bdc699
uart drivers: missing nfc_device_free() on some error handling branches
2013-03-17 23:52:54 +01:00
Philippe Teuwen
2e801a62d5
uart drivers: missing uart_close() on some error handling branches
2013-03-17 23:52:43 +01:00
Philippe Teuwen
c1372a009f
uart drivers: fix missing free(ndd.port)
2013-03-17 22:54:15 +01:00
Philippe Teuwen
77838b894c
config parser: missing fclose()
2013-03-17 22:19:49 +01:00
Philippe Teuwen
ca7477e935
UART drivers: fix double free() of serial port info
...
Fixes issue 242
2013-03-16 12:25:28 +01:00
Julien Schueller
8485996f13
Fix cmake build failure under linux
...
The LIBUSB_FOUND variable was used before the libusb detection was performed.
Fixes issue 240.
2013-03-12 20:54:50 +01:00
Philippe Teuwen
bf164220ee
Unify copyright notices & update authors lists
2013-03-10 16:15:23 +01:00
Philippe Teuwen
cc03f84636
New connstring_decode() fix cppcheck warning "Non reentrant function 'strtok' called"
2013-03-10 00:20:52 +01:00
Philippe Teuwen
38966cb2fb
Forgot to commit new log internal header file
2013-03-09 10:56:51 +01:00
Philippe Teuwen
ad8b338a7b
Remove log-printf from CMakefile
2013-03-09 10:41:25 +01:00
Philippe Teuwen
a9e3365d98
Add log_internal.h to Makefile
2013-03-09 10:41:07 +01:00
Philippe Teuwen
6a110b3849
Creating log_internal.h for log_*put_internal() prototypes
...
Fixed warning "no previous prototype for function" in log_posix.c
2013-03-09 01:00:21 +01:00
Philippe Teuwen
7e26aa368d
log_win32: declare log_output_debug() static
2013-03-09 00:47:21 +01:00
Philippe Teuwen
f19d233fad
Merge log-printf.c into log.c, inline with prototypes in log.h & platform files log_*.c
2013-03-09 00:46:45 +01:00
Philippe Teuwen
5704b668b7
Add usbbus to Makefile.am EXTRA_DIST
2013-03-08 00:35:36 +01:00
Philippe Teuwen
fef6517e27
make style
2013-03-08 00:35:04 +01:00
Philippe Teuwen
37cf7554d9
Add log_posix to Makefile.am
2013-03-08 00:34:14 +01:00
Alex Lian
b3c6ea86ad
Split logging internals so that platforms may choose additional or alternate spew mechanisms
...
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.
2013-03-07 10:36:33 +01:00
Philippe Teuwen
563054d2a2
More explicitely ignoring return value as suggested by Ludovic
2013-03-07 10:34:17 +01:00
Alex Lian
7b917f9a8b
Windows: Clean up all compiler warnings and link warnings
...
- 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
2013-03-07 09:37:36 +01:00
Alex Lian
c72846e3c6
Convert by value passing of nfc_target to pointer for str_nfc_target and nfc_initiator_target_is_present
...
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.
2013-03-07 09:16:33 +01:00
Philippe Teuwen
a262be5633
Windows: Fix bug when compiling without libusb: skip usbbus.c
2013-03-07 08:09:32 +01:00
Alex Lian
f8d8052866
Windows: Fix compilation due to new usbbus file
2013-03-07 08:05:31 +01:00
Philippe Teuwen
008158090c
Fix bug when compiling without libusb: skip usbbus.c
2013-03-07 00:43:35 +01:00
Philippe Teuwen
1c67c3f92a
Fix scan-build warning: cast increases required alignment from 1 to 4
...
acr122_usb.c:562:20: warning: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
uint32_t *pu32 = (uint32_t *)u8;
^~~~~~~~~~~~~~
2013-03-06 23:22:02 +01:00
Philippe Teuwen
fdd5bd3523
Avoid warning about ignoring return value of 'read'
2013-03-06 21:13:39 +01:00
Philippe Teuwen
7fb538737d
Fix cppcheck warning "Non reentrant function 'readdir' called"
...
For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'.
2013-03-06 20:59:41 +01:00
Philippe Teuwen
90622f52b7
conf.h: make it more standard
2013-03-06 19:36:32 +01:00
Philippe Teuwen
b81519c6a9
uart_posix.c: remove redundant include
2013-03-06 19:34:57 +01:00
Philippe Teuwen
a0b859b2a1
Fix cppcheck warning "Non reentrant function 'readdir' called"
...
For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'.
2013-03-06 15:20:15 +01:00
Philippe Teuwen
4dafd70b64
Fix cppcheck warning "Statements following return will never be executed"
2013-03-06 12:42:39 +01:00
Philippe Teuwen
1d5f9956fb
Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"
2013-03-06 12:38:59 +01:00
Philippe Teuwen
a3facbdc7d
sprint_nfc_target() => snprint_nfc_target()
...
And all sub-functions in target_subr.c
2013-03-06 12:17:33 +01:00
Philippe Teuwen
658ec4585a
Fix cppcheck warning "scanf without field width limits can crash with huge input data"
2013-03-06 11:42:35 +01:00
Philippe Teuwen
f0d5896140
Fix cppcheck style: "The scope of the variable can be reduced"
2013-03-06 11:02:47 +01:00
Philippe Teuwen
0aa1ff309e
Fix cppcheck warning "Variable is assigned a value that is never used"
2013-03-06 10:56:12 +01:00
Philippe Teuwen
c37d1742c3
Fix cppcheck style: scope of variable can be reduced
...
Fix the following cppcheck warnings:
[libnfc/chips/pn53x.c:617]: (style) The scope of the variable 'res' can be reduced
2013-03-06 00:54:49 +01:00
Philippe Teuwen
d577fda412
Fix cppcheck warning "scanf without field width limits can crash with huge input data"
...
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
2013-03-06 00:52:08 +01:00
Philippe Teuwen
4769392157
Fix cppcheck style: scope of variable can be reduced
...
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
2013-03-06 00:35:36 +01:00
Philippe Teuwen
03bc30f116
Fix "Possible null pointer dereference" error
2013-03-05 23:56:38 +01:00