@@ -125,7 +125,7 @@ struct hid_device_ {
125
125
126
126
static hid_device * new_hid_device (void )
127
127
{
128
- hid_device * dev = calloc (1 , sizeof (hid_device ));
128
+ hid_device * dev = ( hid_device * ) calloc (1 , sizeof (hid_device ));
129
129
dev -> device_handle = NULL ;
130
130
dev -> blocking = 1 ;
131
131
dev -> uses_numbered_reports = 0 ;
@@ -282,7 +282,7 @@ static int get_product_string(IOHIDDeviceRef device, wchar_t *buf, size_t len)
282
282
static wchar_t * dup_wcs (const wchar_t * s )
283
283
{
284
284
size_t len = wcslen (s );
285
- wchar_t * ret = malloc ((len + 1 )* sizeof (wchar_t ));
285
+ wchar_t * ret = ( wchar_t * ) malloc ((len + 1 )* sizeof (wchar_t ));
286
286
wcscpy (ret , s );
287
287
288
288
return ret ;
@@ -411,7 +411,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
411
411
412
412
/* Convert the list into a C array so we can iterate easily. */
413
413
num_devices = CFSetGetCount (device_set );
414
- IOHIDDeviceRef * device_array = calloc (num_devices , sizeof (IOHIDDeviceRef ));
414
+ IOHIDDeviceRef * device_array = ( IOHIDDeviceRef * ) calloc (num_devices , sizeof (IOHIDDeviceRef ));
415
415
CFSetGetValues (device_set , (const void * * ) device_array );
416
416
417
417
/* Iterate over each device, making an entry for it. */
@@ -439,7 +439,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
439
439
io_string_t path ;
440
440
441
441
/* VID/PID match. Create the record. */
442
- tmp = malloc (sizeof (struct hid_device_info ));
442
+ tmp = ( struct hid_device_info * ) malloc (sizeof (struct hid_device_info ));
443
443
if (cur_dev ) {
444
444
cur_dev -> next = tmp ;
445
445
}
@@ -572,8 +572,8 @@ static void hid_report_callback(void *context, IOReturn result, void *sender,
572
572
hid_device * dev = context ;
573
573
574
574
/* Make a new Input Report object */
575
- rpt = calloc (1 , sizeof (struct input_report ));
576
- rpt -> data = calloc (1 , report_length );
575
+ rpt = ( input_report * ) calloc (1 , sizeof (struct input_report ));
576
+ rpt -> data = ( uint8_t * ) calloc (1 , report_length );
577
577
memcpy (rpt -> data , report , report_length );
578
578
rpt -> len = report_length ;
579
579
rpt -> next = NULL ;
@@ -721,7 +721,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
721
721
722
722
/* Create the buffers for receiving data */
723
723
dev -> max_input_report_len = (CFIndex ) get_max_report_length (dev -> device_handle );
724
- dev -> input_report_buf = calloc (dev -> max_input_report_len , sizeof (uint8_t ));
724
+ dev -> input_report_buf = ( uint8_t * ) calloc (dev -> max_input_report_len , sizeof (uint8_t ));
725
725
726
726
/* Create the Run Loop Mode for this device.
727
727
printing the reference seems to work. */
0 commit comments