summaryrefslogtreecommitdiff
path: root/libusb/core.c
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2012-06-21 20:17:09 +0100
committerPete Batard <pete@akeo.ie>2012-06-25 18:52:04 +0100
commitf557e096fde0cb770aca0f442d8f6c3c7facd08d (patch)
treea573d6b8614bf0f1ae426c8df6b5bdbda4ef7f23 /libusb/core.c
parent8b49ddf248ebe6f98f392cafc82c99b15a1dfcda (diff)
downloadlibusbx-f557e096fde0cb770aca0f442d8f6c3c7facd08d.tar.gz
Windows: Fix warnings reported by the Intel Compiler
* 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
Diffstat (limited to 'libusb/core.c')
-rw-r--r--libusb/core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 1e3edc6..dd352f9 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -857,7 +857,7 @@ int API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev,
return LIBUSB_ERROR_NOT_FOUND;
val = ep->wMaxPacketSize;
- ep_type = ep->bmAttributes & 0x3;
+ ep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3);
libusb_free_config_descriptor(config);
r = val & 0x07ff;
@@ -1739,8 +1739,7 @@ void API_EXPORTED libusb_exit(struct libusb_context *ctx)
*/
int API_EXPORTED libusb_has_capability(uint32_t capability)
{
- enum libusb_capability cap = capability;
- switch (cap) {
+ switch (capability) {
case LIBUSB_CAP_HAS_CAPABILITY:
return 1;
}
@@ -1883,8 +1882,7 @@ void usbi_log(struct libusb_context *ctx, enum usbi_log_level level,
*/
DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code)
{
- enum libusb_error error = error_code;
- switch (error) {
+ switch (error_code) {
case LIBUSB_SUCCESS:
return "LIBUSB_SUCCESS";
case LIBUSB_ERROR_IO:
@@ -1913,8 +1911,9 @@ DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code)
return "LIBUSB_ERROR_NOT_SUPPORTED";
case LIBUSB_ERROR_OTHER:
return "LIBUSB_ERROR_OTHER";
+ default:
+ return "**UNKNOWN**";
}
- return "**UNKNOWN**";
}
/** \ingroup misc