summaryrefslogtreecommitdiff
path: root/libusb/os/threads_posix.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2017-12-27 23:53:27 -0500
committerChris Dickens <christopher.a.dickens@gmail.com>2017-12-28 22:40:30 -0800
commit0b3d4c68d87a4ffda2a4e0ff86983f69599048ce (patch)
tree30df5e745d05b3628ab37021df0ebb8d730ba62b /libusb/os/threads_posix.c
parentc1d8c8d654fbb30f420ce273a41f954342f47174 (diff)
downloadlibusb-0b3d4c68d87a4ffda2a4e0ff86983f69599048ce.tar.gz
Fixed various trivial cppcheck 1.80 warnings
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>
Diffstat (limited to 'libusb/os/threads_posix.c')
-rw-r--r--libusb/os/threads_posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c
index 2d580c3..ce14445 100644
--- a/libusb/os/threads_posix.c
+++ b/libusb/os/threads_posix.c
@@ -59,7 +59,7 @@ int usbi_cond_timedwait(pthread_cond_t *cond,
int usbi_get_tid(void)
{
- int ret = -1;
+ int ret;
#if defined(__ANDROID__)
ret = gettid();
#elif defined(__linux__)
@@ -73,6 +73,8 @@ int usbi_get_tid(void)
mach_port_deallocate(mach_task_self(), ret);
#elif defined(__CYGWIN__)
ret = GetCurrentThreadId();
+#else
+ ret = -1;
#endif
/* TODO: NetBSD thread ID support */
return ret;