mirror of https://github.com/encounter/SDL.git
hidapi/libusb/hid.c: whitespace tidy-up.
This commit is contained in:
parent
282558379e
commit
327ea97436
|
@ -196,7 +196,6 @@ static void free_hid_device(hid_device *dev)
|
||||||
/*TODO: Implement this function on hidapi/libusb.. */
|
/*TODO: Implement this function on hidapi/libusb.. */
|
||||||
static void register_error(hid_device *dev, const char *op)
|
static void register_error(hid_device *dev, const char *op)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -320,7 +319,6 @@ static inline int libusb_get_string_descriptor(libusb_device_handle *dev,
|
||||||
(LIBUSB_DT_STRING << 8) | descriptor_index,
|
(LIBUSB_DT_STRING << 8) | descriptor_index,
|
||||||
lang_id, data, (uint16_t) length, 1000);
|
lang_id, data, (uint16_t) length, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -524,17 +522,17 @@ static int is_xbox360(unsigned short vendor_id, const struct libusb_interface_de
|
||||||
|
|
||||||
static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_descriptor *intf_desc)
|
static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_descriptor *intf_desc)
|
||||||
{
|
{
|
||||||
static const int XB1_IFACE_SUBCLASS = 71;
|
static const int XB1_IFACE_SUBCLASS = 71;
|
||||||
static const int XB1_IFACE_PROTOCOL = 208;
|
static const int XB1_IFACE_PROTOCOL = 208;
|
||||||
static const int SUPPORTED_VENDORS[] = {
|
static const int SUPPORTED_VENDORS[] = {
|
||||||
0x045e, /* Microsoft */
|
0x045e, /* Microsoft */
|
||||||
0x0738, /* Mad Catz */
|
0x0738, /* Mad Catz */
|
||||||
0x0e6f, /* PDP */
|
0x0e6f, /* PDP */
|
||||||
0x0f0d, /* Hori */
|
0x0f0d, /* Hori */
|
||||||
0x1532, /* Razer Wildcat */
|
0x1532, /* Razer Wildcat */
|
||||||
0x24c6, /* PowerA */
|
0x24c6, /* PowerA */
|
||||||
0x2e24, /* Hyperkin */
|
0x2e24, /* Hyperkin */
|
||||||
};
|
};
|
||||||
|
|
||||||
if (intf_desc->bInterfaceNumber == 0 &&
|
if (intf_desc->bInterfaceNumber == 0 &&
|
||||||
intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC &&
|
intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC &&
|
||||||
|
@ -922,8 +920,8 @@ static int read_thread(void *param)
|
||||||
|
|
||||||
static void init_xboxone(libusb_device_handle *device_handle, struct libusb_config_descriptor *conf_desc)
|
static void init_xboxone(libusb_device_handle *device_handle, struct libusb_config_descriptor *conf_desc)
|
||||||
{
|
{
|
||||||
static const int XB1_IFACE_SUBCLASS = 71;
|
static const int XB1_IFACE_SUBCLASS = 71;
|
||||||
static const int XB1_IFACE_PROTOCOL = 208;
|
static const int XB1_IFACE_PROTOCOL = 208;
|
||||||
int j, k, res;
|
int j, k, res;
|
||||||
|
|
||||||
for (j = 0; j < conf_desc->bNumInterfaces; j++) {
|
for (j = 0; j < conf_desc->bNumInterfaces; j++) {
|
||||||
|
@ -1173,21 +1171,21 @@ static void cleanup_mutex(void *param)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)
|
int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)
|
||||||
{
|
{
|
||||||
int bytes_read = -1;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
int transferred;
|
int transferred;
|
||||||
int res = libusb_interrupt_transfer(dev->device_handle, dev->input_endpoint, data, length, &transferred, 5000);
|
int res = libusb_interrupt_transfer(dev->device_handle, dev->input_endpoint, data, length, &transferred, 5000);
|
||||||
LOG("transferred: %d\n", transferred);
|
LOG("transferred: %d\n", transferred);
|
||||||
return transferred;
|
return transferred;
|
||||||
#endif
|
#endif
|
||||||
|
int bytes_read;
|
||||||
|
|
||||||
SDL_LockMutex(dev->mutex);
|
SDL_LockMutex(dev->mutex);
|
||||||
/* TODO: pthread_cleanup SDL? */
|
/* TODO: pthread_cleanup SDL? */
|
||||||
|
|
||||||
|
bytes_read = -1;
|
||||||
|
|
||||||
/* There's an input report queued up. Return it. */
|
/* There's an input report queued up. Return it. */
|
||||||
if (dev->input_reports) {
|
if (dev->input_reports) {
|
||||||
/* Return the first one */
|
/* Return the first one */
|
||||||
|
|
Loading…
Reference in New Issue