Commit graph

17 commits

Author SHA1 Message Date
Nathan Hjelm
7dff2d35ca examples: make dpfp_threaded work on OS X
OS X does not support unnamed semaphores so the example has been
updated to use a named semaphore instead.

Signed-off-by: Nathan Hjelm <hjelmn@me.com>
2016-07-21 22:26:19 -06:00
Chris Dickens
a1c9895543 examples: Address issues reported by Markus Elfring
* Use sig_atomic_t as data type for variable do_exit
  * Use async-safe function within signal handler

Closes #34

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
2015-04-28 14:56:00 -07:00
hjelmn@cs.unm.edu
1eff220474 Misc: Revert all references to libusb/libusb.info 2014-01-08 23:51:01 +00:00
Ludovic Rousseau
38e6eb86b2 All: Use "" instead of <> for local includes
System header files are used with #include <foo.h>
Xcode can't find local headers using this syntax.
2012-10-13 18:34:45 +01:00
Pete Batard
63f569be66 Misc: Fix more Clang warnings in core and darwin
* http://sourceforge.net/mailarchive/message.php?msg_id=29418038
* core.c:700:4: warning: Function call argument is an uninitialized value
* darwin_usb.c:1713:11: warning: Access to field 'cfSource' results in a
  dereference of a null pointer (loaded from variable 'hpriv')
* sync.c/dpfp.c/dpfp_threaded.c: warning: Result of 'malloc' is converted
  to a pointer of type 'unsigned char', which is incompatible with sizeof
  operand type
2012-07-02 18:29:27 +01:00
Pete Batard
a544e5972b Misc: Ensure all sources are UTF-8
* Also remove extra lines at the end of samples
2012-05-23 18:25:01 +01:00
Peter Stuge
d346cd9060 examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded
The OpenBSD C compiler generates a warning for every use of sprintf()
and for a good reason. Reported in http://marc.info/?m=133376187514495

Reported-by: Xiaofan Chen <xiaofanc@gmail.com>
2012-04-09 22:30:25 +01:00
Pete Batard
791b7473ec Misc: Rebrand to libusbx
* Mentions of 'libusb' in doxygen are changed to 'libusbx'
* Also update copyright notices and remove unneeded EOF LFs
2012-04-03 15:42:10 +01:00
Hans de Goede
a68f956dd4 Linux: Fix warnings seen when compiling with gcc-4.6
Compiling with gcc-4.6 results in the following warnings:
os/linux_usbfs.c: In function 'op_get_configuration':
os/linux_usbfs.c:1144:6: warning: variable 'r' set but not used ...
os/linux_usbfs.c: In function 'op_handle_events':
os/linux_usbfs.c:2091:40: warning: 'status' may be used uninitialized ...
os/linux_usbfs.c:2044:6: note: 'status' was declared here
dpfp.c: In function 'save_to_file':
dpfp.c:228:9: warning: variable 'ignore' set but not used ...
dpfp_threaded.c: In function 'save_to_file':
dpfp_threaded.c:257:9: warning: variable 'ignore' set but not used ...

This patch fixes these. (The second comes from handle_control_completion()
which gcc seems to inline into op_handle_events().)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[stuge: Add fixes for dpfp examples and update source references]
2011-07-24 23:33:59 +02:00
Pete Batard
0e177f22fc dpfp_threaded: return instead of pthread_exit() to avoid Cygwin warning 2011-06-13 22:05:34 +02:00
Ludovic Rousseau
2aa8984e59 examples: #include <libusb.h> without directory name
The libusb-1.0 directory name belongs in the compile command, e.g.
via pkg-config --cflags. Fixes #58.
2010-11-22 05:25:53 +01:00
Peter Stuge
678c242705 examples: Silence warnings about return value of fwrite() 2010-10-16 14:22:30 +02:00
Pete Batard
29f9f9e3af Introduced calling convention (for Windows)
Under Windows, a variety of compilers and configurations are available,
meaning that the manner of parameter passing (e.g. registers vs stack)
can vary.

Match the Windows API calling convention and document this appropriately.
This calling convention will be used regardless of the configuration of
the user's development platform.

The only user-level complication is that all functions used as libusb
callbacks must use the same calling convention as libusb. The
LIBUSB_CALL macro is provided to make this easy.

Signed-off-by: Michael Plante <michael.plante@gmail.com>
Signed-off-by: Pete Batard <pbatard@gmail.com>
[dsd: slight change of strategy, add documentation]
2010-08-23 18:48:55 -06:00
Pete Batard
33cd2f68b4 removed trailing whitespaces 2010-08-06 21:44:10 -06:00
Daniel Drake
1df713d622 Introduce contexts to the API
Suggested by David Zeuthen. This allows multiple libraries in the same
process to independently use libusb without interfering.
2008-06-26 22:42:59 -05:00
Daniel Drake
7ac0a405b4 Remove libusb_cancel_transfer_sync
This wasn't a particularly nice API. Cancellation should be handled by
the completion handler.
2008-04-29 12:08:35 +01:00
Daniel Drake
e12618c79d add threaded example program 2008-04-19 16:24:21 +01:00