mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 07:43:52 +00:00
(iohidmanager_hid.c) Silence a whole bunch of warnings
This commit is contained in:
parent
1b3225089e
commit
fc2654cd0f
@ -60,22 +60,18 @@ struct iohidmanager_hid_adapter
|
|||||||
|
|
||||||
CFComparisonResult iohidmanager_sort_elements(const void *val1, const void *val2, void *context)
|
CFComparisonResult iohidmanager_sort_elements(const void *val1, const void *val2, void *context)
|
||||||
{
|
{
|
||||||
uint32_t page1 = IOHIDElementGetUsagePage((IOHIDElementRef)val1);
|
uint32_t page1 = (uint32_t)IOHIDElementGetUsagePage((IOHIDElementRef)val1);
|
||||||
uint32_t page2 = IOHIDElementGetUsagePage((IOHIDElementRef)val2);
|
uint32_t page2 = (uint32_t)IOHIDElementGetUsagePage((IOHIDElementRef)val2);
|
||||||
uint32_t use1 = IOHIDElementGetUsage((IOHIDElementRef)val1);
|
uint32_t use1 = (uint32_t)IOHIDElementGetUsage((IOHIDElementRef)val1);
|
||||||
uint32_t use2 = IOHIDElementGetUsage((IOHIDElementRef)val2);
|
uint32_t use2 = (uint32_t)IOHIDElementGetUsage((IOHIDElementRef)val2);
|
||||||
uint32_t cookie1 = IOHIDElementGetCookie((IOHIDElementRef)val1);
|
uint32_t cookie1 = (uint32_t)IOHIDElementGetCookie((IOHIDElementRef)val1);
|
||||||
uint32_t cookie2 = IOHIDElementGetCookie((IOHIDElementRef)val2);
|
uint32_t cookie2 = (uint32_t)IOHIDElementGetCookie((IOHIDElementRef)val2);
|
||||||
|
|
||||||
if(page1 != page2)
|
if (page1 != page2)
|
||||||
{
|
|
||||||
return page1 > page2;
|
return page1 > page2;
|
||||||
}
|
|
||||||
|
|
||||||
if(use1 != use2)
|
if(use1 != use2)
|
||||||
{
|
|
||||||
return use1 > use2;
|
return use1 > use2;
|
||||||
}
|
|
||||||
|
|
||||||
return cookie1 > cookie2;
|
return cookie1 > cookie2;
|
||||||
}
|
}
|
||||||
@ -262,10 +258,10 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
|
|||||||
{
|
{
|
||||||
tmp = adapter->hats;
|
tmp = adapter->hats;
|
||||||
|
|
||||||
while(tmp && tmp->cookie != cookie)
|
while(tmp && tmp->cookie != (IOHIDElementCookie)cookie)
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|
||||||
if(tmp->cookie == cookie)
|
if(tmp->cookie == (IOHIDElementCookie)cookie)
|
||||||
{
|
{
|
||||||
CFIndex range = IOHIDElementGetLogicalMax(element) - IOHIDElementGetLogicalMin(element);
|
CFIndex range = IOHIDElementGetLogicalMax(element) - IOHIDElementGetLogicalMin(element);
|
||||||
CFIndex val = IOHIDValueGetIntegerValue(value);
|
CFIndex val = IOHIDValueGetIntegerValue(value);
|
||||||
@ -328,10 +324,10 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
|
|||||||
{
|
{
|
||||||
tmp = adapter->axes;
|
tmp = adapter->axes;
|
||||||
|
|
||||||
while(tmp && tmp->cookie != cookie)
|
while(tmp && tmp->cookie != (IOHIDElementCookie)cookie)
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|
||||||
if(tmp->cookie == cookie)
|
if(tmp->cookie == (IOHIDElementCookie)cookie)
|
||||||
{
|
{
|
||||||
CFIndex min = IOHIDElementGetPhysicalMin(element);
|
CFIndex min = IOHIDElementGetPhysicalMin(element);
|
||||||
CFIndex state = IOHIDValueGetIntegerValue(value) - min;
|
CFIndex state = IOHIDValueGetIntegerValue(value) - min;
|
||||||
@ -354,10 +350,10 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
|
|||||||
{
|
{
|
||||||
tmp = adapter->buttons;
|
tmp = adapter->buttons;
|
||||||
|
|
||||||
while(tmp && tmp->cookie != cookie)
|
while(tmp && tmp->cookie != (IOHIDElementCookie)cookie)
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|
||||||
if(tmp->cookie == cookie)
|
if(tmp->cookie == (IOHIDElementCookie)cookie)
|
||||||
{
|
{
|
||||||
CFIndex state = IOHIDValueGetIntegerValue(value);
|
CFIndex state = IOHIDValueGetIntegerValue(value);
|
||||||
|
|
||||||
@ -544,9 +540,9 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
IOHIDElementType type = IOHIDElementGetType(element);
|
IOHIDElementType type = IOHIDElementGetType(element);
|
||||||
uint32_t page = IOHIDElementGetUsagePage(element);
|
uint32_t page = (uint32_t)IOHIDElementGetUsagePage(element);
|
||||||
uint32_t use = IOHIDElementGetUsage(element);
|
uint32_t use = (uint32_t)IOHIDElementGetUsage(element);
|
||||||
uint32_t cookie = IOHIDElementGetCookie(element);
|
uint32_t cookie = (uint32_t)IOHIDElementGetCookie(element);
|
||||||
|
|
||||||
switch (page)
|
switch (page)
|
||||||
{
|
{
|
||||||
@ -569,7 +565,7 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result,
|
|||||||
/* as far as I can tell, OSX only reports one Hat */
|
/* as far as I can tell, OSX only reports one Hat */
|
||||||
apple_input_rec_t *hat = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
apple_input_rec_t *hat = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
||||||
hat->id = 0;
|
hat->id = 0;
|
||||||
hat->cookie = cookie;
|
hat->cookie = (IOHIDElementCookie)cookie;
|
||||||
hat->next = NULL;
|
hat->next = NULL;
|
||||||
adapter->hats = hat;
|
adapter->hats = hat;
|
||||||
}
|
}
|
||||||
@ -588,7 +584,7 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result,
|
|||||||
|
|
||||||
apple_input_rec_t *axis = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
apple_input_rec_t *axis = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
||||||
axis->id = i;
|
axis->id = i;
|
||||||
axis->cookie = cookie;
|
axis->cookie = (IOHIDElementCookie)cookie;
|
||||||
axis->next = NULL;
|
axis->next = NULL;
|
||||||
|
|
||||||
if(iohidmanager_check_for_id(adapter->axes,i))
|
if(iohidmanager_check_for_id(adapter->axes,i))
|
||||||
@ -628,8 +624,8 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result,
|
|||||||
case kIOHIDElementTypeInput_Button:
|
case kIOHIDElementTypeInput_Button:
|
||||||
{
|
{
|
||||||
apple_input_rec_t *btn = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
apple_input_rec_t *btn = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
|
||||||
btn->id = use - 1;
|
btn->id = (uint32_t)(use - 1);
|
||||||
btn->cookie = cookie;
|
btn->cookie = (IOHIDElementCookie)cookie;
|
||||||
btn->next = NULL;
|
btn->next = NULL;
|
||||||
|
|
||||||
if(iohidmanager_check_for_id(adapter->buttons,btn->id))
|
if(iohidmanager_check_for_id(adapter->buttons,btn->id))
|
||||||
|
@ -291,7 +291,7 @@
|
|||||||
"-DOSX",
|
"-DOSX",
|
||||||
"-DHAVE_OPENGL",
|
"-DHAVE_OPENGL",
|
||||||
"-DHAVE_FBO",
|
"-DHAVE_FBO",
|
||||||
"-DHAVE_CC_RESAMPLER",
|
"-DHAVE_CC_RESAMPLER",
|
||||||
"-DHAVE_GLSL",
|
"-DHAVE_GLSL",
|
||||||
"-DINLINE=inline",
|
"-DINLINE=inline",
|
||||||
"-D__LIBRETRO__",
|
"-D__LIBRETRO__",
|
||||||
@ -365,7 +365,7 @@
|
|||||||
"-DOSX",
|
"-DOSX",
|
||||||
"-DHAVE_OPENGL",
|
"-DHAVE_OPENGL",
|
||||||
"-DHAVE_FBO",
|
"-DHAVE_FBO",
|
||||||
"-DHAVE_CC_RESAMPLER",
|
"-DHAVE_CC_RESAMPLER",
|
||||||
"-DHAVE_GLSL",
|
"-DHAVE_GLSL",
|
||||||
"-DINLINE=inline",
|
"-DINLINE=inline",
|
||||||
"-D__LIBRETRO__",
|
"-D__LIBRETRO__",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user