mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(retroarch.c) Cleanups
This commit is contained in:
parent
0aa9bd9c22
commit
db9a067e64
@ -201,27 +201,17 @@ typedef struct midi_driver
|
||||
bool (*flush)(void *p);
|
||||
} midi_driver_t;
|
||||
|
||||
const void *midi_driver_find_handle(int index);
|
||||
|
||||
struct string_list *midi_driver_get_avail_inputs(void);
|
||||
struct string_list *midi_driver_get_avail_outputs(void);
|
||||
|
||||
bool midi_driver_set_all_sounds_off(void);
|
||||
bool midi_driver_set_volume(unsigned volume);
|
||||
|
||||
bool midi_driver_init(void);
|
||||
void midi_driver_free(void);
|
||||
|
||||
bool midi_driver_set_input(const char *input);
|
||||
bool midi_driver_set_output(const char *output);
|
||||
|
||||
bool midi_driver_input_enabled(void);
|
||||
bool midi_driver_output_enabled(void);
|
||||
|
||||
bool midi_driver_read(uint8_t *byte);
|
||||
bool midi_driver_write(uint8_t byte, uint32_t delta_time);
|
||||
bool midi_driver_flush(void);
|
||||
|
||||
/**
|
||||
* midi_driver_get_event_size:
|
||||
* This is a convenience function for finding out the size of the event based
|
||||
|
321
retroarch.c
321
retroarch.c
@ -731,6 +731,12 @@ static const record_driver_t *record_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
static bool midi_driver_set_all_sounds_off(void);
|
||||
static bool midi_driver_read(uint8_t *byte);
|
||||
static bool midi_driver_write(uint8_t byte, uint32_t delta_time);
|
||||
static bool midi_driver_flush(void);
|
||||
|
||||
extern midi_driver_t midi_null;
|
||||
extern midi_driver_t midi_winmm;
|
||||
extern midi_driver_t midi_alsa;
|
||||
@ -977,16 +983,6 @@ static char current_savestate_dir[PATH_MAX_LENGTH] = {0};
|
||||
static char dir_savestate[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
/* Forward declarations */
|
||||
static const void *location_driver_find_handle(int idx);
|
||||
static const void *audio_driver_find_handle(int idx);
|
||||
static const void *video_driver_find_handle(int idx);
|
||||
static const void *record_driver_find_handle(int idx);
|
||||
static const void *wifi_driver_find_handle(int idx);
|
||||
static const void *camera_driver_find_handle(int idx);
|
||||
static const void *input_driver_find_handle(int idx);
|
||||
static const void *joypad_driver_find_handle(int idx);
|
||||
static const void *hid_driver_find_handle(int idx);
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter)
|
||||
{
|
||||
@ -1110,7 +1106,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
break;
|
||||
#endif
|
||||
case STRING_LIST_CAMERA_DRIVERS:
|
||||
for (i = 0; camera_driver_find_handle(i); i++)
|
||||
for (i = 0; camera_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = camera_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1120,7 +1116,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
break;
|
||||
case STRING_LIST_WIFI_DRIVERS:
|
||||
#ifdef HAVE_WIFI
|
||||
for (i = 0; wifi_driver_find_handle(i); i++)
|
||||
for (i = 0; wifi_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = wifi_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1130,7 +1126,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
break;
|
||||
#endif
|
||||
case STRING_LIST_LOCATION_DRIVERS:
|
||||
for (i = 0; location_driver_find_handle(i); i++)
|
||||
for (i = 0; location_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = location_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1138,7 +1134,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
}
|
||||
break;
|
||||
case STRING_LIST_AUDIO_DRIVERS:
|
||||
for (i = 0; audio_driver_find_handle(i); i++)
|
||||
for (i = 0; audio_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = audio_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1156,7 +1152,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
}
|
||||
break;
|
||||
case STRING_LIST_VIDEO_DRIVERS:
|
||||
for (i = 0; video_driver_find_handle(i); i++)
|
||||
for (i = 0; video_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = video_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1165,7 +1161,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
}
|
||||
break;
|
||||
case STRING_LIST_INPUT_DRIVERS:
|
||||
for (i = 0; input_driver_find_handle(i); i++)
|
||||
for (i = 0; input_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = input_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1175,7 +1171,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
break;
|
||||
case STRING_LIST_INPUT_HID_DRIVERS:
|
||||
#ifdef HAVE_HID
|
||||
for (i = 0; hid_driver_find_handle(i); i++)
|
||||
for (i = 0; hid_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = hid_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1185,7 +1181,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
#endif
|
||||
break;
|
||||
case STRING_LIST_INPUT_JOYPAD_DRIVERS:
|
||||
for (i = 0; joypad_driver_find_handle(i); i++)
|
||||
for (i = 0; joypad_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = joypad_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1194,7 +1190,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
}
|
||||
break;
|
||||
case STRING_LIST_RECORD_DRIVERS:
|
||||
for (i = 0; record_driver_find_handle(i); i++)
|
||||
for (i = 0; record_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = record_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -1203,7 +1199,7 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
}
|
||||
break;
|
||||
case STRING_LIST_MIDI_DRIVERS:
|
||||
for (i = 0; midi_driver_find_handle(i); i++)
|
||||
for (i = 0; midi_drivers[i]; i++)
|
||||
{
|
||||
const char *opt = midi_drivers[i]->ident;
|
||||
*len += strlen(opt) + 1;
|
||||
@ -10893,21 +10889,6 @@ static void clear_controller_port_map(void)
|
||||
|
||||
/* WIFI DRIVER */
|
||||
|
||||
/**
|
||||
* wifi_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to wifi driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *wifi_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = wifi_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_wifi_driver_options:
|
||||
*
|
||||
@ -10974,7 +10955,7 @@ bool wifi_driver_ctl(enum rarch_wifi_ctl_state state, void *data)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
wifi_driver = (const wifi_driver_t*)wifi_driver_find_handle(i);
|
||||
wifi_driver = (const wifi_driver_t*)wifi_drivers[i];
|
||||
else
|
||||
{
|
||||
if (verbosity_is_enabled())
|
||||
@ -10983,13 +10964,13 @@ bool wifi_driver_ctl(enum rarch_wifi_ctl_state state, void *data)
|
||||
RARCH_ERR("Couldn't find any wifi driver named \"%s\"\n",
|
||||
settings->arrays.wifi_driver);
|
||||
RARCH_LOG_OUTPUT("Available wifi drivers are:\n");
|
||||
for (d = 0; wifi_driver_find_handle(d); d++)
|
||||
for (d = 0; wifi_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", wifi_drivers[d]->ident);
|
||||
|
||||
RARCH_WARN("Going to default to first wifi driver...\n");
|
||||
}
|
||||
|
||||
wifi_driver = (const wifi_driver_t*)wifi_driver_find_handle(0);
|
||||
wifi_driver = (const wifi_driver_t*)wifi_drivers[0];
|
||||
|
||||
if (!wifi_driver)
|
||||
retroarch_fail(1, "find_wifi_driver()");
|
||||
@ -11256,21 +11237,6 @@ void ui_companion_driver_log_msg(const char *msg)
|
||||
|
||||
/* RECORDING */
|
||||
|
||||
/**
|
||||
* record_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to record driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *record_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = record_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_record_driver_options:
|
||||
*
|
||||
@ -11299,7 +11265,7 @@ static void find_record_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
recording_driver = (const record_driver_t*)record_driver_find_handle(i);
|
||||
recording_driver = (const record_driver_t*)record_drivers[i];
|
||||
else
|
||||
{
|
||||
if (verbosity_is_enabled())
|
||||
@ -11309,12 +11275,12 @@ static void find_record_driver(void)
|
||||
RARCH_ERR("[recording] Couldn't find any record driver named \"%s\"\n",
|
||||
settings->arrays.record_driver);
|
||||
RARCH_LOG_OUTPUT("Available record drivers are:\n");
|
||||
for (d = 0; record_driver_find_handle(d); d++)
|
||||
for (d = 0; record_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", record_drivers[d].ident);
|
||||
RARCH_WARN("[recording] Going to default to first record driver...\n");
|
||||
}
|
||||
|
||||
recording_driver = (const record_driver_t*)record_driver_find_handle(0);
|
||||
recording_driver = (const record_driver_t*)record_drivers[0];
|
||||
|
||||
if (!recording_driver)
|
||||
retroarch_fail(1, "find_record_driver()");
|
||||
@ -13189,21 +13155,6 @@ void fire_connection_listener(unsigned port, input_device_driver_t *driver)
|
||||
|| ((autoconf_bind)->joyaxis != AXIS_NONE)) \
|
||||
)
|
||||
|
||||
/**
|
||||
* input_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to input driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *input_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = input_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_input_driver_options:
|
||||
*
|
||||
@ -15540,18 +15491,18 @@ static bool input_driver_find_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
current_input = (input_driver_t*)input_driver_find_handle(i);
|
||||
current_input = (input_driver_t*)input_drivers[i];
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any input driver named \"%s\"\n",
|
||||
settings->arrays.input_driver);
|
||||
RARCH_LOG_OUTPUT("Available input drivers are:\n");
|
||||
for (d = 0; input_driver_find_handle(d); d++)
|
||||
for (d = 0; input_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", input_drivers[d]->ident);
|
||||
RARCH_WARN("Going to default to first input driver...\n");
|
||||
|
||||
current_input = (input_driver_t*)input_driver_find_handle(0);
|
||||
current_input = (input_driver_t*)input_drivers[0];
|
||||
|
||||
if (!current_input)
|
||||
{
|
||||
@ -15728,21 +15679,6 @@ bool input_driver_ungrab_mouse(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* joypad_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to joypad driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *joypad_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = joypad_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_joypad_driver_options:
|
||||
*
|
||||
@ -15994,21 +15930,6 @@ void input_pad_connect(unsigned port, input_device_driver_t *driver)
|
||||
}
|
||||
|
||||
#ifdef HAVE_HID
|
||||
/**
|
||||
* hid_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to HID driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *hid_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = hid_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
const void *hid_driver_get_data(void)
|
||||
{
|
||||
return hid_data;
|
||||
@ -17324,14 +17245,6 @@ static midi_driver_t *midi_driver_find_driver(const char *ident)
|
||||
return &midi_null;
|
||||
}
|
||||
|
||||
const void *midi_driver_find_handle(int index)
|
||||
{
|
||||
if (index < 0 || index >= ARRAY_SIZE(midi_drivers))
|
||||
return NULL;
|
||||
|
||||
return midi_drivers[index];
|
||||
}
|
||||
|
||||
struct string_list *midi_driver_get_avail_inputs(void)
|
||||
{
|
||||
return midi_drv_inputs;
|
||||
@ -17341,7 +17254,8 @@ struct string_list *midi_driver_get_avail_outputs(void)
|
||||
{
|
||||
return midi_drv_outputs;
|
||||
}
|
||||
bool midi_driver_set_all_sounds_off(void)
|
||||
|
||||
static bool midi_driver_set_all_sounds_off(void)
|
||||
{
|
||||
midi_event_t event;
|
||||
uint8_t i;
|
||||
@ -17400,7 +17314,7 @@ bool midi_driver_set_volume(unsigned volume)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool midi_driver_init_io_buffers(void)
|
||||
static bool midi_driver_init_io_buffers(void)
|
||||
{
|
||||
midi_drv_input_buffer = (uint8_t*)malloc(MIDI_DRIVER_BUF_SIZE);
|
||||
midi_drv_output_buffer = (uint8_t*)malloc(MIDI_DRIVER_BUF_SIZE);
|
||||
@ -17417,7 +17331,42 @@ bool midi_driver_init_io_buffers(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool midi_driver_init(void)
|
||||
static void midi_driver_free(void)
|
||||
{
|
||||
if (midi_drv_data)
|
||||
{
|
||||
midi_drv->free(midi_drv_data);
|
||||
midi_drv_data = NULL;
|
||||
}
|
||||
|
||||
if (midi_drv_inputs)
|
||||
{
|
||||
string_list_free(midi_drv_inputs);
|
||||
midi_drv_inputs = NULL;
|
||||
}
|
||||
if (midi_drv_outputs)
|
||||
{
|
||||
string_list_free(midi_drv_outputs);
|
||||
midi_drv_outputs = NULL;
|
||||
}
|
||||
|
||||
if (midi_drv_input_buffer)
|
||||
{
|
||||
free(midi_drv_input_buffer);
|
||||
midi_drv_input_buffer = NULL;
|
||||
}
|
||||
if (midi_drv_output_buffer)
|
||||
{
|
||||
free(midi_drv_output_buffer);
|
||||
midi_drv_output_buffer = NULL;
|
||||
}
|
||||
|
||||
midi_drv_input_enabled = false;
|
||||
midi_drv_output_enabled = false;
|
||||
}
|
||||
|
||||
|
||||
static bool midi_driver_init(void)
|
||||
{
|
||||
settings_t *settings = configuration_settings;
|
||||
union string_list_elem_attr attr = {0};
|
||||
@ -17517,40 +17466,6 @@ bool midi_driver_init(void)
|
||||
return err_str == NULL;
|
||||
}
|
||||
|
||||
void midi_driver_free(void)
|
||||
{
|
||||
if (midi_drv_data)
|
||||
{
|
||||
midi_drv->free(midi_drv_data);
|
||||
midi_drv_data = NULL;
|
||||
}
|
||||
|
||||
if (midi_drv_inputs)
|
||||
{
|
||||
string_list_free(midi_drv_inputs);
|
||||
midi_drv_inputs = NULL;
|
||||
}
|
||||
if (midi_drv_outputs)
|
||||
{
|
||||
string_list_free(midi_drv_outputs);
|
||||
midi_drv_outputs = NULL;
|
||||
}
|
||||
|
||||
if (midi_drv_input_buffer)
|
||||
{
|
||||
free(midi_drv_input_buffer);
|
||||
midi_drv_input_buffer = NULL;
|
||||
}
|
||||
if (midi_drv_output_buffer)
|
||||
{
|
||||
free(midi_drv_output_buffer);
|
||||
midi_drv_output_buffer = NULL;
|
||||
}
|
||||
|
||||
midi_drv_input_enabled = false;
|
||||
midi_drv_output_enabled = false;
|
||||
}
|
||||
|
||||
bool midi_driver_set_input(const char *input)
|
||||
{
|
||||
if (!midi_drv_data)
|
||||
@ -17636,7 +17551,7 @@ bool midi_driver_output_enabled(void)
|
||||
return midi_drv_output_enabled;
|
||||
}
|
||||
|
||||
bool midi_driver_read(uint8_t *byte)
|
||||
static bool midi_driver_read(uint8_t *byte)
|
||||
{
|
||||
static int i;
|
||||
|
||||
@ -17689,7 +17604,7 @@ bool midi_driver_read(uint8_t *byte)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool midi_driver_write(uint8_t byte, uint32_t delta_time)
|
||||
static bool midi_driver_write(uint8_t byte, uint32_t delta_time)
|
||||
{
|
||||
static int event_size;
|
||||
|
||||
@ -17795,7 +17710,7 @@ bool midi_driver_write(uint8_t byte, uint32_t delta_time)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool midi_driver_flush(void)
|
||||
static bool midi_driver_flush(void)
|
||||
{
|
||||
if (!midi_drv_data)
|
||||
{
|
||||
@ -17966,21 +17881,6 @@ static void report_audio_buffer_statistics(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to audio driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *audio_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = audio_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_audio_driver_options:
|
||||
*
|
||||
@ -18084,7 +17984,7 @@ static bool audio_driver_find_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
current_audio = (const audio_driver_t*)audio_driver_find_handle(i);
|
||||
current_audio = (const audio_driver_t*)audio_drivers[i];
|
||||
else
|
||||
{
|
||||
if (verbosity_is_enabled())
|
||||
@ -18093,12 +17993,12 @@ static bool audio_driver_find_driver(void)
|
||||
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n",
|
||||
settings->arrays.audio_driver);
|
||||
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
|
||||
for (d = 0; audio_driver_find_handle(d); d++)
|
||||
for (d = 0; audio_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", audio_drivers[d]->ident);
|
||||
RARCH_WARN("Going to default to first audio driver...\n");
|
||||
}
|
||||
|
||||
current_audio = (const audio_driver_t*)audio_driver_find_handle(0);
|
||||
current_audio = (const audio_driver_t*)audio_drivers[0];
|
||||
|
||||
if (!current_audio)
|
||||
retroarch_fail(1, "audio_driver_find()");
|
||||
@ -19403,21 +19303,6 @@ static bool set_resize_null(void *a, unsigned b, unsigned c)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* video_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to video driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *video_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = video_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_video_driver_options:
|
||||
*
|
||||
@ -20761,7 +20646,7 @@ static bool video_driver_find_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
current_video = (video_driver_t*)video_driver_find_handle(i);
|
||||
current_video = (video_driver_t*)video_drivers[i];
|
||||
else
|
||||
{
|
||||
if (verbosity_is_enabled())
|
||||
@ -20770,12 +20655,12 @@ static bool video_driver_find_driver(void)
|
||||
RARCH_ERR("Couldn't find any video driver named \"%s\"\n",
|
||||
settings->arrays.video_driver);
|
||||
RARCH_LOG_OUTPUT("Available video drivers are:\n");
|
||||
for (d = 0; video_driver_find_handle(d); d++)
|
||||
for (d = 0; video_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", video_drivers[d]->ident);
|
||||
RARCH_WARN("Going to default to first video driver...\n");
|
||||
}
|
||||
|
||||
current_video = (video_driver_t*)video_driver_find_handle(0);
|
||||
current_video = (video_driver_t*)video_drivers[0];
|
||||
|
||||
if (!current_video)
|
||||
retroarch_fail(1, "find_video_driver()");
|
||||
@ -22126,21 +22011,6 @@ struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api)
|
||||
|
||||
/* LOCATION */
|
||||
|
||||
/**
|
||||
* location_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to location driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *location_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = location_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_location_driver_options:
|
||||
*
|
||||
@ -22169,7 +22039,7 @@ static void find_location_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
location_driver = (const location_driver_t*)location_driver_find_handle(i);
|
||||
location_driver = (const location_driver_t*)location_drivers[i];
|
||||
else
|
||||
{
|
||||
|
||||
@ -22179,13 +22049,13 @@ static void find_location_driver(void)
|
||||
RARCH_ERR("Couldn't find any location driver named \"%s\"\n",
|
||||
settings->arrays.location_driver);
|
||||
RARCH_LOG_OUTPUT("Available location drivers are:\n");
|
||||
for (d = 0; location_driver_find_handle(d); d++)
|
||||
for (d = 0; location_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", location_drivers[d]->ident);
|
||||
|
||||
RARCH_WARN("Going to default to first location driver...\n");
|
||||
}
|
||||
|
||||
location_driver = (const location_driver_t*)location_driver_find_handle(0);
|
||||
location_driver = (const location_driver_t*)location_drivers[0];
|
||||
|
||||
if (!location_driver)
|
||||
retroarch_fail(1, "find_location_driver()");
|
||||
@ -22313,21 +22183,6 @@ static void uninit_location(void)
|
||||
|
||||
/* CAMERA */
|
||||
|
||||
/**
|
||||
* camera_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
*
|
||||
* Returns: handle to camera driver at index. Can be NULL
|
||||
* if nothing found.
|
||||
**/
|
||||
static const void *camera_driver_find_handle(int idx)
|
||||
{
|
||||
const void *drv = camera_drivers[idx];
|
||||
if (!drv)
|
||||
return NULL;
|
||||
return drv;
|
||||
}
|
||||
|
||||
/**
|
||||
* config_get_camera_driver_options:
|
||||
*
|
||||
@ -22379,7 +22234,7 @@ static void camera_driver_find_driver(void)
|
||||
i = (int)drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
|
||||
camera_driver = (const camera_driver_t*)camera_drivers[i];
|
||||
else
|
||||
{
|
||||
if (verbosity_is_enabled())
|
||||
@ -22388,13 +22243,13 @@ static void camera_driver_find_driver(void)
|
||||
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
|
||||
settings->arrays.camera_driver);
|
||||
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
|
||||
for (d = 0; camera_driver_find_handle(d); d++)
|
||||
for (d = 0; camera_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", camera_drivers[d]->ident);
|
||||
|
||||
RARCH_WARN("Going to default to first camera driver...\n");
|
||||
}
|
||||
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
|
||||
camera_driver = (const camera_driver_t*)camera_drivers[0];
|
||||
|
||||
if (!camera_driver)
|
||||
retroarch_fail(1, "find_camera_driver()");
|
||||
@ -22421,7 +22276,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
{
|
||||
if (string_is_equal(label, "camera_driver"))
|
||||
{
|
||||
if (camera_driver_find_handle(i))
|
||||
if (camera_drivers[i])
|
||||
{
|
||||
strlcpy(s, camera_drivers[i]->ident, len);
|
||||
return camera_drivers[i];
|
||||
@ -22429,7 +22284,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "location_driver"))
|
||||
{
|
||||
if (location_driver_find_handle(i))
|
||||
if (location_drivers[i])
|
||||
{
|
||||
strlcpy(s, location_drivers[i]->ident, len);
|
||||
return location_drivers[i];
|
||||
@ -22447,7 +22302,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
#endif
|
||||
else if (string_is_equal(label, "input_driver"))
|
||||
{
|
||||
if (input_driver_find_handle(i))
|
||||
if (input_drivers[i])
|
||||
{
|
||||
strlcpy(s, input_drivers[i]->ident, len);
|
||||
return input_drivers[i];
|
||||
@ -22455,7 +22310,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "input_joypad_driver"))
|
||||
{
|
||||
if (joypad_driver_find_handle(i))
|
||||
if (joypad_drivers[i])
|
||||
{
|
||||
strlcpy(s, joypad_drivers[i]->ident, len);
|
||||
return joypad_drivers[i];
|
||||
@ -22463,7 +22318,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "video_driver"))
|
||||
{
|
||||
if (video_driver_find_handle(i))
|
||||
if (video_drivers[i])
|
||||
{
|
||||
strlcpy(s, video_drivers[i]->ident, len);
|
||||
return video_drivers[i];
|
||||
@ -22471,7 +22326,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "audio_driver"))
|
||||
{
|
||||
if (audio_driver_find_handle(i))
|
||||
if (audio_drivers[i])
|
||||
{
|
||||
strlcpy(s, audio_drivers[i]->ident, len);
|
||||
return audio_drivers[i];
|
||||
@ -22479,7 +22334,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "record_driver"))
|
||||
{
|
||||
if (record_driver_find_handle(i))
|
||||
if (record_drivers[i])
|
||||
{
|
||||
strlcpy(s, record_drivers[i]->ident, len);
|
||||
return record_drivers[i];
|
||||
@ -22487,7 +22342,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "midi_driver"))
|
||||
{
|
||||
if (midi_driver_find_handle(i))
|
||||
if (midi_drivers[i])
|
||||
{
|
||||
strlcpy(s, midi_drivers[i]->ident, len);
|
||||
return midi_drivers[i];
|
||||
@ -22503,7 +22358,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
}
|
||||
else if (string_is_equal(label, "wifi_driver"))
|
||||
{
|
||||
if (wifi_driver_find_handle(i))
|
||||
if (wifi_drivers[i])
|
||||
{
|
||||
strlcpy(s, wifi_drivers[i]->ident, len);
|
||||
return wifi_drivers[i];
|
||||
|
Loading…
Reference in New Issue
Block a user