mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 05:43:34 +00:00
(General) Cleanups pt. 3
This commit is contained in:
parent
29c82f9360
commit
d532fb4979
@ -173,7 +173,7 @@ static void event_init_movie(void)
|
|||||||
}
|
}
|
||||||
else if (global->bsv.movie_start_recording)
|
else if (global->bsv.movie_start_recording)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".",
|
snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".",
|
||||||
global->bsv.movie_start_path);
|
global->bsv.movie_start_path);
|
||||||
|
|
||||||
@ -203,11 +203,11 @@ static void event_init_movie(void)
|
|||||||
**/
|
**/
|
||||||
static void event_disk_control_set_eject(bool new_state, bool print_log)
|
static void event_disk_control_set_eject(bool new_state, bool print_log)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
bool error = false;
|
||||||
const struct retro_disk_control_callback *control =
|
const struct retro_disk_control_callback *control =
|
||||||
(const struct retro_disk_control_callback*)&global->system.disk_control;
|
(const struct retro_disk_control_callback*)&global->system.disk_control;
|
||||||
bool error = false;
|
|
||||||
|
|
||||||
if (!control->get_num_images)
|
if (!control->get_num_images)
|
||||||
return;
|
return;
|
||||||
@ -245,8 +245,8 @@ static void event_disk_control_set_eject(bool new_state, bool print_log)
|
|||||||
**/
|
**/
|
||||||
void event_disk_control_append_image(const char *path)
|
void event_disk_control_append_image(const char *path)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
|
||||||
unsigned new_idx;
|
unsigned new_idx;
|
||||||
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
struct retro_game_info info = {0};
|
struct retro_game_info info = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
const struct retro_disk_control_callback *control =
|
const struct retro_disk_control_callback *control =
|
||||||
@ -306,9 +306,9 @@ static void event_check_disk_eject(
|
|||||||
**/
|
**/
|
||||||
static void event_disk_control_set_index(unsigned idx)
|
static void event_disk_control_set_index(unsigned idx)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
|
||||||
unsigned num_disks;
|
unsigned num_disks;
|
||||||
global_t *global = global_get_ptr();
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
const struct retro_disk_control_callback *control =
|
const struct retro_disk_control_callback *control =
|
||||||
(const struct retro_disk_control_callback*)&global->system.disk_control;
|
(const struct retro_disk_control_callback*)&global->system.disk_control;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
@ -405,8 +405,8 @@ static void event_check_disk_next(
|
|||||||
**/
|
**/
|
||||||
static void event_set_volume(float gain)
|
static void event_set_volume(float gain)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
settings->audio.volume += gain;
|
settings->audio.volume += gain;
|
||||||
settings->audio.volume = max(settings->audio.volume, -80.0f);
|
settings->audio.volume = max(settings->audio.volume, -80.0f);
|
||||||
@ -481,7 +481,7 @@ static void event_init_controllers(void)
|
|||||||
|
|
||||||
static void event_deinit_core(bool reinit)
|
static void event_deinit_core(bool reinit)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
pretro_unload_game();
|
pretro_unload_game();
|
||||||
@ -544,8 +544,8 @@ static bool event_load_save_files(void)
|
|||||||
static void event_load_auto_state(void)
|
static void event_load_auto_state(void)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
char savestate_name_auto[PATH_MAX_LENGTH];
|
char savestate_name_auto[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
@ -575,12 +575,13 @@ static void event_load_auto_state(void)
|
|||||||
|
|
||||||
static void event_set_savestate_auto_index(void)
|
static void event_set_savestate_auto_index(void)
|
||||||
{
|
{
|
||||||
char state_dir[PATH_MAX_LENGTH], state_base[PATH_MAX_LENGTH];
|
|
||||||
size_t i;
|
size_t i;
|
||||||
struct string_list *dir_list = NULL;
|
char state_dir[PATH_MAX_LENGTH] = {0};
|
||||||
unsigned max_idx = 0;
|
char state_base[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
struct string_list *dir_list = NULL;
|
||||||
global_t *global = global_get_ptr();
|
unsigned max_idx = 0;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
if (!settings->savestate_auto_index)
|
if (!settings->savestate_auto_index)
|
||||||
return;
|
return;
|
||||||
@ -603,9 +604,9 @@ static void event_set_savestate_auto_index(void)
|
|||||||
for (i = 0; i < dir_list->size; i++)
|
for (i = 0; i < dir_list->size; i++)
|
||||||
{
|
{
|
||||||
unsigned idx;
|
unsigned idx;
|
||||||
char elem_base[PATH_MAX_LENGTH];
|
char elem_base[PATH_MAX_LENGTH] = {0};
|
||||||
const char *end = NULL;
|
const char *end = NULL;
|
||||||
const char *dir_elem = dir_list->elems[i].data;
|
const char *dir_elem = dir_list->elems[i].data;
|
||||||
|
|
||||||
fill_pathname_base(elem_base, dir_elem, sizeof(elem_base));
|
fill_pathname_base(elem_base, dir_elem, sizeof(elem_base));
|
||||||
|
|
||||||
@ -706,7 +707,7 @@ static bool event_init_core(void)
|
|||||||
static bool event_save_auto_state(void)
|
static bool event_save_auto_state(void)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
char savestate_name_auto[PATH_MAX_LENGTH];
|
char savestate_name_auto[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
@ -744,13 +745,15 @@ static void event_init_remapping(void)
|
|||||||
**/
|
**/
|
||||||
static bool event_save_core_config(void)
|
static bool event_save_core_config(void)
|
||||||
{
|
{
|
||||||
char config_dir[PATH_MAX_LENGTH], config_name[PATH_MAX_LENGTH],
|
char config_dir[PATH_MAX_LENGTH] = {0};
|
||||||
config_path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
char config_name[PATH_MAX_LENGTH] = {0};
|
||||||
bool ret = false;
|
char config_path[PATH_MAX_LENGTH] = {0};
|
||||||
bool found_path = false;
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
bool overrides_active = false;
|
bool ret = false;
|
||||||
settings_t *settings = config_get_ptr();
|
bool found_path = false;
|
||||||
global_t *global = global_get_ptr();
|
bool overrides_active = false;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
*config_dir = '\0';
|
*config_dir = '\0';
|
||||||
|
|
||||||
@ -776,7 +779,7 @@ static bool event_save_core_config(void)
|
|||||||
/* In case of collision, find an alternative name. */
|
/* In case of collision, find an alternative name. */
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
char tmp[64];
|
char tmp[64] = {0};
|
||||||
|
|
||||||
fill_pathname_base(config_name, settings->libretro,
|
fill_pathname_base(config_name, settings->libretro,
|
||||||
sizeof(config_name));
|
sizeof(config_name));
|
||||||
@ -889,9 +892,10 @@ static void event_load_state(const char *path, char *s, size_t len)
|
|||||||
|
|
||||||
static void event_main_state(unsigned cmd)
|
static void event_main_state(unsigned cmd)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
char path[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (settings->state_slot > 0)
|
if (settings->state_slot > 0)
|
||||||
snprintf(path, sizeof(path), "%s%d",
|
snprintf(path, sizeof(path), "%s%d",
|
||||||
|
1
patch.c
1
patch.c
@ -463,7 +463,6 @@ static bool apply_patch_content(uint8_t **buf,
|
|||||||
if (patch_size < 0)
|
if (patch_size < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
if (!path_file_exists(patch_path))
|
if (!path_file_exists(patch_path))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
6
rewind.c
6
rewind.c
@ -191,9 +191,9 @@ void state_manager_free(state_manager_t *state)
|
|||||||
bool state_manager_pop(state_manager_t *state, const void **data)
|
bool state_manager_pop(state_manager_t *state, const void **data)
|
||||||
{
|
{
|
||||||
size_t start;
|
size_t start;
|
||||||
uint8_t *out;
|
uint8_t *out = NULL;
|
||||||
uint16_t *out16;
|
uint16_t *out16 = NULL;
|
||||||
const uint8_t *compressed = NULL;
|
const uint8_t *compressed = NULL;
|
||||||
const uint16_t *compressed16 = NULL;
|
const uint16_t *compressed16 = NULL;
|
||||||
|
|
||||||
*data = NULL;
|
*data = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user