Fixed warnings building on Mac OS X 64-bit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c
index 1dc9ab9..5e98e1c 100644
--- a/src/hidapi/mac/hid.c
+++ b/src/hidapi/mac/hid.c
@@ -291,7 +291,7 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
&used_buf_len);
buf[chars_copied] = 0;
- return chars_copied;
+ return (int)chars_copied;
}
else
return 0;
@@ -327,7 +327,7 @@ static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, cha
&used_buf_len);
buf[chars_copied] = 0;
- return used_buf_len;
+ return (int)used_buf_len;
}
else
return 0;
@@ -835,7 +835,7 @@ static int set_report(hid_device *dev, IOHIDReportType type, const unsigned char
data_to_send, length_to_send);
if (res == kIOReturnSuccess) {
- return length;
+ return (int)length;
}
else if (res == kIOReturnUnsupported) {
/*printf("kIOReturnUnsupported\n");*/
@@ -866,7 +866,7 @@ static int return_data(hid_device *dev, unsigned char *data, size_t length)
dev->input_reports = rpt->next;
free(rpt->data);
free(rpt);
- return len;
+ return (int)len;
}
static int cond_wait(const hid_device *dev, pthread_cond_t *cond, pthread_mutex_t *mutex)
@@ -1031,7 +1031,7 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
if (skipped_report_id)
len++;
- return len;
+ return (int)len;
}