This commit is contained in:
twinaphex 2016-09-01 03:05:31 +02:00
parent 204c7544b0
commit d203fd9d0d
2 changed files with 16 additions and 16 deletions

View File

@ -77,7 +77,7 @@
tmp = (struct config_path_setting_ptr*)realloc(tmp, sizeof(struct config_path_setting_ptr) * (count + 1)); \ tmp = (struct config_path_setting_ptr*)realloc(tmp, sizeof(struct config_path_setting_ptr) * (count + 1)); \
tmp[count].ident = key; \ tmp[count].ident = key; \
tmp[count].defaults = defval; \ tmp[count].defaults = defval; \
tmp[count].value = configval; \ tmp[count].ptr = configval; \
count++; \ count++; \
} \ } \
@ -88,7 +88,7 @@
else \ else \
tmp = (struct config_array_setting_ptr*)realloc(tmp, sizeof(struct config_array_setting_ptr) * (count + 1)); \ tmp = (struct config_array_setting_ptr*)realloc(tmp, sizeof(struct config_array_setting_ptr) * (count + 1)); \
tmp[count].ident = key; \ tmp[count].ident = key; \
tmp[count].value = configval; \ tmp[count].ptr = configval; \
if (default_enable) \ if (default_enable) \
tmp[count].def = default_setting; \ tmp[count].def = default_setting; \
tmp[count].handle = handle_setting; \ tmp[count].handle = handle_setting; \
@ -1797,7 +1797,7 @@ static bool config_load_file(const char *path, bool set_defaults,
{ {
if (array_settings[i].handle) if (array_settings[i].handle)
config_get_array(conf, array_settings[i].ident, config_get_array(conf, array_settings[i].ident,
array_settings[i].value, sizeof(array_settings[i].value)); array_settings[i].ptr, sizeof(array_settings[i].ptr));
} }
/* Path settings */ /* Path settings */
@ -2913,9 +2913,9 @@ bool config_save_file(const char *path)
/* Path settings */ /* Path settings */
for (i = 0; i < path_settings_size; i++) for (i = 0; i < path_settings_size; i++)
{ {
const char *value = path_settings[i].value; const char *value = path_settings[i].ptr;
if (path_settings[i].defaults && string_is_empty(path_settings[i].value)) if (path_settings[i].defaults && string_is_empty(path_settings[i].ptr))
value = "default"; value = "default";
config_set_path(conf, path_settings[i].ident, value); config_set_path(conf, path_settings[i].ident, value);
@ -2929,7 +2929,7 @@ bool config_save_file(const char *path)
/* String settings */ /* String settings */
for (i = 0; i < array_settings_size; i++) for (i = 0; i < array_settings_size; i++)
config_set_string(conf, array_settings[i].ident, config_set_string(conf, array_settings[i].ident,
array_settings[i].value); array_settings[i].ptr);
/* Float settings */ /* Float settings */
for (i = 0; i < float_settings_size; i++) for (i = 0; i < float_settings_size; i++)
@ -3161,26 +3161,26 @@ bool config_save_overrides(int override_type)
} }
for (i = 0; i < array_settings_size; i++) for (i = 0; i < array_settings_size; i++)
{ {
if (!string_is_equal(array_settings[i].value, array_overrides[i].value)) if (!string_is_equal(array_settings[i].ptr, array_overrides[i].ptr))
{ {
RARCH_LOG(" original: %s=%s\n", RARCH_LOG(" original: %s=%s\n",
array_settings[i].ident, array_settings[i].value); array_settings[i].ident, array_settings[i].ptr);
RARCH_LOG(" override: %s=%s\n", RARCH_LOG(" override: %s=%s\n",
array_overrides[i].ident, array_overrides[i].value); array_overrides[i].ident, array_overrides[i].ptr);
config_set_string(conf, array_overrides[i].ident, config_set_string(conf, array_overrides[i].ident,
array_overrides[i].value); array_overrides[i].ptr);
} }
} }
for (i = 0; i < path_settings_size; i++) for (i = 0; i < path_settings_size; i++)
{ {
if (!string_is_equal(path_settings[i].value, path_overrides[i].value)) if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr))
{ {
RARCH_LOG(" original: %s=%s\n", RARCH_LOG(" original: %s=%s\n",
path_settings[i].ident, path_settings[i].value); path_settings[i].ident, path_settings[i].ptr);
RARCH_LOG(" override: %s=%s\n", RARCH_LOG(" override: %s=%s\n",
path_overrides[i].ident, path_overrides[i].value); path_overrides[i].ident, path_overrides[i].ptr);
config_set_path(conf, path_overrides[i].ident, config_set_path(conf, path_overrides[i].ident,
path_overrides[i].value); path_overrides[i].ptr);
} }
} }

View File

@ -67,7 +67,7 @@ struct config_float_setting_ptr
struct config_array_setting_ptr struct config_array_setting_ptr
{ {
const char *ident; const char *ident;
char *value; char *ptr;
bool def_enable; bool def_enable;
const char *def; const char *def;
bool handle; bool handle;
@ -77,7 +77,7 @@ struct config_path_setting_ptr
{ {
const char *ident; const char *ident;
bool defaults; bool defaults;
const char *value; const char *ptr;
}; };
typedef struct settings typedef struct settings