From 5f9f43929a62f1d15eeaea74ebadc6917e3b9711 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 25 Apr 2017 18:54:01 +0200 Subject: [PATCH] Turn settings->input.binds into static struct inside input_config.c --- configuration.h | 1 - input/input_config.c | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/configuration.h b/configuration.h index a11ad9e655..5029ff63eb 100644 --- a/configuration.h +++ b/configuration.h @@ -278,7 +278,6 @@ typedef struct settings char device_names[MAX_USERS][64]; unsigned remap_ids[MAX_USERS][RARCH_BIND_LIST_END]; - struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END]; unsigned max_users; diff --git a/input/input_config.c b/input/input_config.c index 878c1f9324..14ded83a61 100644 --- a/input/input_config.c +++ b/input/input_config.c @@ -81,6 +81,8 @@ static const char *bind_user_prefix[MAX_USERS] = { static int input_config_vid[MAX_USERS]; static int input_config_pid[MAX_USERS]; +static struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END]; + #define DECLARE_BIND(x, bind, desc) { true, 0, #x, desc, bind } #define DECLARE_META_BIND(level, x, bind, desc) { true, level, #x, desc, bind } @@ -152,20 +154,17 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = { struct retro_keybind *input_config_get_specific_bind_ptr(unsigned i, unsigned j) { - settings_t *settings = config_get_ptr(); - return (struct retro_keybind*)&settings->input.binds[i][j]; + return (struct retro_keybind*)&input_config_binds[i][j]; } const struct retro_keybind *input_config_get_specific_bind(unsigned i, unsigned j) { - settings_t *settings = config_get_ptr(); - return &settings->input.binds[i][j]; + return &input_config_binds[i][j]; } struct retro_keybind *input_config_get_binds(unsigned i) { - settings_t *settings = config_get_ptr(); - return settings->input.binds[i]; + return input_config_binds[i]; } static const void *input_config_bind_map_get(unsigned i) @@ -592,10 +591,9 @@ int32_t input_config_get_vid(unsigned port) void input_config_reset(void) { unsigned i; - settings_t *settings = config_get_ptr(); - retro_assert(sizeof(settings->input.binds[0]) >= sizeof(retro_keybinds_1)); - retro_assert(sizeof(settings->input.binds[1]) >= sizeof(retro_keybinds_rest)); + retro_assert(sizeof(input_config_binds[0]) >= sizeof(retro_keybinds_1)); + retro_assert(sizeof(input_config_binds[1]) >= sizeof(retro_keybinds_rest)); memcpy(input_config_get_binds(0), retro_keybinds_1, sizeof(retro_keybinds_1));