@@ -124,7 +124,7 @@ struct hid_device_ {
124
124
125
125
static hid_device * new_hid_device (void )
126
126
{
127
- hid_device * dev = calloc (1 , sizeof (hid_device ));
127
+ hid_device * dev = ( hid_device * ) calloc (1 , sizeof (hid_device ));
128
128
dev -> device_handle = NULL ;
129
129
dev -> blocking = 1 ;
130
130
dev -> uses_numbered_reports = 0 ;
@@ -281,7 +281,7 @@ static int get_product_string(IOHIDDeviceRef device, wchar_t *buf, size_t len)
281
281
static wchar_t * dup_wcs (const wchar_t * s )
282
282
{
283
283
size_t len = wcslen (s );
284
- wchar_t * ret = malloc ((len + 1 )* sizeof (wchar_t ));
284
+ wchar_t * ret = ( wchar_t * ) malloc ((len + 1 )* sizeof (wchar_t ));
285
285
wcscpy (ret , s );
286
286
287
287
return ret ;
@@ -410,7 +410,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
410
410
411
411
/* Convert the list into a C array so we can iterate easily. */
412
412
num_devices = CFSetGetCount (device_set );
413
- IOHIDDeviceRef * device_array = calloc (num_devices , sizeof (IOHIDDeviceRef ));
413
+ IOHIDDeviceRef * device_array = ( IOHIDDeviceRef * ) calloc (num_devices , sizeof (IOHIDDeviceRef ));
414
414
CFSetGetValues (device_set , (const void * * ) device_array );
415
415
416
416
/* Iterate over each device, making an entry for it. */
@@ -437,7 +437,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
437
437
io_string_t path ;
438
438
439
439
/* VID/PID match. Create the record. */
440
- tmp = malloc (sizeof (struct hid_device_info ));
440
+ tmp = ( struct hid_device_info * ) malloc (sizeof (struct hid_device_info ));
441
441
if (cur_dev ) {
442
442
cur_dev -> next = tmp ;
443
443
}
@@ -561,8 +561,8 @@ static void hid_report_callback(void *context, IOReturn result, void *sender,
561
561
hid_device * dev = context ;
562
562
563
563
/* Make a new Input Report object */
564
- rpt = calloc (1 , sizeof (struct input_report ));
565
- rpt -> data = calloc (1 , report_length );
564
+ rpt = ( input_report * ) calloc (1 , sizeof (struct input_report ));
565
+ rpt -> data = ( uint8_t * ) calloc (1 , report_length );
566
566
memcpy (rpt -> data , report , report_length );
567
567
rpt -> len = report_length ;
568
568
rpt -> next = NULL ;
@@ -710,7 +710,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
710
710
711
711
/* Create the buffers for receiving data */
712
712
dev -> max_input_report_len = (CFIndex ) get_max_report_length (dev -> device_handle );
713
- dev -> input_report_buf = calloc (dev -> max_input_report_len , sizeof (uint8_t ));
713
+ dev -> input_report_buf = ( uint8_t * ) calloc (dev -> max_input_report_len , sizeof (uint8_t ));
714
714
715
715
/* Create the Run Loop Mode for this device.
716
716
printing the reference seems to work. */
0 commit comments