mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 03:40:43 +00:00
(General) Cleanup
This commit is contained in:
parent
e514c30d0f
commit
c36e21ed13
@ -835,7 +835,8 @@ static void config_set_defaults(void)
|
|||||||
**/
|
**/
|
||||||
static config_file_t *open_default_config_file(void)
|
static config_file_t *open_default_config_file(void)
|
||||||
{
|
{
|
||||||
char conf_path[PATH_MAX_LENGTH], app_path[PATH_MAX_LENGTH];
|
char conf_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char app_path[PATH_MAX_LENGTH] = {0};
|
||||||
config_file_t *conf = NULL;
|
config_file_t *conf = NULL;
|
||||||
bool saved = false;
|
bool saved = false;
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
@ -961,9 +962,9 @@ static config_file_t *open_default_config_file(void)
|
|||||||
{
|
{
|
||||||
if (home || xdg)
|
if (home || xdg)
|
||||||
{
|
{
|
||||||
/* Try to create a new config file. */
|
char basedir[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
char basedir[PATH_MAX_LENGTH];
|
/* Try to create a new config file. */
|
||||||
|
|
||||||
/* XDG_CONFIG_HOME falls back to $HOME/.config. */
|
/* XDG_CONFIG_HOME falls back to $HOME/.config. */
|
||||||
if (xdg)
|
if (xdg)
|
||||||
@ -982,7 +983,8 @@ static config_file_t *open_default_config_file(void)
|
|||||||
|
|
||||||
if (path_mkdir(basedir))
|
if (path_mkdir(basedir))
|
||||||
{
|
{
|
||||||
char skeleton_conf[PATH_MAX_LENGTH];
|
char skeleton_conf[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
fill_pathname_join(skeleton_conf, GLOBAL_CONFIG_DIR,
|
fill_pathname_join(skeleton_conf, GLOBAL_CONFIG_DIR,
|
||||||
"retroarch.cfg", sizeof(skeleton_conf));
|
"retroarch.cfg", sizeof(skeleton_conf));
|
||||||
conf = config_file_new(skeleton_conf);
|
conf = config_file_new(skeleton_conf);
|
||||||
@ -1138,15 +1140,17 @@ static void config_file_dump_all(config_file_t *conf)
|
|||||||
static bool config_load_file(const char *path, bool set_defaults)
|
static bool config_load_file(const char *path, bool set_defaults)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char *save, tmp_str[PATH_MAX_LENGTH];
|
char *save = NULL;
|
||||||
char tmp_append_path[PATH_MAX_LENGTH]; /* Don't destroy append_config_path. */
|
const char *extra_path = NULL;
|
||||||
const char *extra_path;
|
char tmp_str[PATH_MAX_LENGTH] = {0};
|
||||||
|
char tmp_append_path[PATH_MAX_LENGTH] = {0}; /* Don't destroy append_config_path. */
|
||||||
int vp_width = 0, vp_height = 0, vp_x = 0, vp_y = 0;
|
int vp_width = 0, vp_height = 0, vp_x = 0, vp_y = 0;
|
||||||
unsigned msg_color = 0;
|
unsigned msg_color = 0;
|
||||||
config_file_t *conf = NULL;
|
config_file_t *conf = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
video_viewport_t *custom_vp = (video_viewport_t*)video_viewport_get_custom();
|
video_viewport_t *custom_vp = (video_viewport_t*)
|
||||||
|
video_viewport_get_custom();
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
@ -1346,7 +1350,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
|||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64] = {0};
|
||||||
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
|
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
|
||||||
CONFIG_GET_INT_BASE(conf, settings, input.joypad_map[i], buf);
|
CONFIG_GET_INT_BASE(conf, settings, input.joypad_map[i], buf);
|
||||||
|
|
||||||
@ -1686,12 +1690,12 @@ static void config_load_core_specific(void)
|
|||||||
|
|
||||||
if (settings->core_specific_config)
|
if (settings->core_specific_config)
|
||||||
{
|
{
|
||||||
|
char tmp[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
/* Toggle has_save_path to false so it resets */
|
/* Toggle has_save_path to false so it resets */
|
||||||
global->has_set_save_path = false;
|
global->has_set_save_path = false;
|
||||||
global->has_set_state_path = false;
|
global->has_set_state_path = false;
|
||||||
|
|
||||||
char tmp[PATH_MAX_LENGTH];
|
|
||||||
strlcpy(tmp, settings->libretro, sizeof(tmp));
|
strlcpy(tmp, settings->libretro, sizeof(tmp));
|
||||||
RARCH_LOG("Loading core-specific config from: %s.\n",
|
RARCH_LOG("Loading core-specific config from: %s.\n",
|
||||||
global->core_specific_config_path);
|
global->core_specific_config_path);
|
||||||
@ -1730,11 +1734,12 @@ static void config_load_core_specific(void)
|
|||||||
*/
|
*/
|
||||||
bool config_load_override(void)
|
bool config_load_override(void)
|
||||||
{
|
{
|
||||||
char config_directory[PATH_MAX_LENGTH], /* path to the directory containing retroarch.cfg (prefix) */
|
char config_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
|
||||||
core_path[PATH_MAX_LENGTH], /* final path for core-specific configuration (prefix+suffix) */
|
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
|
||||||
game_path[PATH_MAX_LENGTH]; /* final path for game-specific configuration (prefix+suffix) */
|
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
||||||
config_file_t *new_conf;
|
config_file_t *new_conf = NULL;
|
||||||
const char *core_name, *game_name; /* suffix */
|
const char *core_name = NULL;
|
||||||
|
const char *game_name = NULL;
|
||||||
bool should_append = false;
|
bool should_append = false;
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -1822,7 +1827,7 @@ bool config_load_override(void)
|
|||||||
/* Re-load the configuration with any overrides that might have been found */
|
/* Re-load the configuration with any overrides that might have been found */
|
||||||
if (should_append)
|
if (should_append)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX_LENGTH];
|
char buf[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
if (settings->core_specific_config)
|
if (settings->core_specific_config)
|
||||||
{
|
{
|
||||||
@ -1912,13 +1917,14 @@ bool config_load_override(void)
|
|||||||
*/
|
*/
|
||||||
bool config_load_remap(void)
|
bool config_load_remap(void)
|
||||||
{
|
{
|
||||||
config_file_t *new_conf;
|
config_file_t *new_conf = NULL;
|
||||||
char remap_directory[PATH_MAX_LENGTH], /* path to the directory containing retroarch.cfg (prefix) */
|
const char *core_name = NULL;
|
||||||
core_path[PATH_MAX_LENGTH], /* final path for core-specific configuration (prefix+suffix) */
|
const char *game_name = NULL;
|
||||||
game_path[PATH_MAX_LENGTH]; /* final path for game-specific configuration (prefix+suffix) */
|
char remap_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
|
||||||
const char *core_name, *game_name; /* suffix */
|
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
|
||||||
global_t *global = global_get_ptr(); /* global pointer */
|
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
||||||
settings_t *settings = config_get_ptr(); /* config pointer */
|
global_t *global = global_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
/* Early return in case a library isn't loaded or remapping is disabled */
|
/* Early return in case a library isn't loaded or remapping is disabled */
|
||||||
if (!global->system.info.library_name || !strcmp(global->system.info.library_name,"No Core"))
|
if (!global->system.info.library_name || !strcmp(global->system.info.library_name,"No Core"))
|
||||||
@ -2040,7 +2046,8 @@ static bool config_read_keybinds(const char *path)
|
|||||||
static void save_keybind_key(config_file_t *conf, const char *prefix,
|
static void save_keybind_key(config_file_t *conf, const char *prefix,
|
||||||
const char *base, const struct retro_keybind *bind)
|
const char *base, const struct retro_keybind *bind)
|
||||||
{
|
{
|
||||||
char key[64], btn[64];
|
char key[64] = {0};
|
||||||
|
char btn[64] = {0};
|
||||||
|
|
||||||
snprintf(key, sizeof(key), "%s_%s", prefix, base);
|
snprintf(key, sizeof(key), "%s_%s", prefix, base);
|
||||||
input_keymaps_translate_rk_to_str(bind->key, btn, sizeof(btn));
|
input_keymaps_translate_rk_to_str(bind->key, btn, sizeof(btn));
|
||||||
@ -2050,7 +2057,7 @@ static void save_keybind_key(config_file_t *conf, const char *prefix,
|
|||||||
static void save_keybind_hat(config_file_t *conf, const char *key,
|
static void save_keybind_hat(config_file_t *conf, const char *key,
|
||||||
const struct retro_keybind *bind)
|
const struct retro_keybind *bind)
|
||||||
{
|
{
|
||||||
char config[16];
|
char config[16] = {0};
|
||||||
unsigned hat = GET_HAT(bind->joykey);
|
unsigned hat = GET_HAT(bind->joykey);
|
||||||
const char *dir = NULL;
|
const char *dir = NULL;
|
||||||
|
|
||||||
@ -2083,7 +2090,8 @@ static void save_keybind_hat(config_file_t *conf, const char *key,
|
|||||||
static void save_keybind_joykey(config_file_t *conf, const char *prefix,
|
static void save_keybind_joykey(config_file_t *conf, const char *prefix,
|
||||||
const char *base, const struct retro_keybind *bind)
|
const char *base, const struct retro_keybind *bind)
|
||||||
{
|
{
|
||||||
char key[64];
|
char key[64] = {0};
|
||||||
|
|
||||||
snprintf(key, sizeof(key), "%s_%s_btn", prefix, base);
|
snprintf(key, sizeof(key), "%s_%s_btn", prefix, base);
|
||||||
|
|
||||||
if (bind->joykey == NO_BTN)
|
if (bind->joykey == NO_BTN)
|
||||||
@ -2097,7 +2105,8 @@ static void save_keybind_joykey(config_file_t *conf, const char *prefix,
|
|||||||
static void save_keybind_axis(config_file_t *conf, const char *prefix,
|
static void save_keybind_axis(config_file_t *conf, const char *prefix,
|
||||||
const char *base, const struct retro_keybind *bind)
|
const char *base, const struct retro_keybind *bind)
|
||||||
{
|
{
|
||||||
char key[64], config[16];
|
char key[64] = {0};
|
||||||
|
char config[16] = {0};
|
||||||
unsigned axis = 0;
|
unsigned axis = 0;
|
||||||
char dir = '\0';
|
char dir = '\0';
|
||||||
|
|
||||||
@ -2544,7 +2553,7 @@ bool config_save_file(const char *path)
|
|||||||
settings->input.keyboard_layout);
|
settings->input.keyboard_layout);
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char cfg[64];
|
char cfg[64] = {0};
|
||||||
|
|
||||||
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
||||||
config_set_int(conf, cfg, settings->input.device[i]);
|
config_set_int(conf, cfg, settings->input.device[i]);
|
||||||
|
@ -94,8 +94,9 @@ static bool read_content_file(unsigned i, const char *path, void **buf,
|
|||||||
static void dump_to_file_desperate(const void *data,
|
static void dump_to_file_desperate(const void *data,
|
||||||
size_t size, unsigned type)
|
size_t size, unsigned type)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX_LENGTH], timebuf[PATH_MAX_LENGTH];
|
|
||||||
time_t time_;
|
time_t time_;
|
||||||
|
char path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char timebuf[PATH_MAX_LENGTH] = {0};
|
||||||
#if defined(_WIN32) && !defined(_XBOX)
|
#if defined(_WIN32) && !defined(_XBOX)
|
||||||
const char *base = getenv("APPDATA");
|
const char *base = getenv("APPDATA");
|
||||||
#elif defined(__CELLOS_LV2__) || defined(_XBOX)
|
#elif defined(__CELLOS_LV2__) || defined(_XBOX)
|
||||||
@ -356,9 +357,10 @@ static bool load_content_need_fullpath(
|
|||||||
bool need_fullpath, const char *path)
|
bool need_fullpath, const char *path)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_COMPRESSION
|
#ifdef HAVE_COMPRESSION
|
||||||
char new_path[PATH_MAX_LENGTH], new_basedir[PATH_MAX_LENGTH];
|
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
union string_list_elem_attr attributes;
|
union string_list_elem_attr attributes;
|
||||||
|
char new_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char new_basedir[PATH_MAX_LENGTH] = {0};
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
@ -601,7 +603,7 @@ bool init_content_file(void)
|
|||||||
|
|
||||||
if (ext && !strcasecmp(ext, "zip"))
|
if (ext && !strcasecmp(ext, "zip"))
|
||||||
{
|
{
|
||||||
char temporary_content[PATH_MAX_LENGTH];
|
char temporary_content[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
strlcpy(temporary_content, content->elems[i].data,
|
strlcpy(temporary_content, content->elems[i].data,
|
||||||
sizeof(temporary_content));
|
sizeof(temporary_content));
|
||||||
|
@ -596,11 +596,11 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
core_option_free(global->system.core_options);
|
core_option_free(global->system.core_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct retro_variable *vars =
|
{
|
||||||
(const struct retro_variable*)data;
|
const struct retro_variable *vars = (const struct retro_variable*)data;
|
||||||
|
char buf[PATH_MAX_LENGTH] = {0};
|
||||||
const char *options_path = settings->core_options_path;
|
const char *options_path = settings->core_options_path;
|
||||||
char buf[PATH_MAX_LENGTH];
|
|
||||||
if (!*options_path && *global->config_path)
|
if (!*options_path && *global->config_path)
|
||||||
{
|
{
|
||||||
fill_pathname_resolve_relative(buf, global->config_path,
|
fill_pathname_resolve_relative(buf, global->config_path,
|
||||||
@ -608,6 +608,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
options_path = buf;
|
options_path = buf;
|
||||||
}
|
}
|
||||||
global->system.core_options = core_option_new(options_path, vars);
|
global->system.core_options = core_option_new(options_path, vars);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -153,13 +153,13 @@ error:
|
|||||||
int read_compressed_file(const char * path, void **buf,
|
int read_compressed_file(const char * path, void **buf,
|
||||||
const char* optional_filename, ssize_t *length)
|
const char* optional_filename, ssize_t *length)
|
||||||
{
|
{
|
||||||
const char* file_ext;
|
const char* file_ext = NULL;
|
||||||
char archive_path[PATH_MAX_LENGTH], *archive_found = NULL;
|
char *archive_found = NULL;
|
||||||
|
char archive_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
if (optional_filename)
|
if (optional_filename)
|
||||||
{
|
{
|
||||||
/* Safety check.
|
/* Safety check. * If optional_filename and optional_filename
|
||||||
* If optional_filename and optional_filename
|
|
||||||
* exists, we simply return 0,
|
* exists, we simply return 0,
|
||||||
* hoping that optional_filename is the
|
* hoping that optional_filename is the
|
||||||
* same as requested.
|
* same as requested.
|
||||||
|
@ -96,7 +96,7 @@ void fill_pathname_expand_special(char *out_path,
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
size_t src_size;
|
size_t src_size;
|
||||||
char application_dir[PATH_MAX_LENGTH];
|
char application_dir[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
fill_pathname_application_path(application_dir, sizeof(application_dir));
|
fill_pathname_application_path(application_dir, sizeof(application_dir));
|
||||||
path_basedir(application_dir);
|
path_basedir(application_dir);
|
||||||
@ -119,7 +119,7 @@ void fill_pathname_abbreviate_special(char *out_path,
|
|||||||
{
|
{
|
||||||
#if !defined(RARCH_CONSOLE)
|
#if !defined(RARCH_CONSOLE)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char application_dir[PATH_MAX_LENGTH];
|
char application_dir[PATH_MAX_LENGTH] = {0};
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
|
|
||||||
fill_pathname_application_path(application_dir, sizeof(application_dir));
|
fill_pathname_application_path(application_dir, sizeof(application_dir));
|
||||||
@ -199,7 +199,7 @@ void fill_pathname_application_path(char *buf, size_t size)
|
|||||||
#else
|
#else
|
||||||
*buf = '\0';
|
*buf = '\0';
|
||||||
pid_t pid = getpid();
|
pid_t pid = getpid();
|
||||||
char link_path[PATH_MAX_LENGTH];
|
char link_path[PATH_MAX_LENGTH] = {0};
|
||||||
/* Linux, BSD and Solaris paths. Not standardized. */
|
/* Linux, BSD and Solaris paths. Not standardized. */
|
||||||
static const char *exts[] = { "exe", "file", "path/a.out" };
|
static const char *exts[] = { "exe", "file", "path/a.out" };
|
||||||
for (i = 0; i < ARRAY_SIZE(exts); i++)
|
for (i = 0; i < ARRAY_SIZE(exts); i++)
|
||||||
|
@ -610,7 +610,7 @@ static void log_connection(const struct sockaddr_storage *their_addr,
|
|||||||
|
|
||||||
if (str)
|
if (str)
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512] = {0};
|
||||||
snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\" (#%u)",
|
snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\" (#%u)",
|
||||||
nick, str, slot);
|
nick, str, slot);
|
||||||
rarch_main_msg_queue_push(msg, 1, 180, false);
|
rarch_main_msg_queue_push(msg, 1, 180, false);
|
||||||
@ -679,7 +679,7 @@ end:
|
|||||||
static bool init_tcp_socket(netplay_t *netplay, const char *server,
|
static bool init_tcp_socket(netplay_t *netplay, const char *server,
|
||||||
uint16_t port, bool spectate)
|
uint16_t port, bool spectate)
|
||||||
{
|
{
|
||||||
char port_buf[16];
|
char port_buf[16] = {0};
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
const struct addrinfo *tmp_info = NULL;
|
const struct addrinfo *tmp_info = NULL;
|
||||||
struct addrinfo hints, *res = NULL;
|
struct addrinfo hints, *res = NULL;
|
||||||
@ -734,8 +734,8 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server,
|
|||||||
static bool init_udp_socket(netplay_t *netplay, const char *server,
|
static bool init_udp_socket(netplay_t *netplay, const char *server,
|
||||||
uint16_t port)
|
uint16_t port)
|
||||||
{
|
{
|
||||||
char port_buf[16];
|
char port_buf[16] = {0};
|
||||||
struct addrinfo hints;
|
struct addrinfo hints = {0};
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
||||||
|
@ -410,6 +410,7 @@ uint64_t rarch_get_cpu_features(void)
|
|||||||
const unsigned MAX_FEATURES = \
|
const unsigned MAX_FEATURES = \
|
||||||
sizeof(" MMX MMXEXT SSE SSE2 SSE3 SSSE3 SS4 SSE4.2 AES AVX AVX2 NEON VMX VMX128 VFPU PS");
|
sizeof(" MMX MMXEXT SSE SSE2 SSE3 SSSE3 SS4 SSE4.2 AES AVX AVX2 NEON VMX VMX128 VFPU PS");
|
||||||
char buf[MAX_FEATURES];
|
char buf[MAX_FEATURES];
|
||||||
|
|
||||||
memset(buf, 0, MAX_FEATURES);
|
memset(buf, 0, MAX_FEATURES);
|
||||||
|
|
||||||
(void)flags;
|
(void)flags;
|
||||||
|
@ -321,8 +321,8 @@ size_t content_playlist_size(content_playlist_t *playlist)
|
|||||||
static bool content_playlist_read_file(
|
static bool content_playlist_read_file(
|
||||||
content_playlist_t *playlist, const char *path)
|
content_playlist_t *playlist, const char *path)
|
||||||
{
|
{
|
||||||
char buf[PLAYLIST_ENTRIES][1024];
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
char buf[PLAYLIST_ENTRIES][1024] = {0};
|
||||||
content_playlist_entry_t *entry = NULL;
|
content_playlist_entry_t *entry = NULL;
|
||||||
char *last = NULL;
|
char *last = NULL;
|
||||||
FILE *file = fopen(path, "r");
|
FILE *file = fopen(path, "r");
|
||||||
|
@ -117,7 +117,7 @@ static void print_features(void)
|
|||||||
**/
|
**/
|
||||||
static void print_help(void)
|
static void print_help(void)
|
||||||
{
|
{
|
||||||
char str[PATH_MAX_LENGTH];
|
char str[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
puts("===================================================================");
|
puts("===================================================================");
|
||||||
#ifdef HAVE_GIT_VERSION
|
#ifdef HAVE_GIT_VERSION
|
||||||
@ -840,8 +840,8 @@ static void rarch_init_savefile_paths(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char savefile_name_rtc[PATH_MAX_LENGTH];
|
|
||||||
union string_list_elem_attr attr;
|
union string_list_elem_attr attr;
|
||||||
|
char savefile_name_rtc[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
attr.i = RETRO_MEMORY_SAVE_RAM;
|
attr.i = RETRO_MEMORY_SAVE_RAM;
|
||||||
string_list_append(global->savefiles, global->savefile_name, attr);
|
string_list_append(global->savefiles, global->savefile_name, attr);
|
||||||
@ -1375,7 +1375,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
|||||||
const char *path, const char *menu_label,
|
const char *path, const char *menu_label,
|
||||||
char *s, size_t len)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
char new_core_path[PATH_MAX_LENGTH];
|
char new_core_path[PATH_MAX_LENGTH] = {0};
|
||||||
const core_info_t *info = NULL;
|
const core_info_t *info = NULL;
|
||||||
size_t supported = 0;
|
size_t supported = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
10
runloop.c
10
runloop.c
@ -123,7 +123,7 @@ static void check_fast_forward_button(bool fastforward_pressed,
|
|||||||
**/
|
**/
|
||||||
static void check_stateslots(bool pressed_increase, bool pressed_decrease)
|
static void check_stateslots(bool pressed_increase, bool pressed_decrease)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
/* Save state slots */
|
/* Save state slots */
|
||||||
@ -243,7 +243,8 @@ static void check_slowmotion(bool slowmotion_pressed)
|
|||||||
|
|
||||||
static bool check_movie_init(void)
|
static bool check_movie_init(void)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
char path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
@ -353,8 +354,9 @@ static bool check_movie(void)
|
|||||||
**/
|
**/
|
||||||
static void check_shader_dir(bool pressed_next, bool pressed_prev)
|
static void check_shader_dir(bool pressed_next, bool pressed_prev)
|
||||||
{
|
{
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
const char *shader = NULL, *ext = NULL;
|
const char *shader = NULL;
|
||||||
|
const char *ext = NULL;
|
||||||
enum rarch_shader_type type = RARCH_SHADER_NONE;
|
enum rarch_shader_type type = RARCH_SHADER_NONE;
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ void rarch_main_data_msg_queue_push(unsigned type,
|
|||||||
const char *msg, const char *msg2,
|
const char *msg, const char *msg2,
|
||||||
unsigned prio, unsigned duration, bool flush)
|
unsigned prio, unsigned duration, bool flush)
|
||||||
{
|
{
|
||||||
char new_msg[PATH_MAX_LENGTH];
|
char new_msg[PATH_MAX_LENGTH] = {0};
|
||||||
msg_queue_t *queue = NULL;
|
msg_queue_t *queue = NULL;
|
||||||
data_runloop_t *runloop = rarch_main_data_get_ptr();
|
data_runloop_t *runloop = rarch_main_data_get_ptr();
|
||||||
|
|
||||||
|
12
screenshot.c
12
screenshot.c
@ -177,7 +177,7 @@ end:
|
|||||||
|
|
||||||
static bool take_screenshot_viewport(void)
|
static bool take_screenshot_viewport(void)
|
||||||
{
|
{
|
||||||
char screenshot_path[PATH_MAX_LENGTH];
|
char screenshot_path[PATH_MAX_LENGTH] = {0};
|
||||||
const char *screenshot_dir = NULL;
|
const char *screenshot_dir = NULL;
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
@ -222,11 +222,11 @@ static bool take_screenshot_raw(void)
|
|||||||
{
|
{
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
size_t pitch;
|
size_t pitch;
|
||||||
char screenshot_path[PATH_MAX_LENGTH];
|
char screenshot_path[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
const void *data = NULL;
|
const void *data = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const char *screenshot_dir = NULL;
|
const char *screenshot_dir = NULL;
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
video_driver_cached_frame_get(data, &width, &height, &pitch);
|
video_driver_cached_frame_get(data, &width, &height, &pitch);
|
||||||
|
|
||||||
@ -343,8 +343,8 @@ bool take_screenshot(void)
|
|||||||
bool screenshot_dump(const char *folder, const void *frame,
|
bool screenshot_dump(const char *folder, const void *frame,
|
||||||
unsigned width, unsigned height, int pitch, bool bgr24)
|
unsigned width, unsigned height, int pitch, bool bgr24)
|
||||||
{
|
{
|
||||||
char filename[PATH_MAX_LENGTH];
|
char filename[PATH_MAX_LENGTH] = {0};
|
||||||
char shotname[PATH_MAX_LENGTH];
|
char shotname[PATH_MAX_LENGTH] = {0};
|
||||||
struct scaler_ctx scaler = {0};
|
struct scaler_ctx scaler = {0};
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
uint8_t *out_buffer = NULL;
|
uint8_t *out_buffer = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user