This commit is contained in:
twinaphex 2014-10-16 08:20:09 +02:00
parent ce9469cb98
commit 023bb20b91
2 changed files with 16 additions and 13 deletions

View File

@ -66,13 +66,13 @@ void settings_list_current_add_flags(
rarch_setting_info_t *list_info,
unsigned values)
{
(*list)[list_info->index - 1].flags |= values;
unsigned index = list_info->index - 1;
(*list)[index].flags |= values;
if (values & SD_FLAG_IS_DEFERRED)
{
(*list)[list_info->index - 1].deferred_handler = (*list)[list_info->index - 1].change_handler;
(*list)[list_info->index - 1].change_handler = null_write_handler;
(*list)[index].deferred_handler = (*list)[index].change_handler;
(*list)[index].change_handler = null_write_handler;
}
}
@ -82,11 +82,13 @@ void settings_list_current_add_range(
float min, float max, float step,
bool enforce_minrange_enable, bool enforce_maxrange_enable)
{
(*list)[list_info->index - 1].min = min;
(*list)[list_info->index - 1].step = step;
(*list)[list_info->index - 1].max = max;
(*list)[list_info->index - 1].enforce_minrange = enforce_minrange_enable;
(*list)[list_info->index - 1].enforce_maxrange = enforce_maxrange_enable;
unsigned index = list_info->index - 1;
(*list)[index].min = min;
(*list)[index].step = step;
(*list)[index].max = max;
(*list)[index].enforce_minrange = enforce_minrange_enable;
(*list)[index].enforce_maxrange = enforce_maxrange_enable;
settings_list_current_add_flags(list, list_info, SD_FLAG_HAS_RANGE);
}
@ -96,7 +98,8 @@ void settings_list_current_add_values(
rarch_setting_info_t *list_info,
const char *values)
{
(*list)[list_info->index -1].values = values;
unsigned index = list_info->index - 1;
(*list)[index].values = values;
}
void settings_list_current_add_cmd(
@ -104,7 +107,8 @@ void settings_list_current_add_cmd(
rarch_setting_info_t *list_info,
unsigned values)
{
(*list)[list_info->index -1].cmd_trigger.idx = values;
unsigned index = list_info->index - 1;
(*list)[index].cmd_trigger.idx = values;
}
void settings_list_free(rarch_setting_t *list)

View File

@ -15,11 +15,10 @@
*/
#include <stdint.h>
#include <stdlib.h>
#include "string_list.h"
#include <string.h>
#include "miscellaneous.h"
#include "compat/strl.h"
#include "string_list.h"
#include "compat/posix_string.h"
void string_list_free(struct string_list *list)