mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(settings_data.c) Simplify APPEND macro
This commit is contained in:
parent
3a16afc226
commit
1c439c7f2a
@ -2124,22 +2124,13 @@ static void general_write_handler(void *data)
|
|||||||
rarch_main_command(rarch_cmd);
|
rarch_main_command(rarch_cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define APPEND(list, list_info, VALUE) \
|
#define APPEND(list, list_info, VALUE) \
|
||||||
if (list_info->index == list_info->size) \
|
if (list_info->index == list_info->size) \
|
||||||
{ \
|
{ \
|
||||||
list_info->size *= 2; \
|
list_info->size *= 2; \
|
||||||
\
|
|
||||||
if (!(list = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * list_info->size))) \
|
if (!(list = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * list_info->size))) \
|
||||||
{ \
|
goto error; \
|
||||||
RARCH_ERR("Settings list reallocation failed.\n"); \
|
} \
|
||||||
free(list); \
|
|
||||||
if (list_info) \
|
|
||||||
free(list_info); \
|
|
||||||
list = NULL; \
|
|
||||||
list_info = NULL; \
|
|
||||||
return NULL; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
(list[list_info->index++]) = VALUE
|
(list[list_info->index++]) = VALUE
|
||||||
|
|
||||||
#define START_GROUP(group_info, NAME) strlcpy(group_info.name, NAME, sizeof(group_info.name)); APPEND(list, list_info, setting_data_group_setting (ST_GROUP, NAME));
|
#define START_GROUP(group_info, NAME) strlcpy(group_info.name, NAME, sizeof(group_info.name)); APPEND(list, list_info, setting_data_group_setting (ST_GROUP, NAME));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user