mirror of
https://github.com/libretro/RetroArch
synced 2025-02-03 08:54:13 +00:00
Cleanups
This commit is contained in:
parent
cb45f08db8
commit
81fc3a1361
@ -172,17 +172,9 @@ static const blissbox_pad_type_t* input_autoconfigure_get_blissbox_pad_type_win3
|
|||||||
unsigned len = 0;
|
unsigned len = 0;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
char vidPidString[32] = {0};
|
char vidPidString[32] = {0};
|
||||||
char vidString[5] = {0};
|
|
||||||
char pidString[5] = {0};
|
|
||||||
char report[USB_PACKET_CTRL_LEN + 1] = {0};
|
char report[USB_PACKET_CTRL_LEN + 1] = {0};
|
||||||
|
|
||||||
snprintf(vidString, sizeof(vidString), "%04x", vid);
|
snprintf(vidPidString, sizeof(vidPidString), "vid_%04x&pid_%04x", vid, pid);
|
||||||
snprintf(pidString, sizeof(pidString), "%04x", pid);
|
|
||||||
|
|
||||||
strlcat(vidPidString, "vid_", sizeof(vidPidString));
|
|
||||||
strlcat(vidPidString, vidString, sizeof(vidPidString));
|
|
||||||
strlcat(vidPidString, "&pid_", sizeof(vidPidString));
|
|
||||||
strlcat(vidPidString, pidString, sizeof(vidPidString));
|
|
||||||
|
|
||||||
HidD_GetHidGuid(&guidDeviceInterface);
|
HidD_GetHidGuid(&guidDeviceInterface);
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ static uint32_t task_core_updater_get_core_crc(const char *core_path)
|
|||||||
{
|
{
|
||||||
uint32_t crc = 0;
|
uint32_t crc = 0;
|
||||||
|
|
||||||
/* Get crc value */
|
/* Get CRC value */
|
||||||
bool success = intfstream_get_crc(core_file, &crc);
|
bool success = intfstream_get_crc(core_file, &crc);
|
||||||
|
|
||||||
/* Close core file */
|
/* Close core file */
|
||||||
|
@ -166,24 +166,22 @@ static void task_pl_manager_reset_cores_handler(retro_task_t *task)
|
|||||||
switch (pl_manager->status)
|
switch (pl_manager->status)
|
||||||
{
|
{
|
||||||
case PL_MANAGER_BEGIN:
|
case PL_MANAGER_BEGIN:
|
||||||
{
|
/* Load playlist */
|
||||||
/* Load playlist */
|
if (!path_is_valid(pl_manager->playlist_config.path))
|
||||||
if (!path_is_valid(pl_manager->playlist_config.path))
|
goto task_finished;
|
||||||
goto task_finished;
|
|
||||||
|
pl_manager->playlist = playlist_init(&pl_manager->playlist_config);
|
||||||
pl_manager->playlist = playlist_init(&pl_manager->playlist_config);
|
|
||||||
|
if (!pl_manager->playlist)
|
||||||
if (!pl_manager->playlist)
|
goto task_finished;
|
||||||
goto task_finished;
|
|
||||||
|
pl_manager->list_size = playlist_size(pl_manager->playlist);
|
||||||
pl_manager->list_size = playlist_size(pl_manager->playlist);
|
|
||||||
|
if (pl_manager->list_size < 1)
|
||||||
if (pl_manager->list_size < 1)
|
goto task_finished;
|
||||||
goto task_finished;
|
|
||||||
|
/* All good - can start iterating */
|
||||||
/* All good - can start iterating */
|
pl_manager->status = PL_MANAGER_ITERATE_ENTRY_RESET_CORE;
|
||||||
pl_manager->status = PL_MANAGER_ITERATE_ENTRY_RESET_CORE;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PL_MANAGER_ITERATE_ENTRY_RESET_CORE:
|
case PL_MANAGER_ITERATE_ENTRY_RESET_CORE:
|
||||||
{
|
{
|
||||||
@ -270,7 +268,8 @@ task_finished:
|
|||||||
task_set_finished(task, true);
|
task_set_finished(task, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool task_pl_manager_reset_cores_finder(retro_task_t *task, void *user_data)
|
static bool task_pl_manager_reset_cores_finder(
|
||||||
|
retro_task_t *task, void *user_data)
|
||||||
{
|
{
|
||||||
pl_manager_handle_t *pl_manager = NULL;
|
pl_manager_handle_t *pl_manager = NULL;
|
||||||
|
|
||||||
@ -284,7 +283,8 @@ static bool task_pl_manager_reset_cores_finder(retro_task_t *task, void *user_da
|
|||||||
if (!pl_manager)
|
if (!pl_manager)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return string_is_equal((const char*)user_data, pl_manager->playlist_config.path);
|
return string_is_equal((const char*)user_data,
|
||||||
|
pl_manager->playlist_config.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
|
bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
|
||||||
@ -293,7 +293,8 @@ bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
|
|||||||
char playlist_name[PATH_MAX_LENGTH];
|
char playlist_name[PATH_MAX_LENGTH];
|
||||||
char task_title[PATH_MAX_LENGTH];
|
char task_title[PATH_MAX_LENGTH];
|
||||||
retro_task_t *task = task_init();
|
retro_task_t *task = task_init();
|
||||||
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)calloc(1, sizeof(pl_manager_handle_t));
|
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)
|
||||||
|
calloc(1, sizeof(pl_manager_handle_t));
|
||||||
|
|
||||||
playlist_name[0] = '\0';
|
playlist_name[0] = '\0';
|
||||||
task_title[0] = '\0';
|
task_title[0] = '\0';
|
||||||
@ -305,7 +306,8 @@ bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
|
|||||||
if (string_is_empty(playlist_config->path))
|
if (string_is_empty(playlist_config->path))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
fill_pathname_base_noext(playlist_name, playlist_config->path, sizeof(playlist_name));
|
fill_pathname_base_noext(playlist_name,
|
||||||
|
playlist_config->path, sizeof(playlist_name));
|
||||||
|
|
||||||
if (string_is_empty(playlist_name))
|
if (string_is_empty(playlist_name))
|
||||||
goto error;
|
goto error;
|
||||||
@ -590,21 +592,19 @@ static void task_pl_manager_clean_playlist_handler(retro_task_t *task)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PL_MANAGER_VALIDATE_END:
|
case PL_MANAGER_VALIDATE_END:
|
||||||
|
/* Sanity check - if all (or all but one)
|
||||||
|
* playlist entries were removed during the
|
||||||
|
* 'validate' phase, we can stop now */
|
||||||
|
if (pl_manager->list_size < 2)
|
||||||
{
|
{
|
||||||
/* Sanity check - if all (or all but one)
|
pl_manager->status = PL_MANAGER_END;
|
||||||
* playlist entries were removed during the
|
break;
|
||||||
* 'validate' phase, we can stop now */
|
|
||||||
if (pl_manager->list_size < 2)
|
|
||||||
{
|
|
||||||
pl_manager->status = PL_MANAGER_END;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ...otherwise, reset index counter and
|
|
||||||
* start the duplicates check */
|
|
||||||
pl_manager->list_index = 0;
|
|
||||||
pl_manager->status = PL_MANAGER_ITERATE_ENTRY_CHECK_DUPLICATE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ...otherwise, reset index counter and
|
||||||
|
* start the duplicates check */
|
||||||
|
pl_manager->list_index = 0;
|
||||||
|
pl_manager->status = PL_MANAGER_ITERATE_ENTRY_CHECK_DUPLICATE;
|
||||||
break;
|
break;
|
||||||
case PL_MANAGER_ITERATE_ENTRY_CHECK_DUPLICATE:
|
case PL_MANAGER_ITERATE_ENTRY_CHECK_DUPLICATE:
|
||||||
{
|
{
|
||||||
@ -659,21 +659,19 @@ static void task_pl_manager_clean_playlist_handler(retro_task_t *task)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PL_MANAGER_CHECK_DUPLICATE_END:
|
case PL_MANAGER_CHECK_DUPLICATE_END:
|
||||||
|
/* Sanity check - if all (or all but one)
|
||||||
|
* playlist entries were removed during the
|
||||||
|
* 'check duplicate' phase, we can stop now */
|
||||||
|
if (pl_manager->list_size < 2)
|
||||||
{
|
{
|
||||||
/* Sanity check - if all (or all but one)
|
pl_manager->status = PL_MANAGER_END;
|
||||||
* playlist entries were removed during the
|
break;
|
||||||
* 'check duplicate' phase, we can stop now */
|
|
||||||
if (pl_manager->list_size < 2)
|
|
||||||
{
|
|
||||||
pl_manager->status = PL_MANAGER_END;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ...otherwise, reset index counter and
|
|
||||||
* start building the M3U file list */
|
|
||||||
pl_manager->list_index = 0;
|
|
||||||
pl_manager->status = PL_MANAGER_ITERATE_FETCH_M3U;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ...otherwise, reset index counter and
|
||||||
|
* start building the M3U file list */
|
||||||
|
pl_manager->list_index = 0;
|
||||||
|
pl_manager->status = PL_MANAGER_ITERATE_FETCH_M3U;
|
||||||
break;
|
break;
|
||||||
case PL_MANAGER_ITERATE_FETCH_M3U:
|
case PL_MANAGER_ITERATE_FETCH_M3U:
|
||||||
{
|
{
|
||||||
@ -790,7 +788,8 @@ task_finished:
|
|||||||
task_set_finished(task, true);
|
task_set_finished(task, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool task_pl_manager_clean_playlist_finder(retro_task_t *task, void *user_data)
|
static bool task_pl_manager_clean_playlist_finder(
|
||||||
|
retro_task_t *task, void *user_data)
|
||||||
{
|
{
|
||||||
pl_manager_handle_t *pl_manager = NULL;
|
pl_manager_handle_t *pl_manager = NULL;
|
||||||
|
|
||||||
@ -804,16 +803,19 @@ static bool task_pl_manager_clean_playlist_finder(retro_task_t *task, void *user
|
|||||||
if (!pl_manager)
|
if (!pl_manager)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return string_is_equal((const char*)user_data, pl_manager->playlist_config.path);
|
return string_is_equal((const char*)user_data,
|
||||||
|
pl_manager->playlist_config.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool task_push_pl_manager_clean_playlist(const playlist_config_t *playlist_config)
|
bool task_push_pl_manager_clean_playlist(
|
||||||
|
const playlist_config_t *playlist_config)
|
||||||
{
|
{
|
||||||
task_finder_data_t find_data;
|
task_finder_data_t find_data;
|
||||||
char playlist_name[PATH_MAX_LENGTH];
|
char playlist_name[PATH_MAX_LENGTH];
|
||||||
char task_title[PATH_MAX_LENGTH];
|
char task_title[PATH_MAX_LENGTH];
|
||||||
retro_task_t *task = task_init();
|
retro_task_t *task = task_init();
|
||||||
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)calloc(1, sizeof(pl_manager_handle_t));
|
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)
|
||||||
|
calloc(1, sizeof(pl_manager_handle_t));
|
||||||
|
|
||||||
playlist_name[0] = '\0';
|
playlist_name[0] = '\0';
|
||||||
task_title[0] = '\0';
|
task_title[0] = '\0';
|
||||||
@ -825,7 +827,8 @@ bool task_push_pl_manager_clean_playlist(const playlist_config_t *playlist_confi
|
|||||||
if (string_is_empty(playlist_config->path))
|
if (string_is_empty(playlist_config->path))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
fill_pathname_base_noext(playlist_name, playlist_config->path, sizeof(playlist_name));
|
fill_pathname_base_noext(playlist_name,
|
||||||
|
playlist_config->path, sizeof(playlist_name));
|
||||||
|
|
||||||
if (string_is_empty(playlist_name))
|
if (string_is_empty(playlist_name))
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user