(HID) Buildfix

This commit is contained in:
Twinaphex 2015-04-01 23:33:00 +02:00
parent db2dd5010b
commit f04f4e8b93
4 changed files with 11 additions and 13 deletions

View File

@ -424,11 +424,9 @@ static int apple_hid_manager_set_device_matching(apple_hid_t *hid)
return 0;
}
static bool apple_hid_init(void *data)
static void *apple_hid_init(void)
{
apple_hid_t *hid_apple = (apple_hid_t*)data;
hid_apple = (apple_hid_t*)calloc(1, sizeof(*hid_apple));
apple_hid_t *hid_apple = (apple_hid_t*)calloc(1, sizeof(*hid_apple));
if (!hid_apple)
goto error;
@ -439,12 +437,12 @@ static bool apple_hid_init(void *data)
hid_apple->slots = (joypad_connection_t*)pad_connection_init(MAX_USERS);
return true;
return hid_apple;
error:
if (hid_apple)
free(hid_apple);
return false;
return hid_apple;
}
static void apple_hid_free(void *data)

View File

@ -23,8 +23,7 @@ static const hid_driver_t *generic_hid;
static bool hid_joypad_init(void)
{
driver_t *driver = driver_get_ptr();
generic_hid = input_hid_init_first(driver->hid_data);
generic_hid = input_hid_init_first();
if (!generic_hid)
return false;

View File

@ -110,15 +110,16 @@ const char* config_get_hid_driver_options(void)
*
* Returns: HID driver if found, otherwise NULL.
**/
const hid_driver_t *input_hid_init_first(void *data)
const hid_driver_t *input_hid_init_first(void)
{
unsigned i;
for (i = 0; hid_drivers[i]; i++)
{
bool ret = hid_drivers[i]->init(data);
driver_t *driver = driver_get_ptr();
driver->hid_data = hid_drivers[i]->init();
if (ret)
if (driver->hid_data)
{
RARCH_LOG("Found HID driver: \"%s\".\n",
hid_drivers[i]->ident);

View File

@ -30,7 +30,7 @@ typedef struct hid_driver hid_driver_t;
struct hid_driver
{
bool (*init)(void *);
void *(*init)(void);
bool (*query_pad)(void *, unsigned);
void (*free)(void *);
bool (*button)(void *, unsigned, uint16_t);
@ -79,7 +79,7 @@ const char* config_get_hid_driver_options(void);
*
* Returns: HID driver if found, otherwise NULL.
**/
const hid_driver_t *input_hid_init_first(void *data);
const hid_driver_t *input_hid_init_first(void);
#ifdef __cplusplus
}