summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GIT URL HAS CHANGED: git://github.com/libusbx/libusbx.gitHEADGIT_URL_HAS_CHANGEDmasterPete Batard2012-07-132-26/+6
| | | | | | * Please update your URL in .git/config or issue a new clone from: git://github.com/libusbx/libusbx.git * The libusbx team apologizes for any inconvenience caused
* Core: Prefix LOG_LEVEL_ with LIBUSB_ to avoid conflictsbaserock/morphPete Batard2012-07-035-37/+37
| | | | | | | | | * The LOG_LEVEL_ enums, that were moved to the public API in 933a319469bcccc962031c989e39d9d1f44f2885 may conflict with applications/headers that also define their own LOG_LEVEL_ values internally. * As a matter of fact, as per Trac #31, this produces a conflict with libusb-compat, as it defines its own levels.
* Misc: Fix more Clang warnings in core and darwinPete Batard2012-07-026-5/+7
| | | | | | | | | | * 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
* Windows: Address MSVC Level 4 & WDK's OACR/Prefast warningsPete Batard2012-07-0210-41/+58
| | | | | | | | | | | | | * The library is now compiled with warning level 4 for VS2010 * Move silencing of 4200, 28125 and 28719 to msvc/config.h * Add fixes in core to silence unused variables warnings * Ensure that spinlock is always set interlocked in poll_windows * Add missing check for calloc return value * Fix data assignation in conditionals warnings * Fix an OACR/Prefast error related to the use of strncpy in xusb.c * Also fixes whitespace inconsistencies in core * Issues reported by Orin Eman and Xiaofan Chen. See: https://sourceforge.net/mailarchive/message.php?msg_id=29412656
* Windows: Some versions of dlltool require a library nameXiaofan Chen2012-06-252-2/+2
| | | | | | | * Even though the library name is optional as specified by Microsoft, some recent versions of libtool require one in libusb-1.0.def. * Reference thread in MinGW-w64 mailing list. http://comments.gmane.org/gmane.comp.gnu.mingw.w64.general/5141
* Windows: Fix warnings reported by the Intel CompilerPete Batard2012-06-253-12/+9
| | | | | | | | | * windows_usb.c(161): warning #181: argument is incompatible with corresponding format string conversion * windows_usb.c(2124): warning #111: statement is unreachable usbi_dbg("ERROR: broken timer thread"); * multiple: warning #188: enumerated type mixed with another * Issues reported by Orin Eman
* libusbx-1.0.12v1.0.12Pete Batard2012-06-153-6/+6
|
* Samples: Remove USB version for speed designations in xusbXiaofan Chen2012-06-142-3/+3
|
* Windows: Fix erroneous pointer array allocation reported by ClangPete Batard2012-06-132-2/+2
| | | | | | | * Result of 'calloc' is converted to a pointer of type 'unsigned char *', which is incompatible with sizeof operand type 'PUSB_CONFIGURATION_DESCRIPTOR' * priv->config_descriptor is indeed an array of pointers, with each descriptor allocated, rather than a sequential list of fixed descriptor.
* Core: Fix Clang warningsPete Batard2012-06-134-6/+10
| | | | | | | | | | | | | | | core.c: * Result of 'malloc' is converted to a pointer of type 'struct libusb_device *', which is incompatible with sizeof operand type 'void *' * Memory is never released; potential leak of memory pointed to by 'devs' * Assigned value is garbage or undefined (due to potentially empty and uninitialized device list) descriptor.c: * Function call argument is an uninitialized value io.c: * Call to 'malloc' has an allocation size of 0 bytes * Branch condition evaluates to a garbage value (due to get_next_timeout returning a negative error code instead of zero on error)
* libusbx 1.0.12-rc1v1.0.12-rc1Pete Batard2012-06-114-3/+17
|
* Autotools: add libusb-1.0.def and libusb_nano.h as dependenciesPete Batard2012-06-113-4/+4
| | | | | * Also add version_nano.h to EXTRA_DIST as it is not added to the dist archive by default
* Windows: Enable MinGW and MSVC DLL interchangeabilityPete Batard2012-06-083-1/+12
| | | | | | | | | | * Because we use the WINAPI calling convention, the def file MUST have the @n aliases. There is no way around this as MinGW's .o use decoration always for __stdcall, which can't be turned off. * dlltool must therefore be invoked to create a proper import lib from the .def, using the --kill-at option. * To do that, a CREATE_IMPORT_LIB autotools variable is introduced. * Note: the .def file is currently maintained manually.
* All: Prevent memory leaks on realloc failuresPete Batard2012-06-085-4/+12
| | | | | | | | * p = realloc(p, new_size) does not free the original buffer in case of a realloc failure. * reallocf() can be used to do so, but is not available on all platforms. * This patch introduces usbi_reallocf() in libusbi.h and use that instead of realloc * Issue and original patch submitted by Moritz Lipp (trac #27)
* Windows: Fix possible crash when using longjmp and gcc 4.6Pete Batard2012-06-072-2/+3
| | | | | | | | * With gcc-4.6 the option -fomit-frame-pointer is turned on per default even for the win32 target. This results in segfaults for any application using setjmp/longjmp and MSVCRT.dll on WinXP. See http://gcc.gnu.org/ml/gcc/2011-10/msg00351.html * Issue reported by Lars Kanis
* Core: Display libusbx version in libusb_init's debug outputPete Batard2012-06-072-2/+3
|
* Autotools: Fix autogen.sh behavior when libtool is not foundLars Wirzenius2012-06-062-3/+3
| | | | | | * Fix naked "exit", which no exit code, to prevent a build failure from being noticed automatically if a build dependency is lacking. * Also printed error message to stderr rather than stdout.
* Linux: Fix a major regression in threads_posix.cPete Batard2012-06-062-10/+7
| | | | | | | | | | | * 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.
* Autotools: Fix versioning regression in configure.acPete Batard2012-06-052-2/+2
| | | | | | * Because of missing [], "LIBUSB_MICROLIBUSB_RC" was being displayed in lieu of version number * Regression introduced with c9d41fe5f0324d969f758f42843e1fd05859f438
* Core: Add toggleable debug loggingPete Batard2012-06-046-15/+21
| | | | | * Also fix a missing space in debug log messages introduced with the previous timestamp logging update
* Core: Fix "LOG_LEVEL_NONE not handled in switch" warningLudovic Rousseau2012-06-042-2/+4
|
* Samples: Fix no previous prototype warnings in xusbLudovic Rousseau2012-06-042-3/+3
|
* Autotools: Apply autoupdate 2.68 recommendationsLudovic Rousseau2012-06-043-6/+6
| | | | | * Not applied: AC_PREREQ([2.68]) as this doesn't seem necessary and 2.68 was released less than 2 years ago.
* Core: Send all logging output to stderrPete Batard2012-05-312-17/+12
| | | | * This effectively removes the use of stdout for info messages
* Darwin: More OS-X logging improvementsPete Batard2012-05-312-12/+14
| | | | | | * Further alignment of log messages according to severity * Fix "'darwin_error_str' defined but not used" warning when option --disable-log is used (reported by Xiaofan Chen)
* Windows: Add new API calls to DLL .def filePete Batard2012-05-292-1/+7
| | | | | * Generated from a MinGW32 generated DLL using the command: echo -e "LIBRARY\nEXPORTS" > libusb-1.0.def; strings libusb-1.0.dll | grep libusb | grep @ | sort | sed -e "s/\(.*\)@\([0-9]*\)/ \1\n \1@\2 = \1/" >> libusb-1.0.def
* Windows: Restore HID supportPete Batard2012-05-284-21/+1513
|
* Core: Only display timestamps in debug mode and use init() as originPete Batard2012-05-282-11/+24
|
* Core: Define log levels in libusb.hPete Batard2012-05-285-24/+30
| | | | * Also update xusb sample to use these levels
* Darwin: Align severity of OS-X logging messagesPete Batard2012-05-282-21/+21
| | | | | * Some informational messages were actually debug or warning * Fixes #1
* All: Add parent and port topology callsPete Batard2012-05-288-15/+201
| | | | | | * Adds libusb_get_port_number, libusb_get_parent and libusb_get_port_path * Linux implementation provided by Alan Stern, OS X by Nathan Hjelm * Unsupported for *BSD platforms
* Misc: Ensure all sources are UTF-8Pete Batard2012-05-2322-31/+28
| | | | * Also remove extra lines at the end of samples
* Windows: Reduce severity of initial conf desc readout failuresPete Batard2012-05-232-4/+5
| | | | | | | | * Failure to read the config descriptor through regular API calls can occur for some hubs (eg. 05E3:0608) and is of no major consequence. * Later failures still reported with error severity as they may hide something more dramatic * Issue reported by Jerry from NovaDSP
* Windows: Fix missing cygwin thread IDPete Batard2012-05-102-1/+5
| | | | * Cygwin uses POSIX threads, not Windows threads
* Windows: Add INSTALL_WIN.txtPete Batard2012-05-102-1/+60
|
* Misc: Separate nano from version.hPete Batard2012-05-103-11/+5
| | | | | | | | | * As version.h processed by autotools, the automatic updating of the nano there can result in unneeded reconfs (eg. after issuing a git pull, regardless of whether the conf is still valid) * Avoid this by placing the nano in its own file, as it won't be processed by autoconf. This also simplifies the versioning git hooks and removes the sed dependency.
* Samples: Use the implicit _SOURCES ruleLudovic Rousseau2012-05-102-7/+1
| | | | * By default automake looks for a source file foo.c for a foo binary.
* Samples: Use a common LDADD for all examplesLudovic Rousseau2012-05-102-5/+3
| | | | * Similar to libusb patch a129732fb45fc424743f26f01c906e4514f11521
* Samples: prefer __linux__ over __linux define in xusbPete Batard2012-05-103-5/+5
| | | | | | * While both should work, __linux__ seems to be preferred and what we use in threads_posix.c * Also fix a typo in .private/README.txt
* libusbx-1.0.11v1.0.11Pete Batard2012-05-082-3/+3
|
* Darwin: Sync type of num_iso_packets fieldsLudovic Rousseau2012-05-082-2/+2
| | | | | | | | | * num_iso_packets was a "size_t" in "struct darwin_transfer_priv" and an "int" in "struct libusb_transfer". The field is now an int in the two structures * Fixes warning os/darwin_usb.c: In function ‘submit_iso_transfer’: os/darwin_usb.c:1334: warning: comparison between signed and unsigned
* Core: Handle TRANSFER_ERROR/TRANSFER_CANCELLED for sync transfersLudovic Rousseau2012-05-082-1/+9
| | | | | | | | | * Return the more appropriate LIBUSB_ERROR_IO instead of LIBUSB_ERROR_OTHER for the cases LIBUSB_TRANSFER_ERROR and LIBUSB_TRANSFER_CANCELLED * Fixes warnings similar to the following when using the GCC option -Wswitch-enum: warning: enumeration value ‘LIBUSB_TRANSFER_ERROR’ not handled in switch
* BSD: Add thread ID support for OpenBSD > 5.1Pete Batard2012-05-082-3/+7
| | | | | | * 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.
* Samples: fix strcat vs strlcat warning on OpenBSDPete Batard2012-05-082-3/+2
| | | | | * Without this, OpenBSD produces the following warning: strcat() is almost always misused, please use strlcat()
* libusbx 1.0.11-rc1v1.0.11-rc1Pete Batard2012-05-073-3/+15
|
* Core: Add a timestamping and thread ID to loggingPeter Stuge2012-05-068-2/+110
|
* Autotools: Use "$@" instead of $* to avoid spaces problemsLudovic Rousseau2012-05-042-2/+2
| | | | * "$@" will correctly handle arguments with spaces
* Autotools: Use "set -e" to exit on the first errorLudovic Rousseau2012-05-043-1/+6
| | | | * The script will not continue if something fails (like a command not found)
* Autotools: Do not use source to call an another scriptLudovic Rousseau2012-05-042-2/+2
| | | | | | * Script is valid for bash but not any /bin/sh * Thanks to Xiaofan Chen for the bug report http://sourceforge.net/mailarchive/message.php?msg_id=29217871
* Windows: Fix deadlock in backend when submitting transfers.Toby Gray2012-05-034-4/+11
| | | | | | | | | | | | | | | | | | | | | Without this change the Windows backend needed to call usbi_fd_notification() from within the backend's submit_transfer. This can cause deadlock when attempting to lock the event lock if another thread was processing events on the just-submitted transfer. The deadlock comes about as the thread calling libusb_submit_transfer acquires the transfer mutex before trying to acquire the event lock; this is the other order of lock acquisition from an event thread handling activity on the just submitted transfer. This could lead to one of two deadlocks: 1) If the transfer completes while usbi_fd_notification() is waiting for the event lock and the callback attempts to resubmit the transfer. 2) If the transfer timeout is hit while usbi_fd_notification() is waiting for the event lock then the attempt to cancel the transfer will deadlock. This patch fixes both of these deadlocks by having libusb_submit_transfer() only call usbi_fd_notification() after having released the transfer mutex.