mirror of https://github.com/encounter/SDL.git
Fixed use of uninitialized 'size' variable (thanks @ozkan!)
This commit is contained in:
parent
0c4594ac72
commit
6cbdc66650
|
@ -130,7 +130,6 @@ struct hid_device_list_node
|
||||||
|
|
||||||
static IOHIDManagerRef hid_mgr = 0x0;
|
static IOHIDManagerRef hid_mgr = 0x0;
|
||||||
static struct hid_device_list_node *device_list = 0x0;
|
static struct hid_device_list_node *device_list = 0x0;
|
||||||
static int hid_input_monitoring_denied = 0;
|
|
||||||
|
|
||||||
static hid_device *new_hid_device(void)
|
static hid_device *new_hid_device(void)
|
||||||
{
|
{
|
||||||
|
@ -522,11 +521,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
||||||
/* Set up the HID Manager if it hasn't been done */
|
/* Set up the HID Manager if it hasn't been done */
|
||||||
if (hid_init() < 0)
|
if (hid_init() < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* If we don't have permission to open devices, don't enumerate them */
|
|
||||||
if (hid_input_monitoring_denied)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* give the IOHIDManager a chance to update itself */
|
/* give the IOHIDManager a chance to update itself */
|
||||||
process_pending_events();
|
process_pending_events();
|
||||||
|
|
||||||
|
@ -867,11 +862,6 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
else if (ret == kIOReturnNotPermitted) {
|
|
||||||
/* This application doesn't have input monitoring permissions */
|
|
||||||
hid_input_monitoring_denied = 1;
|
|
||||||
goto return_error;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,7 +556,7 @@ HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
|
||||||
ctx->effects_supported = SDL_TRUE;
|
ctx->effects_supported = SDL_TRUE;
|
||||||
ctx->sensors_supported = SDL_TRUE;
|
ctx->sensors_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
} else if (ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data)) == 48 &&
|
} else if ((size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||||
data[2] == 0x27) {
|
data[2] == 0x27) {
|
||||||
Uint8 capabilities = data[4];
|
Uint8 capabilities = data[4];
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
|
||||||
ctx->effects_supported = SDL_TRUE;
|
ctx->effects_supported = SDL_TRUE;
|
||||||
ctx->sensors_supported = SDL_TRUE;
|
ctx->sensors_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
} else if (ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data)) == 48 &&
|
} else if ((size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||||
data[2] == 0x28) {
|
data[2] == 0x28) {
|
||||||
Uint8 capabilities = data[4];
|
Uint8 capabilities = data[4];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue