| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor libusbi.h to include the set of common header files needed by
every main source file in the library and change these source files to
include libusbi.h first, followed by any non-common headers. Including
libusbi.h first ensures that the config definitions are pulled in and
will eliminate redundant includes in the individual sources files.
Also clean up some whitespace errors and remove unnecessary definitions
in the manually generated config.h files.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found this because clang was warning that the return value was being
converted from unsigned to signed.
The need for a mach API surprised me, and I found this alternative
formulation in a Chromium bug:
https://groups.google.com/forum/#!topic/native-client-reviews/z---hlHbQNc
which describes: "mach_thread_self() needs to be balanced by mach_port_deallocate(),
which is two system calls. pthread_mach_thread_np(pthread_self()) is two libc
function calls and no system calls, because pthread caches the Mach port."
Fixed the conversion warning too, with a cast.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically:
redundantAssignment,examples/dpfp.c:422,style,Variable 'r' is reassigned a value before the old one has been used.
redundantAssignment,libusb/os/threads_posix.c:64,style,Variable 'ret' is reassigned a value before the old one has been used.
unreadVariable,libusb/os/netbsd_usb.c:217,style,Variable 'hpriv' is assigned a value that is never used.
unreadVariable,libusb/os/netbsd_usb.c:235,style,Variable 'hpriv' is assigned a value that is never used.
unreadVariable,libusb/os/openbsd_usb.c:251,style,Variable 'hpriv' is assigned a value that is never used.
unreadVariable,libusb/os/openbsd_usb.c:275,style,Variable 'hpriv' is assigned a value that is never used.
unsignedLessThanZero,libusb/os/windows_winusb.c:259,style,Checking if unsigned variable '_index' is less than zero.
unsignedLessThanZero,libusb/os/windows_winusb.c:298,style,Checking if unsigned variable '_index' is less than zero.
unsignedLessThanZero,libusb/os/windows_winusb.c:367,style,Checking if unsigned variable '_index' is less than zero.
invalidPrintfArgType_sint,examples/xusb.c:534,warning,%d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this commit, each backend provided its own uniquely named
usbi_os_backend structure and a massive pile of #ifdefs assigned the
global usbi_backend pointer to the correct one. This commit kills off
all this code and instead has each backend provide the usbi_backend
symbol directly. The linker can inform of any issues that might arise
with symbols.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The event handling lock was previously required to be of the recursive
type because the libusb_close() path requires the lock and may be
called by a thread that is handling events (e.g. from within a
transfer or hotplug callback). With commit 960a6e75, it is possible to
determine whether the current function is being called from an event
handling context, thus the recursive lock type is no longer necessary.
References:
* http://libusb.org/ticket/82
* 74282582cc879f091ad1d847411337bc3fa78a2b
* c775c2f43037cd235b65410583179195e25f9c4a
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
[hdegoede@redhat.com: rebase on top of current master]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
| |
Some platforms do not implement the optional clock_gettime(). Need
to use the backend implementation instead.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the signatures of the synchronization functions
to reflect the needs of the library rather than the signature of the
pthreads API. The mutex and condition variable attributes parameters
have been removed as no part of the core library makes use of them.
In addition, the condition variable timed-wait function has been modified
to accept the relative time passed in via libusb_wait_for_event(). This
allows the implementation-specific code to handle conversion to absolute
time as necessary, rather than forcing this to occur.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
| |
* Include config.h before anything else in all files
* Remove unnecessary inclusion of libusb.h
* Use angle brackets for system headers and quotes for local headers
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
| |
|
|
|
|
| |
* Also fix an issue with LIBUSB_LOG_LEVEL_NONE
|
|
|
|
|
|
|
|
|
|
|
| |
* On some Linux platforms, libusbx compilation breaks with:
error: implicit declaration of function ‘pthread_mutexattr_settype’
* This regression, introduced in 463dda06db5da5de0eab32820c7af60605625afe,
is due to pthread.h needing __USE_UNIX98, which is tied to _XOPEN_SOURCE
or _GNU_SOURCE being correctly defined, and which the inclusion of
<unistd.h> before the _XOPEN_SOURCE override modified
* As _GNU_LINUX ensures the definition of __USE_UNIX98 and we require it
for syscalls, we now only define _GNU_SOURCE for Linux.
|
|
|
|
| |
* Also remove extra lines at the end of samples
|
|
|
|
| |
* Cygwin uses POSIX threads, not Windows threads
|
|
|
|
|
|
| |
* Uses syscall(SYS_getthrid) which requires real thread support,
currently only available in 5.1-current (but not 5.1-release).
For OpenBSD <= 5.1, -1 will be returned for the thread ID.
|
| |
|
|
|
|
|
| |
* Mentions of 'libusb' in doxygen are changed to 'libusbx'
* Also update copyright notices and remove unneeded EOF LFs
|
| |
|
|
This is necessary for the device close path which needs to attain the
events lock, but which might itself be called while handling an event.
The events lock is necessary to properly clean up transfers which might
still be pointing to the device. References #82.
[stuge: Move usbi_mutex_init_recursive() into threads_posix.c]
[stuge: Must also #define _XOPEN_SOURCE 500 to be able to build]
[pbatard: Un-inline usbi_mutex_init_recursive() to make Cygwin happy]
|