Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit 474145e

Browse files
mrpippysignal11
authored andcommitted
Mac: Remove unused get_string_property_utf8()
Remove get_string_property_utf8(), it's not used since make_path() was removed
1 parent 59a0767 commit 474145e

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

mac/hid.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -266,46 +266,6 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
266266

267267
}
268268

269-
static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, char *buf, size_t len)
270-
{
271-
CFStringRef str;
272-
if (!len)
273-
return 0;
274-
275-
str = IOHIDDeviceGetProperty(device, prop);
276-
277-
buf[0] = 0;
278-
279-
if (str) {
280-
len--;
281-
282-
CFIndex str_len = CFStringGetLength(str);
283-
CFRange range;
284-
range.location = 0;
285-
range.length = str_len;
286-
CFIndex used_buf_len;
287-
CFIndex chars_copied;
288-
chars_copied = CFStringGetBytes(str,
289-
range,
290-
kCFStringEncodingUTF8,
291-
(char)'?',
292-
FALSE,
293-
(UInt8*)buf,
294-
len,
295-
&used_buf_len);
296-
297-
if (used_buf_len == len)
298-
buf[len] = 0; /* len is decremented above */
299-
else
300-
buf[used_buf_len] = 0;
301-
302-
return used_buf_len;
303-
}
304-
else
305-
return 0;
306-
}
307-
308-
309269
static int get_serial_number(IOHIDDeviceRef device, wchar_t *buf, size_t len)
310270
{
311271
return get_string_property(device, CFSTR(kIOHIDSerialNumberKey), buf, len);

0 commit comments

Comments
 (0)