mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
Some C89 fixes
This commit is contained in:
parent
9629bd126e
commit
f851440a6b
@ -3195,6 +3195,14 @@ bool config_save_file(const char *path)
|
|||||||
float msg_color;
|
float msg_color;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
int bool_settings_size = 0, int_settings_size = 0,
|
||||||
|
float_settings_size = 0, string_settings_size = 0,
|
||||||
|
path_settings_size = 0;
|
||||||
|
struct config_bool_setting *bool_settings = NULL;
|
||||||
|
struct config_int_setting *int_settings = NULL;
|
||||||
|
struct config_float_setting *float_settings = NULL;
|
||||||
|
struct config_string_setting *string_settings = NULL;
|
||||||
|
struct config_path_setting *path_settings = NULL;
|
||||||
config_file_t *conf = config_file_new(path);
|
config_file_t *conf = config_file_new(path);
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
@ -3209,25 +3217,20 @@ bool config_save_file(const char *path)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct config_bool_setting *bool_settings =
|
bool_settings =
|
||||||
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_bool_setting));
|
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_bool_setting));
|
||||||
int bool_settings_size = 0;
|
|
||||||
|
|
||||||
struct config_int_setting *int_settings =
|
int_settings =
|
||||||
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
||||||
int int_settings_size = 0;
|
|
||||||
|
|
||||||
struct config_float_setting *float_settings =
|
float_settings =
|
||||||
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
||||||
int float_settings_size = 0;
|
|
||||||
|
|
||||||
struct config_string_setting *string_settings =
|
string_settings =
|
||||||
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
||||||
int string_settings_size = 0;
|
|
||||||
|
|
||||||
struct config_path_setting *path_settings =
|
path_settings =
|
||||||
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
||||||
int path_settings_size = 0;
|
|
||||||
|
|
||||||
bool_settings_size = populate_settings_bool (settings, bool_settings);
|
bool_settings_size = populate_settings_bool (settings, bool_settings);
|
||||||
int_settings_size = populate_settings_int (settings, int_settings);
|
int_settings_size = populate_settings_int (settings, int_settings);
|
||||||
@ -3394,20 +3397,32 @@ bool config_save_file(const char *path)
|
|||||||
**/
|
**/
|
||||||
bool config_save_overrides(int override_type)
|
bool config_save_overrides(int override_type)
|
||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
bool ret = false;
|
int bool_settings_size = 0, int_settings_size = 0,
|
||||||
char config_directory[PATH_MAX_LENGTH] = {0};
|
float_settings_size = 0, string_settings_size = 0,
|
||||||
char override_directory[PATH_MAX_LENGTH] = {0};
|
path_settings_size = 0;
|
||||||
char core_path[PATH_MAX_LENGTH] = {0};
|
bool ret = false;
|
||||||
char game_path[PATH_MAX_LENGTH] = {0};
|
char config_directory[PATH_MAX_LENGTH] = {0};
|
||||||
const char *core_name = NULL;
|
char override_directory[PATH_MAX_LENGTH] = {0};
|
||||||
const char *game_name = NULL;
|
char core_path[PATH_MAX_LENGTH] = {0};
|
||||||
config_file_t *conf = NULL;
|
char game_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
const char *core_name = NULL;
|
||||||
global_t *global = global_get_ptr();
|
const char *game_name = NULL;
|
||||||
settings_t *overrides = config_get_ptr();
|
config_file_t *conf = NULL;
|
||||||
|
settings_t *settings = NULL;
|
||||||
rarch_system_info_t *system = NULL;
|
global_t *global = global_get_ptr();
|
||||||
|
settings_t *overrides = config_get_ptr();
|
||||||
|
rarch_system_info_t *system = NULL;
|
||||||
|
struct config_bool_setting *bool_settings = NULL;
|
||||||
|
struct config_bool_setting *bool_overrides = NULL;
|
||||||
|
struct config_int_setting *int_settings = NULL;
|
||||||
|
struct config_int_setting *int_overrides = NULL;
|
||||||
|
struct config_float_setting *float_settings = NULL;
|
||||||
|
struct config_float_setting *float_overrides = NULL;
|
||||||
|
struct config_string_setting *string_settings = NULL;
|
||||||
|
struct config_string_setting *string_overrides = NULL;
|
||||||
|
struct config_path_setting *path_settings = NULL;
|
||||||
|
struct config_path_setting *path_overrides = NULL;
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||||
|
|
||||||
@ -3419,38 +3434,33 @@ bool config_save_overrides(int override_type)
|
|||||||
if (string_is_empty(core_name) || string_is_empty(game_name))
|
if (string_is_empty(core_name) || string_is_empty(game_name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
settings_t *settings = (settings_t*)calloc(1, sizeof(settings_t));
|
settings = (settings_t*)calloc(1, sizeof(settings_t));
|
||||||
|
|
||||||
struct config_bool_setting *bool_settings =
|
bool_settings =
|
||||||
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH *sizeof(struct config_bool_setting));
|
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH *sizeof(struct config_bool_setting));
|
||||||
struct config_bool_setting *bool_overrides =
|
bool_overrides =
|
||||||
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH *sizeof(struct config_bool_setting));
|
(struct config_bool_setting*) malloc(PATH_MAX_LENGTH *sizeof(struct config_bool_setting));
|
||||||
|
|
||||||
struct config_int_setting *int_settings =
|
int_settings =
|
||||||
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
||||||
struct config_int_setting *int_overrides =
|
int_overrides =
|
||||||
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
(struct config_int_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_int_setting));
|
||||||
|
|
||||||
struct config_float_setting *float_settings =
|
float_settings =
|
||||||
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
||||||
struct config_float_setting *float_overrides =
|
float_overrides =
|
||||||
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
(struct config_float_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_float_setting));
|
||||||
|
|
||||||
struct config_string_setting *string_settings =
|
string_settings =
|
||||||
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
||||||
struct config_string_setting *string_overrides =
|
string_overrides =
|
||||||
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
(struct config_string_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_string_setting));
|
||||||
|
|
||||||
struct config_path_setting *path_settings =
|
path_settings =
|
||||||
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
||||||
struct config_path_setting *path_overrides =
|
path_overrides =
|
||||||
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
(struct config_path_setting*) malloc(PATH_MAX_LENGTH * sizeof(struct config_path_setting));
|
||||||
|
|
||||||
int bool_settings_size = 0;
|
|
||||||
int int_settings_size = 0;
|
|
||||||
int float_settings_size = 0;
|
|
||||||
int string_settings_size = 0;
|
|
||||||
int path_settings_size = 0;
|
|
||||||
|
|
||||||
fill_pathname_application_special(config_directory, sizeof(config_directory),
|
fill_pathname_application_special(config_directory, sizeof(config_directory),
|
||||||
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
|
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
|
||||||
|
@ -322,21 +322,24 @@ static int content_7zip_file_read(
|
|||||||
*/
|
*/
|
||||||
struct string_list *filename_split_archive(const char *path)
|
struct string_list *filename_split_archive(const char *path)
|
||||||
{
|
{
|
||||||
struct string_list *list = string_list_new();
|
|
||||||
union string_list_elem_attr attr;
|
union string_list_elem_attr attr;
|
||||||
|
struct string_list *list = string_list_new();
|
||||||
|
#ifdef HAVE_COMPRESSION
|
||||||
|
const char *delim = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&attr, 0, sizeof(attr));
|
memset(&attr, 0, sizeof(attr));
|
||||||
|
|
||||||
#ifdef HAVE_COMPRESSION
|
#ifdef HAVE_COMPRESSION
|
||||||
const char *delim = path_get_archive_delim(path);
|
delim = path_get_archive_delim(path);
|
||||||
|
|
||||||
if (delim)
|
if (delim)
|
||||||
{
|
{
|
||||||
// add archive path to list first
|
/* add archive path to list first */
|
||||||
if (!string_list_append_n(list, path, delim - path, attr))
|
if (!string_list_append_n(list, path, delim - path, attr))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
// now add the path within the archive
|
/* now add the path within the archive */
|
||||||
delim++;
|
delim++;
|
||||||
|
|
||||||
if (*delim)
|
if (*delim)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user