* [-Wformat=] format 'S' expects argument of type 'T1', but argument N has type 'T2'
* [-Wmissing-declarations] no previous declaration for 'func'
* [-Wreorder] 'Class::Member' will be initialized after
* [-Wsign-compare] comparison between signed and unsigned integer expressions
* [-Wunused-but-set-variable] variable 'v' set but not used
* [-Wunused-parameter] unused parameter 'p'
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
int configuration)
{
usbi_dbg("configuration %d", configuration);
- if (configuration < -1 || configuration > UINT8_MAX)
+ if (configuration < -1 || configuration > (int)UINT8_MAX)
return LIBUSB_ERROR_INVALID_PARAM;
return usbi_backend.set_configuration(dev_handle, configuration);
}
interface_number, alternate_setting);
if (interface_number < 0 || interface_number >= USB_MAXINTERFACES)
return LIBUSB_ERROR_INVALID_PARAM;
- if (alternate_setting < 0 || alternate_setting > UINT8_MAX)
+ if (alternate_setting < 0 || alternate_setting > (int)UINT8_MAX)
return LIBUSB_ERROR_INVALID_PARAM;
usbi_mutex_lock(&dev_handle->lock);
#include "haiku_usb.h"
-int _errno_to_libusb(int status)
+static int _errno_to_libusb(int status)
{
return status;
}
int i;
usb_iso_packet_descriptor *packetDescriptors = new usb_iso_packet_descriptor[fLibusbTransfer->num_iso_packets];
for (i = 0; i < fLibusbTransfer->num_iso_packets; i++) {
- if ((int16)(fLibusbTransfer->iso_packet_desc[i]).length != (fLibusbTransfer->iso_packet_desc[i]).length) {
+ if ((fLibusbTransfer->iso_packet_desc[i]).length > (unsigned int)INT16_MAX) {
fUsbiTransfer->transferred = -1;
usbi_err(TRANSFER_CTX(fLibusbTransfer), "failed isochronous transfer");
break;
USBDeviceHandle::USBDeviceHandle(USBDevice *dev)
:
- fTransfersThread(-1),
fUSBDevice(dev),
fClaimedInterfaces(0),
+ fTransfersThread(-1),
fInitCheck(false)
{
fRawFD = open(dev->Location(), O_RDWR | O_CLOEXEC);
usbi_err(NULL, "Error retrieving active alternate interface");
return _errno_to_libusb(command.alternate.status);
}
- if (command.alternate.alternate_info == alt) {
+ if (command.alternate.alternate_info == (uint32)alt) {
usbi_dbg("Setting alternate interface successful");
return LIBUSB_SUCCESS;
}
USBDevice::USBDevice(const char *path)
:
- fPath(NULL),
- fActiveConfiguration(0), //0?
- fConfigurationDescriptors(NULL),
fClaimedInterfaces(0),
+ fConfigurationDescriptors(NULL),
+ fActiveConfiguration(0), //0?
+ fPath(NULL),
fEndpointToIndex(NULL),
fEndpointToInterface(NULL),
fInitCheck(false)
static int
haiku_init(struct libusb_context *ctx)
{
+ UNUSED(ctx);
if (atomic_add(&gInitCount, 1) == 0)
return gUsbRoster.Start();
return LIBUSB_SUCCESS;
{
struct device_priv *dpriv = usbi_get_device_priv(dev);
- len = MIN(len, UGETW(dpriv->cdesc->wTotalLength));
+ len = MIN(len, (size_t)UGETW(dpriv->cdesc->wTotalLength));
- usbi_dbg("len %d", len);
+ usbi_dbg("len %zu", len);
memcpy(buf, dpriv->cdesc, len);
- return len;
+ return (int)len;
}
int
struct usb_full_desc ufd;
int fd, err;
- usbi_dbg("index %d, len %d", idx, len);
+ usbi_dbg("index %u, len %zu", idx, len);
/* A config descriptor may be requested before opening the device */
if (dpriv->fd >= 0) {
if (dpriv->fd < 0)
close(fd);
- return len;
+ return (int)len;
}
int
struct handle_priv *hpriv = usbi_get_device_handle_priv(handle);
int i;
+ UNUSED(iface);
+
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
hpriv->endpoints[i] = -1;
struct handle_priv *hpriv = usbi_get_device_handle_priv(handle);
int i;
+ UNUSED(iface);
+
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
if (hpriv->endpoints[i] >= 0)
close(hpriv->endpoints[i]);
netbsd_submit_transfer(struct usbi_transfer *itransfer)
{
struct libusb_transfer *transfer;
- struct handle_priv *hpriv;
int err = 0;
usbi_dbg(" ");
transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- hpriv = usbi_get_device_handle_priv(transfer->dev_handle);
switch (transfer->type) {
case LIBUSB_TRANSFER_TYPE_CONTROL:
int
netbsd_cancel_transfer(struct usbi_transfer *itransfer)
{
+ UNUSED(itransfer);
+
usbi_dbg(" ");
return (LIBUSB_ERROR_NOT_SUPPORTED);
{
struct device_priv *dpriv = usbi_get_device_priv(dev);
- len = MIN(len, UGETW(dpriv->cdesc->wTotalLength));
+ len = MIN(len, (size_t)UGETW(dpriv->cdesc->wTotalLength));
usbi_dbg("len %zu", len);
memcpy(buf, dpriv->cdesc, len);
- return (len);
+ return ((int)len);
}
int
}
close(fd);
- return (len);
+ return ((int)len);
}
int
struct handle_priv *hpriv = usbi_get_device_handle_priv(handle);
int i;
+ UNUSED(iface);
+
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
hpriv->endpoints[i] = -1;
struct handle_priv *hpriv = usbi_get_device_handle_priv(handle);
int i;
+ UNUSED(iface);
+
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
if (hpriv->endpoints[i] >= 0)
close(hpriv->endpoints[i]);
obsd_submit_transfer(struct usbi_transfer *itransfer)
{
struct libusb_transfer *transfer;
- struct handle_priv *hpriv;
int err = 0;
usbi_dbg(" ");
transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- hpriv = usbi_get_device_handle_priv(transfer->dev_handle);
switch (transfer->type) {
case LIBUSB_TRANSFER_TYPE_CONTROL:
int
obsd_cancel_transfer(struct usbi_transfer *itransfer)
{
+ UNUSED(itransfer);
+
usbi_dbg(" ");
return (LIBUSB_ERROR_NOT_SUPPORTED);
-#define LIBUSB_NANO 11511
+#define LIBUSB_NANO 11512