mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
(Apple) Input - some cleanups
This commit is contained in:
parent
d236552aeb
commit
277b1f6702
@ -575,7 +575,9 @@ static bool apple_bind_button_pressed(void *data, int key)
|
||||
static void apple_input_free_input(void *data)
|
||||
{
|
||||
(void)data;
|
||||
g_joydriver->destroy();
|
||||
|
||||
if (g_joydriver && g_joydriver->destroy)
|
||||
g_joydriver->destroy();
|
||||
}
|
||||
|
||||
static void apple_input_set_keybinds(void *data, unsigned device, unsigned port,
|
||||
@ -640,7 +642,7 @@ static void apple_input_set_keybinds(void *data, unsigned device, unsigned port,
|
||||
{
|
||||
struct platform_bind *ret = (struct platform_bind*)data;
|
||||
|
||||
if (ret->joykey == NO_BTN)
|
||||
if (ret && ret->joykey == NO_BTN)
|
||||
strlcpy(ret->desc, "No button", sizeof(ret->desc));
|
||||
else
|
||||
snprintf(ret->desc, sizeof(ret->desc), "Button %llu", ret->joykey);
|
||||
|
@ -56,7 +56,8 @@ static int32_t find_empty_slot(void)
|
||||
|
||||
int32_t apple_joypad_connect(const char* name, struct apple_pad_connection* connection)
|
||||
{
|
||||
int32_t slot = find_empty_slot();
|
||||
int32_t slot;
|
||||
slot = find_empty_slot();
|
||||
|
||||
if (slot >= 0 && slot < MAX_PLAYERS)
|
||||
{
|
||||
@ -88,11 +89,12 @@ int32_t apple_joypad_connect(const char* name, struct apple_pad_connection* conn
|
||||
|
||||
int32_t apple_joypad_connect_gcapi(void)
|
||||
{
|
||||
int32_t slot = find_empty_slot();
|
||||
int32_t slot;
|
||||
slot = find_empty_slot();
|
||||
|
||||
if (slot >= 0 && slot < MAX_PLAYERS)
|
||||
{
|
||||
joypad_slot_t* s = (joypad_slot_t*)&slots[slot];
|
||||
joypad_slot_t *s = (joypad_slot_t*)&slots[slot];
|
||||
s->used = true;
|
||||
s->is_gcapi = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user