diff --git a/configuration.c b/configuration.c index 6c00a5a085..762a9db870 100644 --- a/configuration.c +++ b/configuration.c @@ -1154,6 +1154,16 @@ static void config_file_dump_all(config_file_t *conf) } } #endif + +static void config_get_hex_base(config_file_t *conf, const char *key, unsigned *base) +{ + unsigned tmp = 0; + if (!base) + return; + if (config_get_hex(conf, key, &tmp)) + *base = tmp; +} + /** * config_load: * @path : path to be read from. @@ -1264,12 +1274,12 @@ static bool config_load_file(const char *path, bool set_defaults) "menu_navigation_browser_filter_supported_extensions_enable"); CONFIG_GET_BOOL_BASE(conf, settings, menu.show_advanced_settings, "menu_show_advanced_settings"); - CONFIG_GET_HEX_BASE(conf, settings, menu.entry_normal_color, - "menu_entry_normal_color"); - CONFIG_GET_HEX_BASE(conf, settings, menu.entry_hover_color, - "menu_entry_hover_color"); - CONFIG_GET_HEX_BASE(conf, settings, menu.title_color, - "menu_title_color"); + config_get_hex_base(conf, "menu_entry_normal_color", + &settings->menu.entry_normal_color); + config_get_hex_base(conf, "menu_entry_hover_color", + &settings->menu.entry_hover_color); + config_get_hex_base(conf, "menu_title_color", + &settings->menu.title_color); config_get_path(conf, "menu_wallpaper", settings->menu.wallpaper, sizeof(settings->menu.wallpaper)); if (!strcmp(settings->menu.wallpaper, "default")) diff --git a/libretro-common/include/file/config_file.h b/libretro-common/include/file/config_file.h index 359c1bf523..710c6e06dc 100644 --- a/libretro-common/include/file/config_file.h +++ b/libretro-common/include/file/config_file.h @@ -46,18 +46,6 @@ extern "C" { base->var = tmp; \ } while(0) -#define CONFIG_GET_UINT64_BASE(conf, base, var, key) do { \ - uint64_t tmp = 0; \ - if (config_get_int(conf, key, &tmp)) \ - base->var = tmp; \ -} while(0) - -#define CONFIG_GET_HEX_BASE(conf, base, var, key) do { \ - unsigned tmp = 0; \ - if (config_get_hex(conf, key, &tmp)) \ - base->var = tmp; \ -} while(0) - #define CONFIG_GET_FLOAT_BASE(conf, base, var, key) do { \ float tmp = 0.0f; \ if (config_get_float(conf, key, &tmp)) \