mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(menu_setting.c) Add do{}while(0) to macros
This commit is contained in:
parent
b69caea6c1
commit
d839157d13
@ -2656,82 +2656,82 @@ static void general_write_handler(void *data)
|
||||
}
|
||||
|
||||
#define START_GROUP(group_info, NAME, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
group_info.name = NAME; \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_group_setting (ST_GROUP, NAME, parent_group)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define END_GROUP(list, list_info, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_group_setting (ST_END_GROUP, 0, parent_group)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define START_SUB_GROUP(list, list_info, NAME, group_info, subgroup_info, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
subgroup_info.name = NAME; \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_subgroup_setting (ST_SUB_GROUP, NAME, group_info, parent_group)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define END_SUB_GROUP(list, list_info, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_group_setting (ST_END_SUB_GROUP, 0, parent_group)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_ACTION(NAME, SHORT, group_info, subgroup_info, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!menu_settings_list_append(list, list_info, setting_action_setting (NAME, SHORT, group_info, subgroup_info, parent_group))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_BOOL(TARGET, NAME, SHORT, DEF, OFF, ON, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!menu_settings_list_append(list, list_info, setting_bool_setting (NAME, SHORT, TARGET, DEF, OFF, ON, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_INT(TARGET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_int_setting (NAME, SHORT, &TARGET, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_UINT(TARGET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_uint_setting (NAME, SHORT, &TARGET, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_FLOAT(TARGET, NAME, SHORT, DEF, ROUNDING, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_float_setting (NAME, SHORT, &TARGET, DEF, ROUNDING, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_PATH(TARGET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_string_setting(ST_PATH, NAME, SHORT, TARGET, sizeof(TARGET), DEF, "", group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_DIR(TARGET, NAME, SHORT, DEF, EMPTY, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_string_setting(ST_DIR, NAME, SHORT, TARGET, sizeof(TARGET), DEF, EMPTY, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_STRING(TARGET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_string_setting(ST_STRING, NAME, SHORT, TARGET, sizeof(TARGET), DEF, "", group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_STRING_OPTIONS(TARGET, NAME, SHORT, DEF, OPTS, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_string_setting_options(ST_STRING_OPTIONS, NAME, SHORT, TARGET, sizeof(TARGET), DEF, "", OPTS, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#define CONFIG_HEX(TARGET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_hex_setting(NAME, SHORT, &TARGET, DEF, group_info, subgroup_info, parent_group, CHANGE_HANDLER, READ_HANDLER)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
/* Please strdup() NAME and SHORT */
|
||||
#define CONFIG_BIND(TARGET, PLAYER, PLAYER_OFFSET, NAME, SHORT, DEF, group_info, subgroup_info, parent_group) \
|
||||
{ \
|
||||
do{ \
|
||||
if (!(menu_settings_list_append(list, list_info, setting_bind_setting (NAME, SHORT, &TARGET, PLAYER, PLAYER_OFFSET, DEF, group_info, subgroup_info, parent_group)))) return false; \
|
||||
}
|
||||
}while(0)
|
||||
|
||||
#ifdef GEKKO
|
||||
#define MAX_GAMMA_SETTING 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user